diff --git a/README.md b/README.md index 66f95ee..37decfd 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s - Retrieving project IDs for participants with incomplete project involvement - Create, check status, and manage columns of imported data projects, as well as initiate, monitor, and download data exports - Add, retrieve, update and delete single or multiple records in imported data projects +- Managing contacts within mailing lists +- Retrieving detailed history for contacts in mailing lists ## ✨ Why choose this client? @@ -66,7 +68,19 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s - Get a record from imported data project - Delete a record from imported data project - Update a record in imported data project - + +- ✅ Mailing List Contacts API + - Create contact in mailing list + - List contacts in mailing list + - List bounced contacts in mailing list + - List opted-out contacts in mailing list + - Get contact in mailing list + - Update contact in mailing list + - Delete contact in mailing list + +- ✅ Mailing List Contacts History API + - Get contact history in mailing list + ## 🚨 Project status > ⚠️ **Note: This is a development version!** @@ -76,7 +90,7 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s ## 📦 Version information -- **Current Version**: `0.1.2` +- **Current Version**: `0.1.3` - **Supported API Version**: `v3` - **Java Compatibility**: Java 17+ @@ -98,7 +112,7 @@ You can add the library to your project by including the dependency from Maven C pl.wtx.qualtrics qualtrics-api-client - 0.1.2 + 0.1.3 ``` @@ -116,7 +130,7 @@ Then add the locally built artifact to your project: pl.wtx.qualtrics qualtrics-api-client - 0.1.2 + 0.1.3 ``` diff --git a/pom.xml b/pom.xml index 3d34dcd..e0bb07a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pl.wtx.qualtrics qualtrics-api-client - 0.1.2 + 0.1.3 jar Qualtrics API Client for Java diff --git a/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsApi.java b/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsApi.java new file mode 100644 index 0000000..ade5622 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsApi.java @@ -0,0 +1,1214 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client; + +import pl.wtx.qualtrics.api.client.invoker.ApiCallback; +import pl.wtx.qualtrics.api.client.invoker.ApiClient; +import pl.wtx.qualtrics.api.client.invoker.ApiException; +import pl.wtx.qualtrics.api.client.invoker.ApiResponse; +import pl.wtx.qualtrics.api.client.invoker.Configuration; +import pl.wtx.qualtrics.api.client.invoker.Pair; +import pl.wtx.qualtrics.api.client.invoker.ProgressRequestBody; +import pl.wtx.qualtrics.api.client.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import pl.wtx.qualtrics.api.client.model.CreateContactResponse; +import pl.wtx.qualtrics.api.client.model.CreateMailingListContactRequest; +import pl.wtx.qualtrics.api.client.model.DefaultErrorResponse; +import pl.wtx.qualtrics.api.client.model.DeleteContactResponse; +import pl.wtx.qualtrics.api.client.model.GetMailingListContactResponse; +import pl.wtx.qualtrics.api.client.model.ListContactsInContactListResponse; +import java.time.OffsetDateTime; +import pl.wtx.qualtrics.api.client.model.PageOfContacts; +import pl.wtx.qualtrics.api.client.model.UpdateContactResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MailingListContactsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MailingListContactsApi() { + this(Configuration.getDefaultApiClient()); + } + + public MailingListContactsApi(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 createMailingListContact + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful create contact results -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public okhttp3.Call createMailingListContactCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createMailingListContactRequest; + + // create path and map variables + String localVarPath = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts" + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createMailingListContactValidateBeforeCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling createMailingListContact(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling createMailingListContact(Async)"); + } + + return createMailingListContactCall(mailingListId, directoryId, createMailingListContactRequest, _callback); + + } + + /** + * Create Contact In Mailing List + * Create a contact in a specified mailing list. <!--From Readme--> <!-- theme: info --> >### Performance and Operational Comments >It is recommended to run only one import at a time. There is no size limit on the data. It will not speed up imports to a single mailinglist by sending more than one request as the batches are processed sequentially. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### Deduplication >If deduplication is on and a contact exists with the same deduplication criteria then it will modify the original contact's information. > You can find more information on [the support page for deduplication](https://www.qualtrics.com/support/iq-directory/directory-settings-tab/automatic-deduplication/). + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (optional) + * @return CreateContactResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful create contact results -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public CreateContactResponse createMailingListContact(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest) throws ApiException { + ApiResponse localVarResp = createMailingListContactWithHttpInfo(mailingListId, directoryId, createMailingListContactRequest); + return localVarResp.getData(); + } + + /** + * Create Contact In Mailing List + * Create a contact in a specified mailing list. <!--From Readme--> <!-- theme: info --> >### Performance and Operational Comments >It is recommended to run only one import at a time. There is no size limit on the data. It will not speed up imports to a single mailinglist by sending more than one request as the batches are processed sequentially. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### Deduplication >If deduplication is on and a contact exists with the same deduplication criteria then it will modify the original contact's information. > You can find more information on [the support page for deduplication](https://www.qualtrics.com/support/iq-directory/directory-settings-tab/automatic-deduplication/). + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (optional) + * @return ApiResponse<CreateContactResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful create contact results -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public ApiResponse createMailingListContactWithHttpInfo(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest) throws ApiException { + okhttp3.Call localVarCall = createMailingListContactValidateBeforeCall(mailingListId, directoryId, createMailingListContactRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Contact In Mailing List (asynchronously) + * Create a contact in a specified mailing list. <!--From Readme--> <!-- theme: info --> >### Performance and Operational Comments >It is recommended to run only one import at a time. There is no size limit on the data. It will not speed up imports to a single mailinglist by sending more than one request as the batches are processed sequentially. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### Deduplication >If deduplication is on and a contact exists with the same deduplication criteria then it will modify the original contact's information. > You can find more information on [the support page for deduplication](https://www.qualtrics.com/support/iq-directory/directory-settings-tab/automatic-deduplication/). + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful create contact results -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public okhttp3.Call createMailingListContactAsync(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createMailingListContactValidateBeforeCall(mailingListId, directoryId, createMailingListContactRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteMailingListContact + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool 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 + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Delete Contact response -
0 A default error response -
+ */ + public okhttp3.Call deleteMailingListContactCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts/{contactId}" + .replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString())) + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteMailingListContactValidateBeforeCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, 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 deleteMailingListContact(Async)"); + } + + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling deleteMailingListContact(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling deleteMailingListContact(Async)"); + } + + return deleteMailingListContactCall(contactId, mailingListId, directoryId, _callback); + + } + + /** + * Delete Contact In Mailing List + * Delete a single contact from a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The contact only gets removed from the mailing list, they will remain in the directory. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @return DeleteContactResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Delete Contact response -
0 A default error response -
+ */ + public DeleteContactResponse deleteMailingListContact(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId) throws ApiException { + ApiResponse localVarResp = deleteMailingListContactWithHttpInfo(contactId, mailingListId, directoryId); + return localVarResp.getData(); + } + + /** + * Delete Contact In Mailing List + * Delete a single contact from a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The contact only gets removed from the mailing list, they will remain in the directory. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @return ApiResponse<DeleteContactResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Delete Contact response -
0 A default error response -
+ */ + public ApiResponse deleteMailingListContactWithHttpInfo(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId) throws ApiException { + okhttp3.Call localVarCall = deleteMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Contact In Mailing List (asynchronously) + * Delete a single contact from a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The contact only gets removed from the mailing list, they will remain in the directory. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool 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 + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Delete Contact response -
0 A default error response -
+ */ + public okhttp3.Call deleteMailingListContactAsync(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMailingListContact + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool 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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call getMailingListContactCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts/{contactId}" + .replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString())) + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMailingListContactValidateBeforeCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, 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 getMailingListContact(Async)"); + } + + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling getMailingListContact(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling getMailingListContact(Async)"); + } + + return getMailingListContactCall(contactId, mailingListId, directoryId, _callback); + + } + + /** + * Get Contact In Mailing List + * Retrieve a specified contact within a mailing list. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @return GetMailingListContactResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public GetMailingListContactResponse getMailingListContact(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId) throws ApiException { + ApiResponse localVarResp = getMailingListContactWithHttpInfo(contactId, mailingListId, directoryId); + return localVarResp.getData(); + } + + /** + * Get Contact In Mailing List + * Retrieve a specified contact within a mailing list. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @return ApiResponse<GetMailingListContactResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public ApiResponse getMailingListContactWithHttpInfo(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId) throws ApiException { + okhttp3.Call localVarCall = getMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Contact In Mailing List (asynchronously) + * Retrieve a specified contact within a mailing list. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool 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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call getMailingListContactAsync(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listMailingListBouncedContacts + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListBouncedContactsCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable OffsetDateTime since, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/bouncedContacts" + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (since != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (skipToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("skipToken", skipToken)); + } + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMailingListBouncedContactsValidateBeforeCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable OffsetDateTime since, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling listMailingListBouncedContacts(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling listMailingListBouncedContacts(Async)"); + } + + return listMailingListBouncedContactsCall(mailingListId, directoryId, since, pageSize, skipToken, _callback); + + } + + /** + * List Bounced Contacts In Mailing List + * Return a list of contacts in a mailing list who have had an email bounce. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @return PageOfContacts + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public PageOfContacts listMailingListBouncedContacts(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable OffsetDateTime since, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken) throws ApiException { + ApiResponse localVarResp = listMailingListBouncedContactsWithHttpInfo(mailingListId, directoryId, since, pageSize, skipToken); + return localVarResp.getData(); + } + + /** + * List Bounced Contacts In Mailing List + * Return a list of contacts in a mailing list who have had an email bounce. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @return ApiResponse<PageOfContacts> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public ApiResponse listMailingListBouncedContactsWithHttpInfo(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable OffsetDateTime since, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken) throws ApiException { + okhttp3.Call localVarCall = listMailingListBouncedContactsValidateBeforeCall(mailingListId, directoryId, since, pageSize, skipToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Bounced Contacts In Mailing List (asynchronously) + * Return a list of contacts in a mailing list who have had an email bounce. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListBouncedContactsAsync(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable OffsetDateTime since, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listMailingListBouncedContactsValidateBeforeCall(mailingListId, directoryId, since, pageSize, skipToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listMailingListContacts + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 50) + * @param skipToken The start position for pagination. (optional) + * @param includeEmbedded Whether `embeddedData` is returned in the response. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListContactsCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Boolean includeEmbedded, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts" + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (skipToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("skipToken", skipToken)); + } + + if (includeEmbedded != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("includeEmbedded", includeEmbedded)); + } + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMailingListContactsValidateBeforeCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Boolean includeEmbedded, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling listMailingListContacts(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling listMailingListContacts(Async)"); + } + + return listMailingListContactsCall(mailingListId, directoryId, pageSize, skipToken, includeEmbedded, _callback); + + } + + /** + * List Contacts In Mailing List + * Return a list of contacts in a specified mailing list. <!--From Readme--> For the last page of results, the value associated with `nextPage` will be `null`. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The maximum value for `pageSize` is 50. > The new string-based pagination functionality results in improved performance and a lower rate of timeouts. To opt in, append query parameter `useNewPaginationScheme=true`. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 50) + * @param skipToken The start position for pagination. (optional) + * @param includeEmbedded Whether `embeddedData` is returned in the response. (optional) + * @return ListContactsInContactListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public ListContactsInContactListResponse listMailingListContacts(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Boolean includeEmbedded) throws ApiException { + ApiResponse localVarResp = listMailingListContactsWithHttpInfo(mailingListId, directoryId, pageSize, skipToken, includeEmbedded); + return localVarResp.getData(); + } + + /** + * List Contacts In Mailing List + * Return a list of contacts in a specified mailing list. <!--From Readme--> For the last page of results, the value associated with `nextPage` will be `null`. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The maximum value for `pageSize` is 50. > The new string-based pagination functionality results in improved performance and a lower rate of timeouts. To opt in, append query parameter `useNewPaginationScheme=true`. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 50) + * @param skipToken The start position for pagination. (optional) + * @param includeEmbedded Whether `embeddedData` is returned in the response. (optional) + * @return ApiResponse<ListContactsInContactListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public ApiResponse listMailingListContactsWithHttpInfo(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Boolean includeEmbedded) throws ApiException { + okhttp3.Call localVarCall = listMailingListContactsValidateBeforeCall(mailingListId, directoryId, pageSize, skipToken, includeEmbedded, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Contacts In Mailing List (asynchronously) + * Return a list of contacts in a specified mailing list. <!--From Readme--> For the last page of results, the value associated with `nextPage` will be `null`. <!-- theme: warning --> >### This API call is only available to XM Directory users. > <!-- theme: warning --> >### The maximum value for `pageSize` is 50. > The new string-based pagination functionality results in improved performance and a lower rate of timeouts. To opt in, append query parameter `useNewPaginationScheme=true`. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 50) + * @param skipToken The start position for pagination. (optional) + * @param includeEmbedded Whether `embeddedData` is returned in the response. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListContactsAsync(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Boolean includeEmbedded, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listMailingListContactsValidateBeforeCall(mailingListId, directoryId, pageSize, skipToken, includeEmbedded, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listMailingListOptedOutContacts + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListOptedOutContactsCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/optedOutContacts" + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (skipToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("skipToken", skipToken)); + } + + if (since != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since)); + } + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMailingListOptedOutContactsValidateBeforeCall(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable OffsetDateTime since, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling listMailingListOptedOutContacts(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling listMailingListOptedOutContacts(Async)"); + } + + return listMailingListOptedOutContactsCall(mailingListId, directoryId, pageSize, skipToken, since, _callback); + + } + + /** + * List Opted-Out Contacts In Mailing List + * Return a list of contacts in a mailing list who have opted out. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @return PageOfContacts + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public PageOfContacts listMailingListOptedOutContacts(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable OffsetDateTime since) throws ApiException { + ApiResponse localVarResp = listMailingListOptedOutContactsWithHttpInfo(mailingListId, directoryId, pageSize, skipToken, since); + return localVarResp.getData(); + } + + /** + * List Opted-Out Contacts In Mailing List + * Return a list of contacts in a mailing list who have opted out. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (optional) + * @return ApiResponse<PageOfContacts> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public ApiResponse listMailingListOptedOutContactsWithHttpInfo(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable OffsetDateTime since) throws ApiException { + okhttp3.Call localVarCall = listMailingListOptedOutContactsValidateBeforeCall(mailingListId, directoryId, pageSize, skipToken, since, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Opted-Out Contacts In Mailing List (asynchronously) + * Return a list of contacts in a mailing list who have opted out. + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param skipToken The start position for pagination. (optional) + * @param since The bounced date of the email from which to begin searching for opted-out contacts in the mailing list. (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 A collection of contacts -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call listMailingListOptedOutContactsAsync(@javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable OffsetDateTime since, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listMailingListOptedOutContactsValidateBeforeCall(mailingListId, directoryId, pageSize, skipToken, since, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateMailingListContact + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Update Contact response -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public okhttp3.Call updateMailingListContactCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createMailingListContactRequest; + + // create path and map variables + String localVarPath = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts/{contactId}" + .replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString())) + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateMailingListContactValidateBeforeCall(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, 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 updateMailingListContact(Async)"); + } + + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling updateMailingListContact(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling updateMailingListContact(Async)"); + } + + return updateMailingListContactCall(contactId, mailingListId, directoryId, createMailingListContactRequest, _callback); + + } + + /** + * Update Contact In Mailing List + * Update a single contact in a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (optional) + * @return UpdateContactResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Update Contact response -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public UpdateContactResponse updateMailingListContact(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest) throws ApiException { + ApiResponse localVarResp = updateMailingListContactWithHttpInfo(contactId, mailingListId, directoryId, createMailingListContactRequest); + return localVarResp.getData(); + } + + /** + * Update Contact In Mailing List + * Update a single contact in a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (optional) + * @return ApiResponse<UpdateContactResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Update Contact response -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public ApiResponse updateMailingListContactWithHttpInfo(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest) throws ApiException { + okhttp3.Call localVarCall = updateMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, createMailingListContactRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Contact In Mailing List (asynchronously) + * Update a single contact in a mailing list. <!--From Readme--> <!-- theme: warning --> >### This API call is only available to XM Directory users. > + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param createMailingListContactRequest (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Update Contact response -
400 Invalid arguments response -
401 Unauthorized -
0 A default error response -
+ */ + public okhttp3.Call updateMailingListContactAsync(@javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable CreateMailingListContactRequest createMailingListContactRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateMailingListContactValidateBeforeCall(contactId, mailingListId, directoryId, createMailingListContactRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsHistoryApi.java b/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsHistoryApi.java new file mode 100644 index 0000000..12675f1 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsHistoryApi.java @@ -0,0 +1,260 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client; + +import pl.wtx.qualtrics.api.client.invoker.ApiCallback; +import pl.wtx.qualtrics.api.client.invoker.ApiClient; +import pl.wtx.qualtrics.api.client.invoker.ApiException; +import pl.wtx.qualtrics.api.client.invoker.ApiResponse; +import pl.wtx.qualtrics.api.client.invoker.Configuration; +import pl.wtx.qualtrics.api.client.invoker.Pair; +import pl.wtx.qualtrics.api.client.invoker.ProgressRequestBody; +import pl.wtx.qualtrics.api.client.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import pl.wtx.qualtrics.api.client.model.DefaultErrorResponse; +import pl.wtx.qualtrics.api.client.model.GetContactHistoryResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MailingListContactsHistoryApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MailingListContactsHistoryApi() { + this(Configuration.getDefaultApiClient()); + } + + public MailingListContactsHistoryApi(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 getMailingListContactHistory + * @param type The desired history type; one of two values: email and response (required) + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param skipToken The start position for pagination. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call getMailingListContactHistoryCall(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new 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 = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts/{contactId}/history" + .replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString())) + .replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString())) + .replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (skipToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("skipToken", skipToken)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + 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_token", "public_oauth2", "public_oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMailingListContactHistoryValidateBeforeCall(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling getMailingListContactHistory(Async)"); + } + + // verify the required parameter 'contactId' is set + if (contactId == null) { + throw new ApiException("Missing the required parameter 'contactId' when calling getMailingListContactHistory(Async)"); + } + + // verify the required parameter 'mailingListId' is set + if (mailingListId == null) { + throw new ApiException("Missing the required parameter 'mailingListId' when calling getMailingListContactHistory(Async)"); + } + + // verify the required parameter 'directoryId' is set + if (directoryId == null) { + throw new ApiException("Missing the required parameter 'directoryId' when calling getMailingListContactHistory(Async)"); + } + + return getMailingListContactHistoryCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, _callback); + + } + + /** + * Get Contact History In Mailing List + * Retrieve the history for contacts in a mailing list. <!--From Readme--> For the last page of results, the value associated with _nextPage_ will be **null**. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param type The desired history type; one of two values: email and response (required) + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param skipToken The start position for pagination. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @return GetContactHistoryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public GetContactHistoryResponse getMailingListContactHistory(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize) throws ApiException { + ApiResponse localVarResp = getMailingListContactHistoryWithHttpInfo(type, contactId, mailingListId, directoryId, skipToken, pageSize); + return localVarResp.getData(); + } + + /** + * Get Contact History In Mailing List + * Retrieve the history for contacts in a mailing list. <!--From Readme--> For the last page of results, the value associated with _nextPage_ will be **null**. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param type The desired history type; one of two values: email and response (required) + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param skipToken The start position for pagination. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @return ApiResponse<GetContactHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public ApiResponse getMailingListContactHistoryWithHttpInfo(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = getMailingListContactHistoryValidateBeforeCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Contact History In Mailing List (asynchronously) + * Retrieve the history for contacts in a mailing list. <!--From Readme--> For the last page of results, the value associated with _nextPage_ will be **null**. <!-- theme: warning --> >### This API call is only available to XM Directory users. + * @param type The desired history type; one of two values: email and response (required) + * @param contactId The ID for the desired contact. (required) + * @param mailingListId The ID for the desired mailing list. (required) + * @param directoryId The directory ID, also known as a pool ID. (required) + * @param skipToken The start position for pagination. (optional) + * @param pageSize The maximum number of items to return per request (optional, default to 100) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Get Contact response -
400 Invalid arguments response -
0 A default error response -
+ */ + public okhttp3.Call getMailingListContactHistoryAsync(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMailingListContactHistoryValidateBeforeCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/pl/wtx/qualtrics/api/client/invoker/JSON.java b/src/main/java/pl/wtx/qualtrics/api/client/invoker/JSON.java index cb129aa..7e9dd23 100644 --- a/src/main/java/pl/wtx/qualtrics/api/client/invoker/JSON.java +++ b/src/main/java/pl/wtx/qualtrics/api/client/invoker/JSON.java @@ -97,26 +97,29 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.BatchGetParticipantResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.BounceInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateContactExportRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateContactExportRequestEmbeddedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateContactExportResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateDirectoryContactRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateDirectoryContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateIDPRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateMailingListContactRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateTransactionContactsImportRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateTransactionContactsImportRequestContactsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateTransactionContactsImportRequestTransactionMeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.CreateTransactionContactsImportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.DefaultEmptyResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.DefaultErrorResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.DirectoryContactMailingListsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.DeleteContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.EX360CopyRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ElementsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ElementsInner1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ElementsInner2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.EmailHistory.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.EmailHistoryBounceInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Error.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Evaluator.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.EvaluatorImportBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.EvaluatorRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ExportCreationRequest.CustomTypeAdapterFactory()); @@ -124,32 +127,32 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ExportStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetContactExportFileResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetContactExportProgress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetContactHistoryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetDirectoryContactEmailHistoryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetDirectoryContactHistoryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetDirectoryContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetDirectoryContactResponseHistoryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetImportReportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetImportReportResponseResults.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetMailingListContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetRecordResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetTransactionContactsImportStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.GetTransactionContactsImportSummaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.IDPField.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.IDPNotFound.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.IDPResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ImportEvaluatorResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ImportReportEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ImportedDataProject.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.JobId.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.JobInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.JobResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.JobResultsBucket.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ListContactsInContactListResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.ListDirectoryContactsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.MailingListMembership.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.MailingListMembershipDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Meta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.MetaInError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.MetadataFilter.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.NumericFilter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.PageOfContacts.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.PartialFailureResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Participant.CustomTypeAdapterFactory()); @@ -168,6 +171,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result12.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result13.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result14.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result15.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result16.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result17.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result18.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result1Contacts.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result1ContactsCount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.Result1Transactions.CustomTypeAdapterFactory()); @@ -190,10 +197,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SearchDirectoryContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SegmentMembershipDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SingleContact.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.StringFilter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SingleContactLegacy.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SubjectData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SubjectImportBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.SubjectRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.UpdateContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.UpdateDirectoryContactResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new pl.wtx.qualtrics.api.client.model.UpdateIDPRequest.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/BounceInfo.java b/src/main/java/pl/wtx/qualtrics/api/client/model/BounceInfo.java new file mode 100644 index 0000000..a37df02 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/BounceInfo.java @@ -0,0 +1,305 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * BounceInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class BounceInfo { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + @javax.annotation.Nullable + private String statusCode; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + @javax.annotation.Nullable + private String reason; + + public static final String SERIALIZED_NAME_BLACKLISTED = "blacklisted"; + @SerializedName(SERIALIZED_NAME_BLACKLISTED) + @javax.annotation.Nullable + private Boolean blacklisted; + + public BounceInfo() { + } + + public BounceInfo type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public BounceInfo statusCode(@javax.annotation.Nullable String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get statusCode + * @return statusCode + */ + @javax.annotation.Nullable + public String getStatusCode() { + return statusCode; + } + + public void setStatusCode(@javax.annotation.Nullable String statusCode) { + this.statusCode = statusCode; + } + + + public BounceInfo reason(@javax.annotation.Nullable String reason) { + this.reason = reason; + return this; + } + + /** + * Get reason + * @return reason + */ + @javax.annotation.Nullable + public String getReason() { + return reason; + } + + public void setReason(@javax.annotation.Nullable String reason) { + this.reason = reason; + } + + + public BounceInfo blacklisted(@javax.annotation.Nullable Boolean blacklisted) { + this.blacklisted = blacklisted; + return this; + } + + /** + * Get blacklisted + * @return blacklisted + */ + @javax.annotation.Nullable + public Boolean getBlacklisted() { + return blacklisted; + } + + public void setBlacklisted(@javax.annotation.Nullable Boolean blacklisted) { + this.blacklisted = blacklisted; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BounceInfo bounceInfo = (BounceInfo) o; + return Objects.equals(this.type, bounceInfo.type) && + Objects.equals(this.statusCode, bounceInfo.statusCode) && + Objects.equals(this.reason, bounceInfo.reason) && + Objects.equals(this.blacklisted, bounceInfo.blacklisted); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable 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(type, statusCode, reason, blacklisted); + } + + private static int hashCodeNullable(JsonNullable 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 BounceInfo {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" blacklisted: ").append(toIndentedString(blacklisted)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("statusCode"); + openapiFields.add("reason"); + openapiFields.add("blacklisted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BounceInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BounceInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BounceInfo is not found in the empty JSON string", BounceInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BounceInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BounceInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("statusCode") != null && !jsonObj.get("statusCode").isJsonNull()) && !jsonObj.get("statusCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `statusCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusCode").toString())); + } + if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BounceInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BounceInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BounceInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BounceInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BounceInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BounceInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of BounceInfo + * @throws IOException if the JSON string is invalid with respect to BounceInfo + */ + public static BounceInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BounceInfo.class); + } + + /** + * Convert an instance of BounceInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Comparison.java b/src/main/java/pl/wtx/qualtrics/api/client/model/Comparison.java deleted file mode 100644 index 878bc01..0000000 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/Comparison.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Qualtrics API - * This is the API specification for Qualtrics platform. - * - * The version of the OpenAPI document: 3.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package pl.wtx.qualtrics.api.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Comparison - */ -@JsonAdapter(Comparison.Adapter.class) -public enum Comparison { - - EQ("eq"), - - NEQ("neq"), - - GT("gt"), - - LT("lt"), - - GTE("gte"), - - LTE("lte"), - - TRUE("true"), - - FALSE("false"), - - NOT_EMPTY("notEmpty"), - - EMPTY("empty"); - - private String value; - - Comparison(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Comparison fromValue(String value) { - for (Comparison b : Comparison.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Comparison enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Comparison read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Comparison.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Comparison.fromValue(value); - } -} - diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Evaluator.java b/src/main/java/pl/wtx/qualtrics/api/client/model/CreateContactResponse.java similarity index 56% rename from src/main/java/pl/wtx/qualtrics/api/client/model/Evaluator.java rename to src/main/java/pl/wtx/qualtrics/api/client/model/CreateContactResponse.java index b8e4506..ecda4b1 100644 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/Evaluator.java +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/CreateContactResponse.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import pl.wtx.qualtrics.api.client.model.Meta; +import pl.wtx.qualtrics.api.client.model.Result15; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -48,66 +48,58 @@ import pl.wtx.qualtrics.api.client.invoker.JSON; /** - * Evaluator + * CreateContactResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class Evaluator { - public static final String SERIALIZED_NAME_UNIQUE_IDENTIFIER = "uniqueIdentifier"; - @SerializedName(SERIALIZED_NAME_UNIQUE_IDENTIFIER) +public class CreateContactResponse { + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) @javax.annotation.Nonnull - private String uniqueIdentifier = "CRZ_12234455"; + private Result15 result; - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - @javax.annotation.Nullable - private Map metadata = new HashMap<>(); + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; - public Evaluator() { + public CreateContactResponse() { } - public Evaluator uniqueIdentifier(@javax.annotation.Nonnull String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; + public CreateContactResponse result(@javax.annotation.Nonnull Result15 result) { + this.result = result; return this; } /** - * Get uniqueIdentifier - * @return uniqueIdentifier + * Get result + * @return result */ @javax.annotation.Nonnull - public String getUniqueIdentifier() { - return uniqueIdentifier; + public Result15 getResult() { + return result; } - public void setUniqueIdentifier(@javax.annotation.Nonnull String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; + public void setResult(@javax.annotation.Nonnull Result15 result) { + this.result = result; } - public Evaluator metadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public Evaluator putMetadataItem(String key, String metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, metadataItem); + public CreateContactResponse meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; return this; } /** - * Get metadata - * @return metadata + * Get meta + * @return meta */ - @javax.annotation.Nullable - public Map getMetadata() { - return metadata; + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; } - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; } @@ -120,22 +112,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Evaluator evaluator = (Evaluator) o; - return Objects.equals(this.uniqueIdentifier, evaluator.uniqueIdentifier) && - Objects.equals(this.metadata, evaluator.metadata); + CreateContactResponse createContactResponse = (CreateContactResponse) o; + return Objects.equals(this.result, createContactResponse.result) && + Objects.equals(this.meta, createContactResponse.meta); } @Override public int hashCode() { - return Objects.hash(uniqueIdentifier, metadata); + return Objects.hash(result, meta); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Evaluator {\n"); - sb.append(" uniqueIdentifier: ").append(toIndentedString(uniqueIdentifier)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("class CreateContactResponse {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append("}"); return sb.toString(); } @@ -158,67 +150,69 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("uniqueIdentifier"); - openapiFields.add("metadata"); + openapiFields.add("result"); + openapiFields.add("meta"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("uniqueIdentifier"); + openapiRequiredFields.add("result"); + openapiRequiredFields.add("meta"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Evaluator + * @throws IOException if the JSON Element is invalid with respect to CreateContactResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Evaluator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Evaluator is not found in the empty JSON string", Evaluator.openapiRequiredFields.toString())); + if (!CreateContactResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateContactResponse is not found in the empty JSON string", CreateContactResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!Evaluator.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Evaluator` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!CreateContactResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateContactResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Evaluator.openapiRequiredFields) { + for (String requiredField : CreateContactResponse.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("uniqueIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `uniqueIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueIdentifier").toString())); - } + // validate the required field `result` + Result15.validateJsonElement(jsonObj.get("result")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Evaluator.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Evaluator' and its subtypes + if (!CreateContactResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateContactResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Evaluator.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateContactResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Evaluator value) throws IOException { + public void write(JsonWriter out, CreateContactResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public Evaluator read(JsonReader in) throws IOException { + public CreateContactResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -229,18 +223,18 @@ public Evaluator read(JsonReader in) throws IOException { } /** - * Create an instance of Evaluator given an JSON string + * Create an instance of CreateContactResponse given an JSON string * * @param jsonString JSON string - * @return An instance of Evaluator - * @throws IOException if the JSON string is invalid with respect to Evaluator + * @return An instance of CreateContactResponse + * @throws IOException if the JSON string is invalid with respect to CreateContactResponse */ - public static Evaluator fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Evaluator.class); + public static CreateContactResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateContactResponse.class); } /** - * Convert an instance of Evaluator to an JSON string + * Convert an instance of CreateContactResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/CreateMailingListContactRequest.java b/src/main/java/pl/wtx/qualtrics/api/client/model/CreateMailingListContactRequest.java new file mode 100644 index 0000000..964d00d --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/CreateMailingListContactRequest.java @@ -0,0 +1,467 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * CreateMailingListContactRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class CreateMailingListContactRequest { + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public static final String SERIALIZED_NAME_EXT_REF = "extRef"; + @SerializedName(SERIALIZED_NAME_EXT_REF) + @javax.annotation.Nullable + private String extRef; + + public static final String SERIALIZED_NAME_EMBEDDED_DATA = "embeddedData"; + @SerializedName(SERIALIZED_NAME_EMBEDDED_DATA) + @javax.annotation.Nullable + private Map embeddedData = new HashMap<>(); + + public static final String SERIALIZED_NAME_PRIVATE_EMBEDDED_DATA = "privateEmbeddedData"; + @SerializedName(SERIALIZED_NAME_PRIVATE_EMBEDDED_DATA) + @javax.annotation.Nullable + private Map privateEmbeddedData; + + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_UNSUBSCRIBED = "unsubscribed"; + @SerializedName(SERIALIZED_NAME_UNSUBSCRIBED) + @javax.annotation.Nullable + private Boolean unsubscribed; + + public CreateMailingListContactRequest() { + } + + public CreateMailingListContactRequest firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * THe contact's first name. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public CreateMailingListContactRequest lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The contact's last name. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public CreateMailingListContactRequest email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The contact's email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public CreateMailingListContactRequest phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * The contact's phone number. + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public CreateMailingListContactRequest extRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + return this; + } + + /** + * External reference information for the contact. + * @return extRef + */ + @javax.annotation.Nullable + public String getExtRef() { + return extRef; + } + + public void setExtRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + } + + + public CreateMailingListContactRequest embeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + return this; + } + + public CreateMailingListContactRequest putEmbeddedDataItem(String key, String embeddedDataItem) { + if (this.embeddedData == null) { + this.embeddedData = new HashMap<>(); + } + this.embeddedData.put(key, embeddedDataItem); + return this; + } + + /** + * Embedded data for the contact. + * @return embeddedData + */ + @javax.annotation.Nullable + public Map getEmbeddedData() { + return embeddedData; + } + + public void setEmbeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + } + + + public CreateMailingListContactRequest privateEmbeddedData(@javax.annotation.Nullable Map privateEmbeddedData) { + this.privateEmbeddedData = privateEmbeddedData; + return this; + } + + public CreateMailingListContactRequest putPrivateEmbeddedDataItem(String key, Object privateEmbeddedDataItem) { + if (this.privateEmbeddedData == null) { + this.privateEmbeddedData = new HashMap<>(); + } + this.privateEmbeddedData.put(key, privateEmbeddedDataItem); + return this; + } + + /** + * Embedded data that is specific to this contact list. For more information please visit: https://www.qualtrics.com/support/iq-directory/lists-tab/creating-mailing-lists/#PrivateListData + * @return privateEmbeddedData + */ + @javax.annotation.Nullable + public Map getPrivateEmbeddedData() { + return privateEmbeddedData; + } + + public void setPrivateEmbeddedData(@javax.annotation.Nullable Map privateEmbeddedData) { + this.privateEmbeddedData = privateEmbeddedData; + } + + + public CreateMailingListContactRequest language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The contact's preferred language. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public CreateMailingListContactRequest unsubscribed(@javax.annotation.Nullable Boolean unsubscribed) { + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Whether the contact is unsubscribed. + * @return unsubscribed + */ + @javax.annotation.Nullable + public Boolean getUnsubscribed() { + return unsubscribed; + } + + public void setUnsubscribed(@javax.annotation.Nullable Boolean unsubscribed) { + this.unsubscribed = unsubscribed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMailingListContactRequest createMailingListContactRequest = (CreateMailingListContactRequest) o; + return Objects.equals(this.firstName, createMailingListContactRequest.firstName) && + Objects.equals(this.lastName, createMailingListContactRequest.lastName) && + Objects.equals(this.email, createMailingListContactRequest.email) && + Objects.equals(this.phone, createMailingListContactRequest.phone) && + Objects.equals(this.extRef, createMailingListContactRequest.extRef) && + Objects.equals(this.embeddedData, createMailingListContactRequest.embeddedData) && + Objects.equals(this.privateEmbeddedData, createMailingListContactRequest.privateEmbeddedData) && + Objects.equals(this.language, createMailingListContactRequest.language) && + Objects.equals(this.unsubscribed, createMailingListContactRequest.unsubscribed); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable 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, email, phone, extRef, embeddedData, privateEmbeddedData, language, unsubscribed); + } + + private static int hashCodeNullable(JsonNullable 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 CreateMailingListContactRequest {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" extRef: ").append(toIndentedString(extRef)).append("\n"); + sb.append(" embeddedData: ").append(toIndentedString(embeddedData)).append("\n"); + sb.append(" privateEmbeddedData: ").append(toIndentedString(privateEmbeddedData)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" unsubscribed: ").append(toIndentedString(unsubscribed)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("phone"); + openapiFields.add("extRef"); + openapiFields.add("embeddedData"); + openapiFields.add("privateEmbeddedData"); + openapiFields.add("language"); + openapiFields.add("unsubscribed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateMailingListContactRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateMailingListContactRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateMailingListContactRequest is not found in the empty JSON string", CreateMailingListContactRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateMailingListContactRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMailingListContactRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("extRef") != null && !jsonObj.get("extRef").isJsonNull()) && !jsonObj.get("extRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extRef").toString())); + } + if ((jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) && !jsonObj.get("language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateMailingListContactRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateMailingListContactRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateMailingListContactRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateMailingListContactRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateMailingListContactRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateMailingListContactRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateMailingListContactRequest + * @throws IOException if the JSON string is invalid with respect to CreateMailingListContactRequest + */ + public static CreateMailingListContactRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateMailingListContactRequest.class); + } + + /** + * Convert an instance of CreateMailingListContactRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/ImportEvaluatorResponse.java b/src/main/java/pl/wtx/qualtrics/api/client/model/DeleteContactResponse.java similarity index 73% rename from src/main/java/pl/wtx/qualtrics/api/client/model/ImportEvaluatorResponse.java rename to src/main/java/pl/wtx/qualtrics/api/client/model/DeleteContactResponse.java index e8ffb3f..36c1219 100644 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/ImportEvaluatorResponse.java +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/DeleteContactResponse.java @@ -47,19 +47,19 @@ import pl.wtx.qualtrics.api.client.invoker.JSON; /** - * ImportEvaluatorResponse + * DeleteContactResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class ImportEvaluatorResponse { +public class DeleteContactResponse { public static final String SERIALIZED_NAME_META = "meta"; @SerializedName(SERIALIZED_NAME_META) @javax.annotation.Nonnull private Meta meta; - public ImportEvaluatorResponse() { + public DeleteContactResponse() { } - public ImportEvaluatorResponse meta(@javax.annotation.Nonnull Meta meta) { + public DeleteContactResponse meta(@javax.annotation.Nonnull Meta meta) { this.meta = meta; return this; } @@ -87,8 +87,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ImportEvaluatorResponse importEvaluatorResponse = (ImportEvaluatorResponse) o; - return Objects.equals(this.meta, importEvaluatorResponse.meta); + DeleteContactResponse deleteContactResponse = (DeleteContactResponse) o; + return Objects.equals(this.meta, deleteContactResponse.meta); } @Override @@ -99,7 +99,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ImportEvaluatorResponse {\n"); + sb.append("class DeleteContactResponse {\n"); sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append("}"); return sb.toString(); @@ -134,25 +134,25 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportEvaluatorResponse + * @throws IOException if the JSON Element is invalid with respect to DeleteContactResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ImportEvaluatorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ImportEvaluatorResponse is not found in the empty JSON string", ImportEvaluatorResponse.openapiRequiredFields.toString())); + if (!DeleteContactResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteContactResponse is not found in the empty JSON string", DeleteContactResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ImportEvaluatorResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ImportEvaluatorResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!DeleteContactResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteContactResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ImportEvaluatorResponse.openapiRequiredFields) { + for (String requiredField : DeleteContactResponse.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -166,22 +166,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ImportEvaluatorResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ImportEvaluatorResponse' and its subtypes + if (!DeleteContactResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteContactResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ImportEvaluatorResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteContactResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ImportEvaluatorResponse value) throws IOException { + public void write(JsonWriter out, DeleteContactResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ImportEvaluatorResponse read(JsonReader in) throws IOException { + public DeleteContactResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -192,18 +192,18 @@ public ImportEvaluatorResponse read(JsonReader in) throws IOException { } /** - * Create an instance of ImportEvaluatorResponse given an JSON string + * Create an instance of DeleteContactResponse given an JSON string * * @param jsonString JSON string - * @return An instance of ImportEvaluatorResponse - * @throws IOException if the JSON string is invalid with respect to ImportEvaluatorResponse + * @return An instance of DeleteContactResponse + * @throws IOException if the JSON string is invalid with respect to DeleteContactResponse */ - public static ImportEvaluatorResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ImportEvaluatorResponse.class); + public static DeleteContactResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteContactResponse.class); } /** - * Convert an instance of ImportEvaluatorResponse to an JSON string + * Convert an instance of DeleteContactResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/DirectoryContactMailingListsResponse.java b/src/main/java/pl/wtx/qualtrics/api/client/model/DirectoryContactMailingListsResponse.java deleted file mode 100644 index 1ba26bb..0000000 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/DirectoryContactMailingListsResponse.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Qualtrics API - * This is the API specification for Qualtrics platform. - * - * The version of the OpenAPI document: 3.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package pl.wtx.qualtrics.api.client.model; - -import java.util.Objects; -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 java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -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 com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import pl.wtx.qualtrics.api.client.invoker.JSON; - -/** - * Mailing list memberships of a directory contact - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class DirectoryContactMailingListsResponse { - public static final String SERIALIZED_NAME_LOOKUP_ID = "lookupId"; - @SerializedName(SERIALIZED_NAME_LOOKUP_ID) - @javax.annotation.Nonnull - private String lookupId; - - public static final String SERIALIZED_NAME_GROUP_NAME = "groupName"; - @SerializedName(SERIALIZED_NAME_GROUP_NAME) - @javax.annotation.Nonnull - private String groupName; - - public static final String SERIALIZED_NAME_GROUP_UNSUBSCRIBED = "groupUnsubscribed"; - @SerializedName(SERIALIZED_NAME_GROUP_UNSUBSCRIBED) - @javax.annotation.Nonnull - private Boolean groupUnsubscribed; - - public static final String SERIALIZED_NAME_GROUP_UNSUBSCRIBE_DATE = "groupUnsubscribeDate"; - @SerializedName(SERIALIZED_NAME_GROUP_UNSUBSCRIBE_DATE) - @javax.annotation.Nullable - private BigDecimal groupUnsubscribeDate; - - public static final String SERIALIZED_NAME_GROUP_OWNER_ID = "groupOwnerId"; - @SerializedName(SERIALIZED_NAME_GROUP_OWNER_ID) - @javax.annotation.Nonnull - private String groupOwnerId; - - public DirectoryContactMailingListsResponse() { - } - - public DirectoryContactMailingListsResponse lookupId(@javax.annotation.Nonnull String lookupId) { - this.lookupId = lookupId; - return this; - } - - /** - * Get lookupId - * @return lookupId - */ - @javax.annotation.Nonnull - public String getLookupId() { - return lookupId; - } - - public void setLookupId(@javax.annotation.Nonnull String lookupId) { - this.lookupId = lookupId; - } - - - public DirectoryContactMailingListsResponse groupName(@javax.annotation.Nonnull String groupName) { - this.groupName = groupName; - return this; - } - - /** - * Get groupName - * @return groupName - */ - @javax.annotation.Nonnull - public String getGroupName() { - return groupName; - } - - public void setGroupName(@javax.annotation.Nonnull String groupName) { - this.groupName = groupName; - } - - - public DirectoryContactMailingListsResponse groupUnsubscribed(@javax.annotation.Nonnull Boolean groupUnsubscribed) { - this.groupUnsubscribed = groupUnsubscribed; - return this; - } - - /** - * Get groupUnsubscribed - * @return groupUnsubscribed - */ - @javax.annotation.Nonnull - public Boolean getGroupUnsubscribed() { - return groupUnsubscribed; - } - - public void setGroupUnsubscribed(@javax.annotation.Nonnull Boolean groupUnsubscribed) { - this.groupUnsubscribed = groupUnsubscribed; - } - - - public DirectoryContactMailingListsResponse groupUnsubscribeDate(@javax.annotation.Nullable BigDecimal groupUnsubscribeDate) { - this.groupUnsubscribeDate = groupUnsubscribeDate; - return this; - } - - /** - * Get groupUnsubscribeDate - * @return groupUnsubscribeDate - */ - @javax.annotation.Nullable - public BigDecimal getGroupUnsubscribeDate() { - return groupUnsubscribeDate; - } - - public void setGroupUnsubscribeDate(@javax.annotation.Nullable BigDecimal groupUnsubscribeDate) { - this.groupUnsubscribeDate = groupUnsubscribeDate; - } - - - public DirectoryContactMailingListsResponse groupOwnerId(@javax.annotation.Nonnull String groupOwnerId) { - this.groupOwnerId = groupOwnerId; - return this; - } - - /** - * Get groupOwnerId - * @return groupOwnerId - */ - @javax.annotation.Nonnull - public String getGroupOwnerId() { - return groupOwnerId; - } - - public void setGroupOwnerId(@javax.annotation.Nonnull String groupOwnerId) { - this.groupOwnerId = groupOwnerId; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DirectoryContactMailingListsResponse directoryContactMailingListsResponse = (DirectoryContactMailingListsResponse) o; - return Objects.equals(this.lookupId, directoryContactMailingListsResponse.lookupId) && - Objects.equals(this.groupName, directoryContactMailingListsResponse.groupName) && - Objects.equals(this.groupUnsubscribed, directoryContactMailingListsResponse.groupUnsubscribed) && - Objects.equals(this.groupUnsubscribeDate, directoryContactMailingListsResponse.groupUnsubscribeDate) && - Objects.equals(this.groupOwnerId, directoryContactMailingListsResponse.groupOwnerId); - } - - @Override - public int hashCode() { - return Objects.hash(lookupId, groupName, groupUnsubscribed, groupUnsubscribeDate, groupOwnerId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DirectoryContactMailingListsResponse {\n"); - sb.append(" lookupId: ").append(toIndentedString(lookupId)).append("\n"); - sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); - sb.append(" groupUnsubscribed: ").append(toIndentedString(groupUnsubscribed)).append("\n"); - sb.append(" groupUnsubscribeDate: ").append(toIndentedString(groupUnsubscribeDate)).append("\n"); - sb.append(" groupOwnerId: ").append(toIndentedString(groupOwnerId)).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 openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lookupId"); - openapiFields.add("groupName"); - openapiFields.add("groupUnsubscribed"); - openapiFields.add("groupUnsubscribeDate"); - openapiFields.add("groupOwnerId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("lookupId"); - openapiRequiredFields.add("groupName"); - openapiRequiredFields.add("groupUnsubscribed"); - openapiRequiredFields.add("groupUnsubscribeDate"); - openapiRequiredFields.add("groupOwnerId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DirectoryContactMailingListsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DirectoryContactMailingListsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DirectoryContactMailingListsResponse is not found in the empty JSON string", DirectoryContactMailingListsResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DirectoryContactMailingListsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectoryContactMailingListsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DirectoryContactMailingListsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("lookupId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lookupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lookupId").toString())); - } - if (!jsonObj.get("groupName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `groupName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupName").toString())); - } - if (!jsonObj.get("groupOwnerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `groupOwnerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupOwnerId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DirectoryContactMailingListsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DirectoryContactMailingListsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DirectoryContactMailingListsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DirectoryContactMailingListsResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DirectoryContactMailingListsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DirectoryContactMailingListsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of DirectoryContactMailingListsResponse - * @throws IOException if the JSON string is invalid with respect to DirectoryContactMailingListsResponse - */ - public static DirectoryContactMailingListsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DirectoryContactMailingListsResponse.class); - } - - /** - * Convert an instance of DirectoryContactMailingListsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/ElementsInner2.java b/src/main/java/pl/wtx/qualtrics/api/client/model/ElementsInner2.java new file mode 100644 index 0000000..cb3e9c1 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/ElementsInner2.java @@ -0,0 +1,598 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import pl.wtx.qualtrics.api.client.model.BounceInfo; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * ElementsInner2 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class ElementsInner2 { + public static final String SERIALIZED_NAME_DISTRIBUTION_ID = "distributionId"; + @SerializedName(SERIALIZED_NAME_DISTRIBUTION_ID) + @javax.annotation.Nullable + private String distributionId; + + public static final String SERIALIZED_NAME_DATE = "date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + /** + * Gets or Sets result + */ + @JsonAdapter(ResultEnum.Adapter.class) + public enum ResultEnum { + PENDING("Pending"), + + SUCCESS("Success"), + + ERROR("Error"), + + BOUNCE("Bounce"), + + COMPLAINT("Complaint"), + + SKIPPED("Skipped"), + + BLOCKED("Blocked"), + + FAILURE("Failure"), + + UNKNOWN("Unknown"), + + SOFT_BOUNCE("SoftBounce"), + + HARD_BOUNCE("HardBounce"); + + private String value; + + ResultEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResultEnum fromValue(String value) { + for (ResultEnum b : ResultEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResultEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + @javax.annotation.Nullable + private ResultEnum result; + + public static final String SERIALIZED_NAME_BOUNCE_INFO = "bounceInfo"; + @SerializedName(SERIALIZED_NAME_BOUNCE_INFO) + @javax.annotation.Nullable + private BounceInfo bounceInfo; + + public static final String SERIALIZED_NAME_SURVEY_ID = "surveyId"; + @SerializedName(SERIALIZED_NAME_SURVEY_ID) + @javax.annotation.Nullable + private String surveyId; + + public static final String SERIALIZED_NAME_READ = "read"; + @SerializedName(SERIALIZED_NAME_READ) + @javax.annotation.Nullable + private Boolean read; + + public static final String SERIALIZED_NAME_LOOKUP_ID = "lookupId"; + @SerializedName(SERIALIZED_NAME_LOOKUP_ID) + @javax.annotation.Nullable + private String lookupId; + + public static final String SERIALIZED_NAME_RESPONSE_ID = "responseId"; + @SerializedName(SERIALIZED_NAME_RESPONSE_ID) + @javax.annotation.Nullable + private String responseId; + + public static final String SERIALIZED_NAME_SURVEY_STARTED_DATE = "surveyStartedDate"; + @SerializedName(SERIALIZED_NAME_SURVEY_STARTED_DATE) + @javax.annotation.Nullable + private OffsetDateTime surveyStartedDate; + + public static final String SERIALIZED_NAME_SURVEY_COMPLETED_DATE = "surveyCompletedDate"; + @SerializedName(SERIALIZED_NAME_SURVEY_COMPLETED_DATE) + @javax.annotation.Nullable + private OffsetDateTime surveyCompletedDate; + + public static final String SERIALIZED_NAME_SURVEY_FINISHED = "surveyFinished"; + @SerializedName(SERIALIZED_NAME_SURVEY_FINISHED) + @javax.annotation.Nullable + private Boolean surveyFinished; + + public ElementsInner2() { + } + + public ElementsInner2 distributionId(@javax.annotation.Nullable String distributionId) { + this.distributionId = distributionId; + return this; + } + + /** + * The distribution's ID, which can be used with Get Distribution to obtain more information about the distribution. + * @return distributionId + */ + @javax.annotation.Nullable + public String getDistributionId() { + return distributionId; + } + + public void setDistributionId(@javax.annotation.Nullable String distributionId) { + this.distributionId = distributionId; + } + + + public ElementsInner2 date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + + public ElementsInner2 type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ElementsInner2 result(@javax.annotation.Nullable ResultEnum result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @javax.annotation.Nullable + public ResultEnum getResult() { + return result; + } + + public void setResult(@javax.annotation.Nullable ResultEnum result) { + this.result = result; + } + + + public ElementsInner2 bounceInfo(@javax.annotation.Nullable BounceInfo bounceInfo) { + this.bounceInfo = bounceInfo; + return this; + } + + /** + * Get bounceInfo + * @return bounceInfo + */ + @javax.annotation.Nullable + public BounceInfo getBounceInfo() { + return bounceInfo; + } + + public void setBounceInfo(@javax.annotation.Nullable BounceInfo bounceInfo) { + this.bounceInfo = bounceInfo; + } + + + public ElementsInner2 surveyId(@javax.annotation.Nullable String surveyId) { + this.surveyId = surveyId; + return this; + } + + /** + * The survey ID of the survey referenced by this distribution. + * @return surveyId + */ + @javax.annotation.Nullable + public String getSurveyId() { + return surveyId; + } + + public void setSurveyId(@javax.annotation.Nullable String surveyId) { + this.surveyId = surveyId; + } + + + public ElementsInner2 read(@javax.annotation.Nullable Boolean read) { + this.read = read; + return this; + } + + /** + * Get read + * @return read + */ + @javax.annotation.Nullable + public Boolean getRead() { + return read; + } + + public void setRead(@javax.annotation.Nullable Boolean read) { + this.read = read; + } + + + public ElementsInner2 lookupId(@javax.annotation.Nullable String lookupId) { + this.lookupId = lookupId; + return this; + } + + /** + * Get lookupId + * @return lookupId + */ + @javax.annotation.Nullable + public String getLookupId() { + return lookupId; + } + + public void setLookupId(@javax.annotation.Nullable String lookupId) { + this.lookupId = lookupId; + } + + + public ElementsInner2 responseId(@javax.annotation.Nullable String responseId) { + this.responseId = responseId; + return this; + } + + /** + * The contact's response ID. Indicates the contact's response to the survey. + * @return responseId + */ + @javax.annotation.Nullable + public String getResponseId() { + return responseId; + } + + public void setResponseId(@javax.annotation.Nullable String responseId) { + this.responseId = responseId; + } + + + public ElementsInner2 surveyStartedDate(@javax.annotation.Nullable OffsetDateTime surveyStartedDate) { + this.surveyStartedDate = surveyStartedDate; + return this; + } + + /** + * Get surveyStartedDate + * @return surveyStartedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSurveyStartedDate() { + return surveyStartedDate; + } + + public void setSurveyStartedDate(@javax.annotation.Nullable OffsetDateTime surveyStartedDate) { + this.surveyStartedDate = surveyStartedDate; + } + + + public ElementsInner2 surveyCompletedDate(@javax.annotation.Nullable OffsetDateTime surveyCompletedDate) { + this.surveyCompletedDate = surveyCompletedDate; + return this; + } + + /** + * Get surveyCompletedDate + * @return surveyCompletedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSurveyCompletedDate() { + return surveyCompletedDate; + } + + public void setSurveyCompletedDate(@javax.annotation.Nullable OffsetDateTime surveyCompletedDate) { + this.surveyCompletedDate = surveyCompletedDate; + } + + + public ElementsInner2 surveyFinished(@javax.annotation.Nullable Boolean surveyFinished) { + this.surveyFinished = surveyFinished; + return this; + } + + /** + * Get surveyFinished + * @return surveyFinished + */ + @javax.annotation.Nullable + public Boolean getSurveyFinished() { + return surveyFinished; + } + + public void setSurveyFinished(@javax.annotation.Nullable Boolean surveyFinished) { + this.surveyFinished = surveyFinished; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ElementsInner2 elementsInner2 = (ElementsInner2) o; + return Objects.equals(this.distributionId, elementsInner2.distributionId) && + Objects.equals(this.date, elementsInner2.date) && + Objects.equals(this.type, elementsInner2.type) && + Objects.equals(this.result, elementsInner2.result) && + Objects.equals(this.bounceInfo, elementsInner2.bounceInfo) && + Objects.equals(this.surveyId, elementsInner2.surveyId) && + Objects.equals(this.read, elementsInner2.read) && + Objects.equals(this.lookupId, elementsInner2.lookupId) && + Objects.equals(this.responseId, elementsInner2.responseId) && + Objects.equals(this.surveyStartedDate, elementsInner2.surveyStartedDate) && + Objects.equals(this.surveyCompletedDate, elementsInner2.surveyCompletedDate) && + Objects.equals(this.surveyFinished, elementsInner2.surveyFinished); + } + + @Override + public int hashCode() { + return Objects.hash(distributionId, date, type, result, bounceInfo, surveyId, read, lookupId, responseId, surveyStartedDate, surveyCompletedDate, surveyFinished); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ElementsInner2 {\n"); + sb.append(" distributionId: ").append(toIndentedString(distributionId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" bounceInfo: ").append(toIndentedString(bounceInfo)).append("\n"); + sb.append(" surveyId: ").append(toIndentedString(surveyId)).append("\n"); + sb.append(" read: ").append(toIndentedString(read)).append("\n"); + sb.append(" lookupId: ").append(toIndentedString(lookupId)).append("\n"); + sb.append(" responseId: ").append(toIndentedString(responseId)).append("\n"); + sb.append(" surveyStartedDate: ").append(toIndentedString(surveyStartedDate)).append("\n"); + sb.append(" surveyCompletedDate: ").append(toIndentedString(surveyCompletedDate)).append("\n"); + sb.append(" surveyFinished: ").append(toIndentedString(surveyFinished)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("distributionId"); + openapiFields.add("date"); + openapiFields.add("type"); + openapiFields.add("result"); + openapiFields.add("bounceInfo"); + openapiFields.add("surveyId"); + openapiFields.add("read"); + openapiFields.add("lookupId"); + openapiFields.add("responseId"); + openapiFields.add("surveyStartedDate"); + openapiFields.add("surveyCompletedDate"); + openapiFields.add("surveyFinished"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ElementsInner2 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ElementsInner2.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ElementsInner2 is not found in the empty JSON string", ElementsInner2.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ElementsInner2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ElementsInner2` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("distributionId") != null && !jsonObj.get("distributionId").isJsonNull()) && !jsonObj.get("distributionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `distributionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("distributionId").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) && !jsonObj.get("result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString())); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + ResultEnum.validateJsonElement(jsonObj.get("result")); + } + // validate the optional field `bounceInfo` + if (jsonObj.get("bounceInfo") != null && !jsonObj.get("bounceInfo").isJsonNull()) { + BounceInfo.validateJsonElement(jsonObj.get("bounceInfo")); + } + if ((jsonObj.get("surveyId") != null && !jsonObj.get("surveyId").isJsonNull()) && !jsonObj.get("surveyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `surveyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("surveyId").toString())); + } + if ((jsonObj.get("lookupId") != null && !jsonObj.get("lookupId").isJsonNull()) && !jsonObj.get("lookupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lookupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lookupId").toString())); + } + if ((jsonObj.get("responseId") != null && !jsonObj.get("responseId").isJsonNull()) && !jsonObj.get("responseId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ElementsInner2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ElementsInner2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ElementsInner2.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ElementsInner2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ElementsInner2 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ElementsInner2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ElementsInner2 + * @throws IOException if the JSON string is invalid with respect to ElementsInner2 + */ + public static ElementsInner2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ElementsInner2.class); + } + + /** + * Convert an instance of ElementsInner2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/FilterType.java b/src/main/java/pl/wtx/qualtrics/api/client/model/FilterType.java deleted file mode 100644 index 71089d7..0000000 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/FilterType.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Qualtrics API - * This is the API specification for Qualtrics platform. - * - * The version of the OpenAPI document: 3.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package pl.wtx.qualtrics.api.client.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets FilterType - */ -@JsonAdapter(FilterType.Adapter.class) -public enum FilterType { - - EMAIL("email"), - - FIRST_NAME("firstName"), - - LAST_NAME("lastName"), - - LANGUAGE("language"), - - PHONE("phone"), - - EXT_REF("extRef"), - - CREATED("created"), - - LAST_MODIFIED("lastModified"), - - IN_LIST("inList"), - - INFO_FIELD_STATE("infoFieldState"), - - EMBEDDED_DATA("embeddedData"); - - private String value; - - FilterType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FilterType fromValue(String value) { - for (FilterType b : FilterType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FilterType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FilterType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FilterType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FilterType.fromValue(value); - } -} - diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/GetContactHistoryResponse.java b/src/main/java/pl/wtx/qualtrics/api/client/model/GetContactHistoryResponse.java new file mode 100644 index 0000000..14c92f8 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/GetContactHistoryResponse.java @@ -0,0 +1,245 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import pl.wtx.qualtrics.api.client.model.Meta; +import pl.wtx.qualtrics.api.client.model.Result18; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * GetContactHistoryResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class GetContactHistoryResponse { + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + @javax.annotation.Nonnull + private Result18 result; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public GetContactHistoryResponse() { + } + + public GetContactHistoryResponse result(@javax.annotation.Nonnull Result18 result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @javax.annotation.Nonnull + public Result18 getResult() { + return result; + } + + public void setResult(@javax.annotation.Nonnull Result18 result) { + this.result = result; + } + + + public GetContactHistoryResponse meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactHistoryResponse getContactHistoryResponse = (GetContactHistoryResponse) o; + return Objects.equals(this.result, getContactHistoryResponse.result) && + Objects.equals(this.meta, getContactHistoryResponse.meta); + } + + @Override + public int hashCode() { + return Objects.hash(result, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactHistoryResponse {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("result"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("result"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetContactHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetContactHistoryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetContactHistoryResponse is not found in the empty JSON string", GetContactHistoryResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetContactHistoryResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetContactHistoryResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetContactHistoryResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `result` + Result18.validateJsonElement(jsonObj.get("result")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetContactHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetContactHistoryResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetContactHistoryResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetContactHistoryResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetContactHistoryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetContactHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetContactHistoryResponse + * @throws IOException if the JSON string is invalid with respect to GetContactHistoryResponse + */ + public static GetContactHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetContactHistoryResponse.class); + } + + /** + * Convert an instance of GetContactHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/GetMailingListContactResponse.java b/src/main/java/pl/wtx/qualtrics/api/client/model/GetMailingListContactResponse.java new file mode 100644 index 0000000..88fc9d1 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/GetMailingListContactResponse.java @@ -0,0 +1,245 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import pl.wtx.qualtrics.api.client.model.Meta; +import pl.wtx.qualtrics.api.client.model.Result17; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * GetMailingListContactResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class GetMailingListContactResponse { + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + @javax.annotation.Nonnull + private Result17 result; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public GetMailingListContactResponse() { + } + + public GetMailingListContactResponse result(@javax.annotation.Nonnull Result17 result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @javax.annotation.Nonnull + public Result17 getResult() { + return result; + } + + public void setResult(@javax.annotation.Nonnull Result17 result) { + this.result = result; + } + + + public GetMailingListContactResponse meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMailingListContactResponse getMailingListContactResponse = (GetMailingListContactResponse) o; + return Objects.equals(this.result, getMailingListContactResponse.result) && + Objects.equals(this.meta, getMailingListContactResponse.meta); + } + + @Override + public int hashCode() { + return Objects.hash(result, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMailingListContactResponse {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("result"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("result"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetMailingListContactResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMailingListContactResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMailingListContactResponse is not found in the empty JSON string", GetMailingListContactResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetMailingListContactResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMailingListContactResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMailingListContactResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `result` + Result17.validateJsonElement(jsonObj.get("result")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMailingListContactResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMailingListContactResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMailingListContactResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMailingListContactResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMailingListContactResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMailingListContactResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMailingListContactResponse + * @throws IOException if the JSON string is invalid with respect to GetMailingListContactResponse + */ + public static GetMailingListContactResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMailingListContactResponse.class); + } + + /** + * Convert an instance of GetMailingListContactResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/ListContactsInContactListResponse.java b/src/main/java/pl/wtx/qualtrics/api/client/model/ListContactsInContactListResponse.java new file mode 100644 index 0000000..e3cc84d --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/ListContactsInContactListResponse.java @@ -0,0 +1,245 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +import pl.wtx.qualtrics.api.client.model.Meta; +import pl.wtx.qualtrics.api.client.model.Result16; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * ListContactsInContactListResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class ListContactsInContactListResponse { + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + @javax.annotation.Nonnull + private Result16 result; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public ListContactsInContactListResponse() { + } + + public ListContactsInContactListResponse result(@javax.annotation.Nonnull Result16 result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @javax.annotation.Nonnull + public Result16 getResult() { + return result; + } + + public void setResult(@javax.annotation.Nonnull Result16 result) { + this.result = result; + } + + + public ListContactsInContactListResponse meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListContactsInContactListResponse listContactsInContactListResponse = (ListContactsInContactListResponse) o; + return Objects.equals(this.result, listContactsInContactListResponse.result) && + Objects.equals(this.meta, listContactsInContactListResponse.meta); + } + + @Override + public int hashCode() { + return Objects.hash(result, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListContactsInContactListResponse {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("result"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("result"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListContactsInContactListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListContactsInContactListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListContactsInContactListResponse is not found in the empty JSON string", ListContactsInContactListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListContactsInContactListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListContactsInContactListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListContactsInContactListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `result` + Result16.validateJsonElement(jsonObj.get("result")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListContactsInContactListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListContactsInContactListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListContactsInContactListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListContactsInContactListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListContactsInContactListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListContactsInContactListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListContactsInContactListResponse + * @throws IOException if the JSON string is invalid with respect to ListContactsInContactListResponse + */ + public static ListContactsInContactListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListContactsInContactListResponse.class); + } + + /** + * Convert an instance of ListContactsInContactListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/NumericFilter.java b/src/main/java/pl/wtx/qualtrics/api/client/model/NumericFilter.java deleted file mode 100644 index d625820..0000000 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/NumericFilter.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Qualtrics API - * This is the API specification for Qualtrics platform. - * - * The version of the OpenAPI document: 3.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package pl.wtx.qualtrics.api.client.model; - -import java.util.Objects; -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 java.io.IOException; -import java.util.Arrays; - -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 com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import pl.wtx.qualtrics.api.client.invoker.JSON; - -/** - * NumericFilter - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class NumericFilter { - /** - * Gets or Sets filterType - */ - @JsonAdapter(FilterTypeEnum.Adapter.class) - public enum FilterTypeEnum { - CREATED("created"), - - LAST_MODIFIED("lastModified"); - - private String value; - - FilterTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FilterTypeEnum fromValue(String value) { - for (FilterTypeEnum b : FilterTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FilterTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FilterTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FilterTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FilterTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_FILTER_TYPE) - @javax.annotation.Nullable - private FilterTypeEnum filterType; - - /** - * Gets or Sets comparison - */ - @JsonAdapter(ComparisonEnum.Adapter.class) - public enum ComparisonEnum { - EQ("eq"), - - NEQ("neq"), - - GT("gt"), - - LT("lt"), - - GTE("gte"), - - LTE("lte"); - - private String value; - - ComparisonEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ComparisonEnum fromValue(String value) { - for (ComparisonEnum b : ComparisonEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparisonEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparisonEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparisonEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparisonEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_COMPARISON = "comparison"; - @SerializedName(SERIALIZED_NAME_COMPARISON) - @javax.annotation.Nullable - private ComparisonEnum comparison; - - public NumericFilter() { - } - - public NumericFilter filterType(@javax.annotation.Nullable FilterTypeEnum filterType) { - this.filterType = filterType; - return this; - } - - /** - * Get filterType - * @return filterType - */ - @javax.annotation.Nullable - public FilterTypeEnum getFilterType() { - return filterType; - } - - public void setFilterType(@javax.annotation.Nullable FilterTypeEnum filterType) { - this.filterType = filterType; - } - - - public NumericFilter comparison(@javax.annotation.Nullable ComparisonEnum comparison) { - this.comparison = comparison; - return this; - } - - /** - * Get comparison - * @return comparison - */ - @javax.annotation.Nullable - public ComparisonEnum getComparison() { - return comparison; - } - - public void setComparison(@javax.annotation.Nullable ComparisonEnum comparison) { - this.comparison = comparison; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumericFilter numericFilter = (NumericFilter) o; - return Objects.equals(this.filterType, numericFilter.filterType) && - Objects.equals(this.comparison, numericFilter.comparison); - } - - @Override - public int hashCode() { - return Objects.hash(filterType, comparison); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumericFilter {\n"); - sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); - sb.append(" comparison: ").append(toIndentedString(comparison)).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 openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterType"); - openapiFields.add("comparison"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NumericFilter - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NumericFilter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in NumericFilter is not found in the empty JSON string", NumericFilter.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NumericFilter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumericFilter` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) && !jsonObj.get("filterType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `filterType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filterType").toString())); - } - // validate the optional field `filterType` - if (jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) { - FilterTypeEnum.validateJsonElement(jsonObj.get("filterType")); - } - if ((jsonObj.get("comparison") != null && !jsonObj.get("comparison").isJsonNull()) && !jsonObj.get("comparison").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparison` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparison").toString())); - } - // validate the optional field `comparison` - if (jsonObj.get("comparison") != null && !jsonObj.get("comparison").isJsonNull()) { - ComparisonEnum.validateJsonElement(jsonObj.get("comparison")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NumericFilter.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NumericFilter' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NumericFilter.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, NumericFilter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public NumericFilter read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of NumericFilter given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumericFilter - * @throws IOException if the JSON string is invalid with respect to NumericFilter - */ - public static NumericFilter fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NumericFilter.class); - } - - /** - * Convert an instance of NumericFilter to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Result15.java b/src/main/java/pl/wtx/qualtrics/api/client/model/Result15.java new file mode 100644 index 0000000..365462b --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/Result15.java @@ -0,0 +1,236 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * Result15 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class Result15 { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CONTACT_LOOKUP_ID = "contactLookupId"; + @SerializedName(SERIALIZED_NAME_CONTACT_LOOKUP_ID) + @javax.annotation.Nullable + private String contactLookupId; + + public Result15() { + } + + public Result15 id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public Result15 contactLookupId(@javax.annotation.Nullable String contactLookupId) { + this.contactLookupId = contactLookupId; + return this; + } + + /** + * The contact's unique ID in the mailing list. + * @return contactLookupId + */ + @javax.annotation.Nullable + public String getContactLookupId() { + return contactLookupId; + } + + public void setContactLookupId(@javax.annotation.Nullable String contactLookupId) { + this.contactLookupId = contactLookupId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Result15 result15 = (Result15) o; + return Objects.equals(this.id, result15.id) && + Objects.equals(this.contactLookupId, result15.contactLookupId); + } + + @Override + public int hashCode() { + return Objects.hash(id, contactLookupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Result15 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" contactLookupId: ").append(toIndentedString(contactLookupId)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("contactLookupId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Result15 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Result15.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Result15 is not found in the empty JSON string", Result15.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Result15.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Result15` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("contactLookupId") != null && !jsonObj.get("contactLookupId").isJsonNull()) && !jsonObj.get("contactLookupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contactLookupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contactLookupId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Result15.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Result15' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Result15.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Result15 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Result15 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Result15 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Result15 + * @throws IOException if the JSON string is invalid with respect to Result15 + */ + public static Result15 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Result15.class); + } + + /** + * Convert an instance of Result15 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Result16.java b/src/main/java/pl/wtx/qualtrics/api/client/model/Result16.java new file mode 100644 index 0000000..ee12c86 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/Result16.java @@ -0,0 +1,274 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import pl.wtx.qualtrics.api.client.model.SingleContactLegacy; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * Result16 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class Result16 { + public static final String SERIALIZED_NAME_ELEMENTS = "elements"; + @SerializedName(SERIALIZED_NAME_ELEMENTS) + @javax.annotation.Nonnull + private List elements = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE = "nextPage"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE) + @javax.annotation.Nullable + private String nextPage; + + public Result16() { + } + + public Result16 elements(@javax.annotation.Nonnull List elements) { + this.elements = elements; + return this; + } + + public Result16 addElementsItem(SingleContactLegacy elementsItem) { + if (this.elements == null) { + this.elements = new ArrayList<>(); + } + this.elements.add(elementsItem); + return this; + } + + /** + * Get elements + * @return elements + */ + @javax.annotation.Nonnull + public List getElements() { + return elements; + } + + public void setElements(@javax.annotation.Nonnull List elements) { + this.elements = elements; + } + + + public Result16 nextPage(@javax.annotation.Nullable String nextPage) { + this.nextPage = nextPage; + return this; + } + + /** + * Page number of result if response is divided across several pages. For the last page of results, the value returned is `null`. + * @return nextPage + */ + @javax.annotation.Nullable + public String getNextPage() { + return nextPage; + } + + public void setNextPage(@javax.annotation.Nullable String nextPage) { + this.nextPage = nextPage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Result16 result16 = (Result16) o; + return Objects.equals(this.elements, result16.elements) && + Objects.equals(this.nextPage, result16.nextPage); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable 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(elements, nextPage); + } + + private static int hashCodeNullable(JsonNullable 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 Result16 {\n"); + sb.append(" elements: ").append(toIndentedString(elements)).append("\n"); + sb.append(" nextPage: ").append(toIndentedString(nextPage)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("elements"); + openapiFields.add("nextPage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("elements"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Result16 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Result16.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Result16 is not found in the empty JSON string", Result16.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Result16.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Result16` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Result16.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("elements").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `elements` to be an array in the JSON string but got `%s`", jsonObj.get("elements").toString())); + } + + JsonArray jsonArrayelements = jsonObj.getAsJsonArray("elements"); + // validate the required field `elements` (array) + for (int i = 0; i < jsonArrayelements.size(); i++) { + SingleContactLegacy.validateJsonElement(jsonArrayelements.get(i)); + }; + if ((jsonObj.get("nextPage") != null && !jsonObj.get("nextPage").isJsonNull()) && !jsonObj.get("nextPage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Result16.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Result16' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Result16.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Result16 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Result16 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Result16 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Result16 + * @throws IOException if the JSON string is invalid with respect to Result16 + */ + public static Result16 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Result16.class); + } + + /** + * Convert an instance of Result16 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Result17.java b/src/main/java/pl/wtx/qualtrics/api/client/model/Result17.java new file mode 100644 index 0000000..b066fba --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/Result17.java @@ -0,0 +1,730 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * Result17 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class Result17 { + public static final String SERIALIZED_NAME_CONTACT_ID = "contactId"; + @SerializedName(SERIALIZED_NAME_CONTACT_ID) + @javax.annotation.Nullable + private String contactId; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + @javax.annotation.Nullable + private Long creationDate; + + public static final String SERIALIZED_NAME_LAST_MODIFIED = "lastModified"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED) + @javax.annotation.Nullable + private Long lastModified; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_EMAIL_DOMAIN = "emailDomain"; + @SerializedName(SERIALIZED_NAME_EMAIL_DOMAIN) + @javax.annotation.Nullable + private String emailDomain; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public static final String SERIALIZED_NAME_EXT_REF = "extRef"; + @SerializedName(SERIALIZED_NAME_EXT_REF) + @javax.annotation.Nullable + private String extRef; + + public static final String SERIALIZED_NAME_EMBEDDED_DATA = "embeddedData"; + @SerializedName(SERIALIZED_NAME_EMBEDDED_DATA) + @javax.annotation.Nullable + private Map embeddedData = new HashMap<>(); + + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_DIRECTORY_UNSUBSCRIBED = "directoryUnsubscribed"; + @SerializedName(SERIALIZED_NAME_DIRECTORY_UNSUBSCRIBED) + @javax.annotation.Nullable + private Boolean directoryUnsubscribed; + + public static final String SERIALIZED_NAME_DIRECTORY_UNSUBSCRIBE_DATE = "directoryUnsubscribeDate"; + @SerializedName(SERIALIZED_NAME_DIRECTORY_UNSUBSCRIBE_DATE) + @javax.annotation.Nullable + private String directoryUnsubscribeDate; + + public static final String SERIALIZED_NAME_MAILING_LIST_UNSUBSCRIBED = "mailingListUnsubscribed"; + @SerializedName(SERIALIZED_NAME_MAILING_LIST_UNSUBSCRIBED) + @javax.annotation.Nullable + private Boolean mailingListUnsubscribed; + + public static final String SERIALIZED_NAME_MAILING_LIST_UNSUBSCRIBE_DATE = "mailingListUnsubscribeDate"; + @SerializedName(SERIALIZED_NAME_MAILING_LIST_UNSUBSCRIBE_DATE) + @javax.annotation.Nullable + private Long mailingListUnsubscribeDate; + + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + @javax.annotation.Nullable + private Map stats; + + public static final String SERIALIZED_NAME_CONTACT_LOOKUP_ID = "contactLookupId"; + @SerializedName(SERIALIZED_NAME_CONTACT_LOOKUP_ID) + @javax.annotation.Nullable + private String contactLookupId; + + public static final String SERIALIZED_NAME_PRIVATE_EMBEDDED_DATA = "privateEmbeddedData"; + @SerializedName(SERIALIZED_NAME_PRIVATE_EMBEDDED_DATA) + @javax.annotation.Nullable + private Map privateEmbeddedData = new HashMap<>(); + + public Result17() { + } + + public Result17 contactId(@javax.annotation.Nullable String contactId) { + this.contactId = contactId; + return this; + } + + /** + * + * @return contactId + */ + @javax.annotation.Nullable + public String getContactId() { + return contactId; + } + + public void setContactId(@javax.annotation.Nullable String contactId) { + this.contactId = contactId; + } + + + public Result17 creationDate(@javax.annotation.Nullable Long creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Date and time this contact's record was created. Expressed in milliseconds since the Unix epoch, January 1, 1970 at 0:00 UTC. + * @return creationDate + */ + @javax.annotation.Nullable + public Long getCreationDate() { + return creationDate; + } + + public void setCreationDate(@javax.annotation.Nullable Long creationDate) { + this.creationDate = creationDate; + } + + + public Result17 lastModified(@javax.annotation.Nullable Long lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Date and time this record was last modified. Expressed in milliseconds since the Unix epoch, January 1, 1970 at 0:00 UTC. + * @return lastModified + */ + @javax.annotation.Nullable + public Long getLastModified() { + return lastModified; + } + + public void setLastModified(@javax.annotation.Nullable Long lastModified) { + this.lastModified = lastModified; + } + + + public Result17 firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * THe contact's first name. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public Result17 lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The contact's last name. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public Result17 email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The contact's email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public Result17 emailDomain(@javax.annotation.Nullable String emailDomain) { + this.emailDomain = emailDomain; + return this; + } + + /** + * The contact's email domain. + * @return emailDomain + */ + @javax.annotation.Nullable + public String getEmailDomain() { + return emailDomain; + } + + public void setEmailDomain(@javax.annotation.Nullable String emailDomain) { + this.emailDomain = emailDomain; + } + + + public Result17 phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * The contact's phone number. + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public Result17 extRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + return this; + } + + /** + * External reference information for the contact. + * @return extRef + */ + @javax.annotation.Nullable + public String getExtRef() { + return extRef; + } + + public void setExtRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + } + + + public Result17 embeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + return this; + } + + public Result17 putEmbeddedDataItem(String key, String embeddedDataItem) { + if (this.embeddedData == null) { + this.embeddedData = new HashMap<>(); + } + this.embeddedData.put(key, embeddedDataItem); + return this; + } + + /** + * Embedded data for the contact. + * @return embeddedData + */ + @javax.annotation.Nullable + public Map getEmbeddedData() { + return embeddedData; + } + + public void setEmbeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + } + + + public Result17 language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The contact's preferred language. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public Result17 directoryUnsubscribed(@javax.annotation.Nullable Boolean directoryUnsubscribed) { + this.directoryUnsubscribed = directoryUnsubscribed; + return this; + } + + /** + * Indicates whether the user opted out of the directory. + * @return directoryUnsubscribed + */ + @javax.annotation.Nullable + public Boolean getDirectoryUnsubscribed() { + return directoryUnsubscribed; + } + + public void setDirectoryUnsubscribed(@javax.annotation.Nullable Boolean directoryUnsubscribed) { + this.directoryUnsubscribed = directoryUnsubscribed; + } + + + public Result17 directoryUnsubscribeDate(@javax.annotation.Nullable String directoryUnsubscribeDate) { + this.directoryUnsubscribeDate = directoryUnsubscribeDate; + return this; + } + + /** + * Date and time the user opted out of the directory. Expressed in ISO 8601 format + * @return directoryUnsubscribeDate + */ + @javax.annotation.Nullable + public String getDirectoryUnsubscribeDate() { + return directoryUnsubscribeDate; + } + + public void setDirectoryUnsubscribeDate(@javax.annotation.Nullable String directoryUnsubscribeDate) { + this.directoryUnsubscribeDate = directoryUnsubscribeDate; + } + + + public Result17 mailingListUnsubscribed(@javax.annotation.Nullable Boolean mailingListUnsubscribed) { + this.mailingListUnsubscribed = mailingListUnsubscribed; + return this; + } + + /** + * Indicates whether the contact unsubscribed from this mailing list. + * @return mailingListUnsubscribed + */ + @javax.annotation.Nullable + public Boolean getMailingListUnsubscribed() { + return mailingListUnsubscribed; + } + + public void setMailingListUnsubscribed(@javax.annotation.Nullable Boolean mailingListUnsubscribed) { + this.mailingListUnsubscribed = mailingListUnsubscribed; + } + + + public Result17 mailingListUnsubscribeDate(@javax.annotation.Nullable Long mailingListUnsubscribeDate) { + this.mailingListUnsubscribeDate = mailingListUnsubscribeDate; + return this; + } + + /** + * The date the contact opted out of this mailing list. Is set to null if the user has not opted out. + * @return mailingListUnsubscribeDate + */ + @javax.annotation.Nullable + public Long getMailingListUnsubscribeDate() { + return mailingListUnsubscribeDate; + } + + public void setMailingListUnsubscribeDate(@javax.annotation.Nullable Long mailingListUnsubscribeDate) { + this.mailingListUnsubscribeDate = mailingListUnsubscribeDate; + } + + + public Result17 stats(@javax.annotation.Nullable Map stats) { + this.stats = stats; + return this; + } + + public Result17 putStatsItem(String key, String statsItem) { + if (this.stats == null) { + this.stats = new HashMap<>(); + } + this.stats.put(key, statsItem); + return this; + } + + /** + * Statistics relevant to the request. All Month Stats are deprecated and no longer updated. + * @return stats + */ + @javax.annotation.Nullable + public Map getStats() { + return stats; + } + + public void setStats(@javax.annotation.Nullable Map stats) { + this.stats = stats; + } + + + public Result17 contactLookupId(@javax.annotation.Nullable String contactLookupId) { + this.contactLookupId = contactLookupId; + return this; + } + + /** + * The contact's unique ID in the mailing list. + * @return contactLookupId + */ + @javax.annotation.Nullable + public String getContactLookupId() { + return contactLookupId; + } + + public void setContactLookupId(@javax.annotation.Nullable String contactLookupId) { + this.contactLookupId = contactLookupId; + } + + + public Result17 privateEmbeddedData(@javax.annotation.Nullable Map privateEmbeddedData) { + this.privateEmbeddedData = privateEmbeddedData; + return this; + } + + public Result17 putPrivateEmbeddedDataItem(String key, String privateEmbeddedDataItem) { + if (this.privateEmbeddedData == null) { + this.privateEmbeddedData = new HashMap<>(); + } + this.privateEmbeddedData.put(key, privateEmbeddedDataItem); + return this; + } + + /** + * Embedded data for the contact. + * @return privateEmbeddedData + */ + @javax.annotation.Nullable + public Map getPrivateEmbeddedData() { + return privateEmbeddedData; + } + + public void setPrivateEmbeddedData(@javax.annotation.Nullable Map privateEmbeddedData) { + this.privateEmbeddedData = privateEmbeddedData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Result17 result17 = (Result17) o; + return Objects.equals(this.contactId, result17.contactId) && + Objects.equals(this.creationDate, result17.creationDate) && + Objects.equals(this.lastModified, result17.lastModified) && + Objects.equals(this.firstName, result17.firstName) && + Objects.equals(this.lastName, result17.lastName) && + Objects.equals(this.email, result17.email) && + Objects.equals(this.emailDomain, result17.emailDomain) && + Objects.equals(this.phone, result17.phone) && + Objects.equals(this.extRef, result17.extRef) && + Objects.equals(this.embeddedData, result17.embeddedData) && + Objects.equals(this.language, result17.language) && + Objects.equals(this.directoryUnsubscribed, result17.directoryUnsubscribed) && + Objects.equals(this.directoryUnsubscribeDate, result17.directoryUnsubscribeDate) && + Objects.equals(this.mailingListUnsubscribed, result17.mailingListUnsubscribed) && + Objects.equals(this.mailingListUnsubscribeDate, result17.mailingListUnsubscribeDate) && + Objects.equals(this.stats, result17.stats) && + Objects.equals(this.contactLookupId, result17.contactLookupId) && + Objects.equals(this.privateEmbeddedData, result17.privateEmbeddedData); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable 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(contactId, creationDate, lastModified, firstName, lastName, email, emailDomain, phone, extRef, embeddedData, language, directoryUnsubscribed, directoryUnsubscribeDate, mailingListUnsubscribed, mailingListUnsubscribeDate, stats, contactLookupId, privateEmbeddedData); + } + + private static int hashCodeNullable(JsonNullable 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 Result17 {\n"); + sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" lastModified: ").append(toIndentedString(lastModified)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" emailDomain: ").append(toIndentedString(emailDomain)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" extRef: ").append(toIndentedString(extRef)).append("\n"); + sb.append(" embeddedData: ").append(toIndentedString(embeddedData)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" directoryUnsubscribed: ").append(toIndentedString(directoryUnsubscribed)).append("\n"); + sb.append(" directoryUnsubscribeDate: ").append(toIndentedString(directoryUnsubscribeDate)).append("\n"); + sb.append(" mailingListUnsubscribed: ").append(toIndentedString(mailingListUnsubscribed)).append("\n"); + sb.append(" mailingListUnsubscribeDate: ").append(toIndentedString(mailingListUnsubscribeDate)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" contactLookupId: ").append(toIndentedString(contactLookupId)).append("\n"); + sb.append(" privateEmbeddedData: ").append(toIndentedString(privateEmbeddedData)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contactId"); + openapiFields.add("creationDate"); + openapiFields.add("lastModified"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("emailDomain"); + openapiFields.add("phone"); + openapiFields.add("extRef"); + openapiFields.add("embeddedData"); + openapiFields.add("language"); + openapiFields.add("directoryUnsubscribed"); + openapiFields.add("directoryUnsubscribeDate"); + openapiFields.add("mailingListUnsubscribed"); + openapiFields.add("mailingListUnsubscribeDate"); + openapiFields.add("stats"); + openapiFields.add("contactLookupId"); + openapiFields.add("privateEmbeddedData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Result17 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Result17.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Result17 is not found in the empty JSON string", Result17.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Result17.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Result17` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("contactId") != null && !jsonObj.get("contactId").isJsonNull()) && !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("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("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("emailDomain") != null && !jsonObj.get("emailDomain").isJsonNull()) && !jsonObj.get("emailDomain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailDomain").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("extRef") != null && !jsonObj.get("extRef").isJsonNull()) && !jsonObj.get("extRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extRef").toString())); + } + if ((jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) && !jsonObj.get("language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + if ((jsonObj.get("directoryUnsubscribeDate") != null && !jsonObj.get("directoryUnsubscribeDate").isJsonNull()) && !jsonObj.get("directoryUnsubscribeDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `directoryUnsubscribeDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("directoryUnsubscribeDate").toString())); + } + if ((jsonObj.get("contactLookupId") != null && !jsonObj.get("contactLookupId").isJsonNull()) && !jsonObj.get("contactLookupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contactLookupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contactLookupId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Result17.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Result17' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Result17.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Result17 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Result17 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Result17 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Result17 + * @throws IOException if the JSON string is invalid with respect to Result17 + */ + public static Result17 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Result17.class); + } + + /** + * Convert an instance of Result17 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/Result18.java b/src/main/java/pl/wtx/qualtrics/api/client/model/Result18.java new file mode 100644 index 0000000..b7dde62 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/Result18.java @@ -0,0 +1,263 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import pl.wtx.qualtrics.api.client.model.ElementsInner2; + +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * Result18 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class Result18 { + public static final String SERIALIZED_NAME_ELEMENTS = "elements"; + @SerializedName(SERIALIZED_NAME_ELEMENTS) + @javax.annotation.Nonnull + private List elements = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE = "nextPage"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE) + @javax.annotation.Nullable + private String nextPage; + + public Result18() { + } + + public Result18 elements(@javax.annotation.Nonnull List elements) { + this.elements = elements; + return this; + } + + public Result18 addElementsItem(ElementsInner2 elementsItem) { + if (this.elements == null) { + this.elements = new ArrayList<>(); + } + this.elements.add(elementsItem); + return this; + } + + /** + * Get elements + * @return elements + */ + @javax.annotation.Nonnull + public List getElements() { + return elements; + } + + public void setElements(@javax.annotation.Nonnull List elements) { + this.elements = elements; + } + + + public Result18 nextPage(@javax.annotation.Nullable String nextPage) { + this.nextPage = nextPage; + return this; + } + + /** + * Page number of result if response is divided across several pages. For the last page of results, the value returned is `null`. + * @return nextPage + */ + @javax.annotation.Nullable + public String getNextPage() { + return nextPage; + } + + public void setNextPage(@javax.annotation.Nullable String nextPage) { + this.nextPage = nextPage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Result18 result18 = (Result18) o; + return Objects.equals(this.elements, result18.elements) && + Objects.equals(this.nextPage, result18.nextPage); + } + + @Override + public int hashCode() { + return Objects.hash(elements, nextPage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Result18 {\n"); + sb.append(" elements: ").append(toIndentedString(elements)).append("\n"); + sb.append(" nextPage: ").append(toIndentedString(nextPage)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("elements"); + openapiFields.add("nextPage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("elements"); + openapiRequiredFields.add("nextPage"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Result18 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Result18.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Result18 is not found in the empty JSON string", Result18.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Result18.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Result18` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Result18.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("elements").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `elements` to be an array in the JSON string but got `%s`", jsonObj.get("elements").toString())); + } + + JsonArray jsonArrayelements = jsonObj.getAsJsonArray("elements"); + // validate the required field `elements` (array) + for (int i = 0; i < jsonArrayelements.size(); i++) { + ElementsInner2.validateJsonElement(jsonArrayelements.get(i)); + }; + if ((jsonObj.get("nextPage") != null && !jsonObj.get("nextPage").isJsonNull()) && !jsonObj.get("nextPage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Result18.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Result18' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Result18.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Result18 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Result18 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Result18 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Result18 + * @throws IOException if the JSON string is invalid with respect to Result18 + */ + public static Result18 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Result18.class); + } + + /** + * Convert an instance of Result18 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/SingleContactLegacy.java b/src/main/java/pl/wtx/qualtrics/api/client/model/SingleContactLegacy.java new file mode 100644 index 0000000..de8c0f4 --- /dev/null +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/SingleContactLegacy.java @@ -0,0 +1,458 @@ +/* + * Qualtrics API + * This is the API specification for Qualtrics platform. + * + * The version of the OpenAPI document: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package pl.wtx.qualtrics.api.client.model; + +import java.util.Objects; +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 java.io.IOException; +import java.util.Arrays; +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 com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import pl.wtx.qualtrics.api.client.invoker.JSON; + +/** + * SingleContactLegacy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") +public class SingleContactLegacy { + public static final String SERIALIZED_NAME_CONTACT_ID = "contactId"; + @SerializedName(SERIALIZED_NAME_CONTACT_ID) + @javax.annotation.Nonnull + private String contactId; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public static final String SERIALIZED_NAME_EXT_REF = "extRef"; + @SerializedName(SERIALIZED_NAME_EXT_REF) + @javax.annotation.Nullable + private String extRef; + + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_UNSUBSCRIBED = "unsubscribed"; + @SerializedName(SERIALIZED_NAME_UNSUBSCRIBED) + @javax.annotation.Nullable + private Boolean unsubscribed; + + public static final String SERIALIZED_NAME_EMBEDDED_DATA = "embeddedData"; + @SerializedName(SERIALIZED_NAME_EMBEDDED_DATA) + @javax.annotation.Nullable + private Map embeddedData = new HashMap<>(); + + public SingleContactLegacy() { + } + + public SingleContactLegacy contactId(@javax.annotation.Nonnull String contactId) { + this.contactId = contactId; + return this; + } + + /** + * + * @return contactId + */ + @javax.annotation.Nonnull + public String getContactId() { + return contactId; + } + + public void setContactId(@javax.annotation.Nonnull String contactId) { + this.contactId = contactId; + } + + + public SingleContactLegacy firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * THe contact's first name. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public SingleContactLegacy lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The contact's last name. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public SingleContactLegacy email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The contact's email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public SingleContactLegacy phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * The contact's phone number. + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public SingleContactLegacy extRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + return this; + } + + /** + * External reference information for the contact. + * @return extRef + */ + @javax.annotation.Nullable + public String getExtRef() { + return extRef; + } + + public void setExtRef(@javax.annotation.Nullable String extRef) { + this.extRef = extRef; + } + + + public SingleContactLegacy language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The contact's preferred language. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public SingleContactLegacy unsubscribed(@javax.annotation.Nullable Boolean unsubscribed) { + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Whether the contact is unsubscribed. + * @return unsubscribed + */ + @javax.annotation.Nullable + public Boolean getUnsubscribed() { + return unsubscribed; + } + + public void setUnsubscribed(@javax.annotation.Nullable Boolean unsubscribed) { + this.unsubscribed = unsubscribed; + } + + + public SingleContactLegacy embeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + return this; + } + + public SingleContactLegacy putEmbeddedDataItem(String key, String embeddedDataItem) { + if (this.embeddedData == null) { + this.embeddedData = new HashMap<>(); + } + this.embeddedData.put(key, embeddedDataItem); + return this; + } + + /** + * Embedded data for the contact. + * @return embeddedData + */ + @javax.annotation.Nullable + public Map getEmbeddedData() { + return embeddedData; + } + + public void setEmbeddedData(@javax.annotation.Nullable Map embeddedData) { + this.embeddedData = embeddedData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleContactLegacy singleContactLegacy = (SingleContactLegacy) o; + return Objects.equals(this.contactId, singleContactLegacy.contactId) && + Objects.equals(this.firstName, singleContactLegacy.firstName) && + Objects.equals(this.lastName, singleContactLegacy.lastName) && + Objects.equals(this.email, singleContactLegacy.email) && + Objects.equals(this.phone, singleContactLegacy.phone) && + Objects.equals(this.extRef, singleContactLegacy.extRef) && + Objects.equals(this.language, singleContactLegacy.language) && + Objects.equals(this.unsubscribed, singleContactLegacy.unsubscribed) && + Objects.equals(this.embeddedData, singleContactLegacy.embeddedData); + } + + @Override + public int hashCode() { + return Objects.hash(contactId, firstName, lastName, email, phone, extRef, language, unsubscribed, embeddedData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SingleContactLegacy {\n"); + sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" extRef: ").append(toIndentedString(extRef)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" unsubscribed: ").append(toIndentedString(unsubscribed)).append("\n"); + sb.append(" embeddedData: ").append(toIndentedString(embeddedData)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contactId"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("phone"); + openapiFields.add("extRef"); + openapiFields.add("language"); + openapiFields.add("unsubscribed"); + openapiFields.add("embeddedData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contactId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SingleContactLegacy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SingleContactLegacy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SingleContactLegacy is not found in the empty JSON string", SingleContactLegacy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SingleContactLegacy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SingleContactLegacy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SingleContactLegacy.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("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("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("extRef") != null && !jsonObj.get("extRef").isJsonNull()) && !jsonObj.get("extRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extRef").toString())); + } + if ((jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) && !jsonObj.get("language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SingleContactLegacy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SingleContactLegacy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SingleContactLegacy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SingleContactLegacy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SingleContactLegacy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SingleContactLegacy given an JSON string + * + * @param jsonString JSON string + * @return An instance of SingleContactLegacy + * @throws IOException if the JSON string is invalid with respect to SingleContactLegacy + */ + public static SingleContactLegacy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SingleContactLegacy.class); + } + + /** + * Convert an instance of SingleContactLegacy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/StringFilter.java b/src/main/java/pl/wtx/qualtrics/api/client/model/StringFilter.java deleted file mode 100644 index 69de598..0000000 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/StringFilter.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Qualtrics API - * This is the API specification for Qualtrics platform. - * - * The version of the OpenAPI document: 3.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package pl.wtx.qualtrics.api.client.model; - -import java.util.Objects; -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 java.io.IOException; -import java.util.Arrays; - -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 com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import pl.wtx.qualtrics.api.client.invoker.JSON; - -/** - * StringFilter - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class StringFilter { - /** - * Gets or Sets filterType - */ - @JsonAdapter(FilterTypeEnum.Adapter.class) - public enum FilterTypeEnum { - EMAIL("email"), - - FIRST_NAME("firstName"), - - LAST_NAME("lastName"), - - LANGUAGE("language"), - - PHONE("phone"), - - EXT_REF("extRef"); - - private String value; - - FilterTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FilterTypeEnum fromValue(String value) { - for (FilterTypeEnum b : FilterTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FilterTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FilterTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FilterTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FilterTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; - @SerializedName(SERIALIZED_NAME_FILTER_TYPE) - @javax.annotation.Nullable - private FilterTypeEnum filterType; - - /** - * Gets or Sets comparison - */ - @JsonAdapter(ComparisonEnum.Adapter.class) - public enum ComparisonEnum { - EQ("eq"), - - NEQ("neq"); - - private String value; - - ComparisonEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ComparisonEnum fromValue(String value) { - for (ComparisonEnum b : ComparisonEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ComparisonEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ComparisonEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ComparisonEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ComparisonEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_COMPARISON = "comparison"; - @SerializedName(SERIALIZED_NAME_COMPARISON) - @javax.annotation.Nullable - private ComparisonEnum comparison; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nullable - private String value; - - public StringFilter() { - } - - public StringFilter filterType(@javax.annotation.Nullable FilterTypeEnum filterType) { - this.filterType = filterType; - return this; - } - - /** - * Get filterType - * @return filterType - */ - @javax.annotation.Nullable - public FilterTypeEnum getFilterType() { - return filterType; - } - - public void setFilterType(@javax.annotation.Nullable FilterTypeEnum filterType) { - this.filterType = filterType; - } - - - public StringFilter comparison(@javax.annotation.Nullable ComparisonEnum comparison) { - this.comparison = comparison; - return this; - } - - /** - * Get comparison - * @return comparison - */ - @javax.annotation.Nullable - public ComparisonEnum getComparison() { - return comparison; - } - - public void setComparison(@javax.annotation.Nullable ComparisonEnum comparison) { - this.comparison = comparison; - } - - - public StringFilter value(@javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nullable - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StringFilter stringFilter = (StringFilter) o; - return Objects.equals(this.filterType, stringFilter.filterType) && - Objects.equals(this.comparison, stringFilter.comparison) && - Objects.equals(this.value, stringFilter.value); - } - - @Override - public int hashCode() { - return Objects.hash(filterType, comparison, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringFilter {\n"); - sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); - sb.append(" comparison: ").append(toIndentedString(comparison)).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 openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterType"); - openapiFields.add("comparison"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StringFilter - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StringFilter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in StringFilter is not found in the empty JSON string", StringFilter.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!StringFilter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StringFilter` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) && !jsonObj.get("filterType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `filterType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filterType").toString())); - } - // validate the optional field `filterType` - if (jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) { - FilterTypeEnum.validateJsonElement(jsonObj.get("filterType")); - } - if ((jsonObj.get("comparison") != null && !jsonObj.get("comparison").isJsonNull()) && !jsonObj.get("comparison").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `comparison` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comparison").toString())); - } - // validate the optional field `comparison` - if (jsonObj.get("comparison") != null && !jsonObj.get("comparison").isJsonNull()) { - ComparisonEnum.validateJsonElement(jsonObj.get("comparison")); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !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 TypeAdapter create(Gson gson, TypeToken type) { - if (!StringFilter.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StringFilter' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StringFilter.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StringFilter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public StringFilter read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StringFilter given an JSON string - * - * @param jsonString JSON string - * @return An instance of StringFilter - * @throws IOException if the JSON string is invalid with respect to StringFilter - */ - public static StringFilter fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StringFilter.class); - } - - /** - * Convert an instance of StringFilter to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/pl/wtx/qualtrics/api/client/model/MailingListMembership.java b/src/main/java/pl/wtx/qualtrics/api/client/model/UpdateContactResponse.java similarity index 60% rename from src/main/java/pl/wtx/qualtrics/api/client/model/MailingListMembership.java rename to src/main/java/pl/wtx/qualtrics/api/client/model/UpdateContactResponse.java index b73e432..f0606c6 100644 --- a/src/main/java/pl/wtx/qualtrics/api/client/model/MailingListMembership.java +++ b/src/main/java/pl/wtx/qualtrics/api/client/model/UpdateContactResponse.java @@ -21,7 +21,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import pl.wtx.qualtrics.api.client.model.MailingListMembershipDetails; +import pl.wtx.qualtrics.api.client.model.Meta; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -47,34 +47,34 @@ import pl.wtx.qualtrics.api.client.invoker.JSON; /** - * The mailingListMembership object contains information about the mailing lists this contact belongs to. The object contains one object for each mailing list, with the mailing list ID as the object name. + * UpdateContactResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0") -public class MailingListMembership { - public static final String SERIALIZED_NAME_MAILING_LIST_ID = "mailingListId"; - @SerializedName(SERIALIZED_NAME_MAILING_LIST_ID) - @javax.annotation.Nullable - private MailingListMembershipDetails mailingListId; +public class UpdateContactResponse { + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; - public MailingListMembership() { + public UpdateContactResponse() { } - public MailingListMembership mailingListId(@javax.annotation.Nullable MailingListMembershipDetails mailingListId) { - this.mailingListId = mailingListId; + public UpdateContactResponse meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; return this; } /** - * Get mailingListId - * @return mailingListId + * Get meta + * @return meta */ - @javax.annotation.Nullable - public MailingListMembershipDetails getMailingListId() { - return mailingListId; + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; } - public void setMailingListId(@javax.annotation.Nullable MailingListMembershipDetails mailingListId) { - this.mailingListId = mailingListId; + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; } @@ -87,20 +87,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MailingListMembership mailingListMembership = (MailingListMembership) o; - return Objects.equals(this.mailingListId, mailingListMembership.mailingListId); + UpdateContactResponse updateContactResponse = (UpdateContactResponse) o; + return Objects.equals(this.meta, updateContactResponse.meta); } @Override public int hashCode() { - return Objects.hash(mailingListId); + return Objects.hash(meta); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class MailingListMembership {\n"); - sb.append(" mailingListId: ").append(toIndentedString(mailingListId)).append("\n"); + sb.append("class UpdateContactResponse {\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); sb.append("}"); return sb.toString(); } @@ -123,59 +123,65 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("mailingListId"); + openapiFields.add("meta"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("meta"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MailingListMembership + * @throws IOException if the JSON Element is invalid with respect to UpdateContactResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!MailingListMembership.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in MailingListMembership is not found in the empty JSON string", MailingListMembership.openapiRequiredFields.toString())); + if (!UpdateContactResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateContactResponse is not found in the empty JSON string", UpdateContactResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!MailingListMembership.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MailingListMembership` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!UpdateContactResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateContactResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `mailingListId` - if (jsonObj.get("mailingListId") != null && !jsonObj.get("mailingListId").isJsonNull()) { - MailingListMembershipDetails.validateJsonElement(jsonObj.get("mailingListId")); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateContactResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!MailingListMembership.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MailingListMembership' and its subtypes + if (!UpdateContactResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateContactResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MailingListMembership.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateContactResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, MailingListMembership value) throws IOException { + public void write(JsonWriter out, UpdateContactResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public MailingListMembership read(JsonReader in) throws IOException { + public UpdateContactResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -186,18 +192,18 @@ public MailingListMembership read(JsonReader in) throws IOException { } /** - * Create an instance of MailingListMembership given an JSON string + * Create an instance of UpdateContactResponse given an JSON string * * @param jsonString JSON string - * @return An instance of MailingListMembership - * @throws IOException if the JSON string is invalid with respect to MailingListMembership + * @return An instance of UpdateContactResponse + * @throws IOException if the JSON string is invalid with respect to UpdateContactResponse */ - public static MailingListMembership fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MailingListMembership.class); + public static UpdateContactResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateContactResponse.class); } /** - * Convert an instance of MailingListMembership to an JSON string + * Convert an instance of UpdateContactResponse to an JSON string * * @return JSON string */