diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml deleted file mode 100644 index ab7e1f7..0000000 --- a/.run/Run Demo.run.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29..3336258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## 1.0.0 +Initial release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6fa8de5..7b138c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,10 +33,10 @@ You should have the following things installed: * Ensure that the JDK/Java-Version is correct -## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/openapi-client-maven-template/release.yml?branch=master)](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/release.yml) +## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/brevo-java-client/release.yml?branch=master)](https://github.com/xdev-software/brevo-java-client/actions/workflows/release.yml) Before releasing: -* Consider doing a [test-deployment](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. +* Consider doing a [test-deployment](https://github.com/xdev-software/brevo-java-client/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. * Check the [changelog](CHANGELOG.md) If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes diff --git a/README.md b/README.md index bf4b7c7..c0d0a9d 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,38 @@ -[![Latest version](https://img.shields.io/maven-central/v/software.xdev/openapi-client-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/openapi-client-maven-template) -[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/openapi-client-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_openapi-client-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_openapi-client-maven-template) -[![API Specification Editor](https://img.shields.io/badge/API--Spec-Editor-85ea2d?logo=swagger)](https://editor.swagger.io/?url=https://raw.githubusercontent.com/xdev-software/openapi-client-maven-template/develop/openapi/openapi.yml) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/brevo-java-client?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/brevo-java-client) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/brevo-java-client/checkBuild.yml?branch=develop)](https://github.com/xdev-software/brevo-java-client/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_brevo-java-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_brevo-java-client) +[![API Specification Editor](https://img.shields.io/badge/API--Spec-Editor-85ea2d?logo=swagger)](https://editor.swagger.io/?url=https://raw.githubusercontent.com/xdev-software/brevo-java-client/develop/openapi/openapi.yml) -# openapi-client-maven-template +# [brevo](https://brevo.com)-java-client -This client [is generated](./openapi-client-maven-template/pom.xml) from an [``openapi.yml``](./openapi/openapi.yml) using [OpenAPI Generator](https://openapi-generator.tech/). +A Java client for the [Brevo](https://brevo.com) (formerly [SendinBlue](https://help.brevo.com/hc/en-us/articles/11279317272722-FAQs-Sendinblue-becomes-Brevo)) API + +> [!IMPORTANT] +> An API-Key is required.
+> You can get it at https://app.brevo.com/settings/keys/api + +This client [is generated](./brevo-java-client/pom.xml) from an [``openapi.yml``](./openapi/openapi.yml) using [OpenAPI Generator](https://openapi-generator.tech/). + +> [!NOTE] +>
Why did you create this API client and not use the official one? +> +> We had some problems (as of March 2024) with the "official" client: +> * The client looks seriously outdated: +> * it is still called "SendinBlue" +> * was last updated over a year ago and there was no activity (on issues/PR) since then +> * There is at least one CVE in the underlying HTTP client +> * It looks like there are problems with the underlying dependencies: +> * ``maven-gpg-plugin`` is declared as compile dependency +> * There is a [dependency for Java 7](https://www.threeten.org/threetenbp/) however the client is built for Java 8+ +> * ... +> +>
## Installation -[Installation guide for the latest release](https://github.com/xdev-software/openapi-client-maven-template/releases/latest#Installation) +[Installation guide for the latest release](https://github.com/xdev-software/brevo-java-client/releases/latest#Installation) ## Demo -A minimal demo is also available [here](./openapi-client-maven-template-demo/src/main/java/software/xdev/Application.java). +A minimal demo is also available [here](./brevo-java-client-demo/src/main/java/software/xdev/Application.java). ## Support If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). @@ -20,4 +41,6 @@ If you need support as soon as possible and you can't wait for any pull request, See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. ## Dependencies and Licenses -View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/openapi-client-maven-template/dependencies/) +View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/brevo-java-client/dependencies/) + +Disclaimer: This is not an official Brevo product and not associated with Brevo diff --git a/SECURITY.md b/SECURITY.md index 5c8df81..c15e549 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,4 +2,4 @@ ## Reporting a Vulnerability -Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/openapi-client-maven-template/security/advisories/new). +Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/brevo-java-client/security/advisories/new). diff --git a/openapi-client-maven-template-demo/pom.xml b/brevo-java-client-demo/pom.xml similarity index 96% rename from openapi-client-maven-template-demo/pom.xml rename to brevo-java-client-demo/pom.xml index d511190..b4e4625 100644 --- a/openapi-client-maven-template-demo/pom.xml +++ b/brevo-java-client-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - openapi-client-maven-template-demo + brevo-java-client-demo 1.0.0-SNAPSHOT jar @@ -31,7 +31,7 @@ software.xdev - openapi-client-maven-template + brevo-java-client ${project.version} diff --git a/brevo-java-client-demo/src/main/java/software/xdev/Application.java b/brevo-java-client-demo/src/main/java/software/xdev/Application.java new file mode 100644 index 0000000..c2d6383 --- /dev/null +++ b/brevo-java-client-demo/src/main/java/software/xdev/Application.java @@ -0,0 +1,107 @@ +package software.xdev; + +import java.util.List; +import java.util.Optional; +import java.util.Scanner; +import java.util.function.Function; + +import org.apache.hc.core5.http.HttpStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import software.xdev.brevo.api.ContactsApi; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.model.CreateContact; +import software.xdev.brevo.model.CreateUpdateContactModel; +import software.xdev.brevo.model.GetContactInfoIdentifierParameter; +import software.xdev.brevo.model.GetExtendedContactDetails; +import software.xdev.brevo.model.UpdateContact; + + +public final class Application +{ + private static final Logger LOG = LoggerFactory.getLogger(Application.class); + + // Tries to add an email/contact to a list + public static void main(final String[] args) + { + final ApiClient apiClient = new ApiClient(); + apiClient.setApiKey(getProperty("API-KEY", Function.identity())); + apiClient.setUserAgent("Brevo Java Client"); + + final long listId = getProperty("LIST-ID", Long::parseLong); + final String email = getProperty("EMAIL-FOR-LIST", Function.identity()); + + final ContactsApi contactsApi = new ContactsApi(apiClient); + try + { + final GetContactInfoIdentifierParameter identifier = + new GetContactInfoIdentifierStringParameter(email); + final GetExtendedContactDetails contactInfo = contactsApi.getContactInfo( + identifier, + null, + null); + LOG.info("Got contact[email={},listIds={}]", contactInfo.getEmail(), contactInfo.getListIds()); + if(!contactInfo.getListIds().contains(listId)) + { + contactsApi.updateContact(identifier, new UpdateContact().listIds(List.of(listId))); + LOG.info("Updated contact to include listId={}", listId); + } + } + catch(final ApiException ex) + { + if(ex.getCode() == HttpStatus.SC_NOT_FOUND) + { + final CreateUpdateContactModel createdContact = contactsApi.createContact(new CreateContact() + .email(email) + .listIds(List.of(listId))); + LOG.info("Created contact[id={}, email={},listIds={}]", createdContact.getId(), email, listId); + } + } + } + + private static T getProperty(final String identifier, final Function caster) + { + String value = Optional.ofNullable(System.getenv(identifier)) + .orElseGet(() -> System.getProperty(identifier)); + if(value == null) + { + LOG.error("Required {} not set in environment variables or system properties", identifier); + + LOG.info("Please provide {} over console:", identifier); + try(final Scanner scanner = new Scanner(System.in)) + { + value = scanner.nextLine(); + } + + if(value == null || value.isBlank()) + { + LOG.error("Invalid input; Aborting"); + System.exit(1); + } + } + return caster.apply(value); + } + + private Application() + { + } + + @SuppressWarnings("java:S2160") + public static class GetContactInfoIdentifierStringParameter extends GetContactInfoIdentifierParameter + { + private final String value; + + public GetContactInfoIdentifierStringParameter(final String value) + { + this.value = value; + } + + @Override + public String toString() + { + return this.value; + } + } +} diff --git a/brevo-java-client-demo/src/main/resources/log4j2.xml b/brevo-java-client-demo/src/main/resources/log4j2.xml new file mode 100644 index 0000000..f492456 --- /dev/null +++ b/brevo-java-client-demo/src/main/resources/log4j2.xml @@ -0,0 +1,20 @@ + + + + + + %d{HH:mm:ss} %-5p [%t] [%-25.25c] %m %n + + + + + + + + + + + + + + diff --git a/openapi-client-maven-template/pom.xml b/brevo-java-client/pom.xml similarity index 93% rename from openapi-client-maven-template/pom.xml rename to brevo-java-client/pom.xml index d4821de..07320cd 100644 --- a/openapi-client-maven-template/pom.xml +++ b/brevo-java-client/pom.xml @@ -5,20 +5,20 @@ 4.0.0 software.xdev - openapi-client-maven-template + brevo-java-client 1.0.0-SNAPSHOT jar - openapi-client-maven-template - openapi-client-maven-template - https://github.com/xdev-software/openapi-client-maven-template + brevo-java-client + brevo-java-client + https://github.com/xdev-software/brevo-java-client - https://github.com/xdev-software/openapi-client-maven-template - https://github.com/xdev-software/openapi-client-maven-template.git + https://github.com/xdev-software/brevo-java-client + https://github.com/xdev-software/brevo-java-client.git - 2023 + 2024 XDEV Software @@ -283,7 +283,7 @@ openapi-generator - INSERT_NAME_HERE + brevo ${project.basedir}/${generatedDirRelative} src/gen @@ -348,12 +348,12 @@ true true - - false - false - false - false + + false + false + false + false diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/AccountApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/AccountApi.java new file mode 100644 index 0000000..623f7e4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/AccountApi.java @@ -0,0 +1,202 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetAccount; +import software.xdev.brevo.model.GetAccountActivity; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AccountApi { + + + private ApiClient apiClient; + + public AccountApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccountApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get your account information, plan and credits details + * + * @return GetAccount + * @throws ApiException if fails to make API call + */ + public GetAccount getAccount() throws ApiException { + return this.getAccount(Collections.emptyMap()); + } + + + /** + * Get your account information, plan and credits details + * + * @param additionalHeaders additionalHeaders for this call + * @return GetAccount + * @throws ApiException if fails to make API call + */ + public GetAccount getAccount(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/account"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get user activity logs + * + * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional) + * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document in the page. (optional, default to 0) + * @return GetAccountActivity + * @throws ApiException if fails to make API call + */ + public GetAccountActivity getAccountActivity(String startDate, String endDate, Long limit, Long offset) throws ApiException { + return this.getAccountActivity(startDate, endDate, limit, offset, Collections.emptyMap()); + } + + + /** + * Get user activity logs + * + * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional) + * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document in the page. (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetAccountActivity + * @throws ApiException if fails to make API call + */ + public GetAccountActivity getAccountActivity(String startDate, String endDate, Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/organization/activities"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/CompaniesApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/CompaniesApi.java new file mode 100644 index 0000000..fdf85a4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/CompaniesApi.java @@ -0,0 +1,598 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CompaniesIdPatchRequest; +import software.xdev.brevo.model.CompaniesLinkUnlinkIdPatchRequest; +import software.xdev.brevo.model.CompaniesList; +import software.xdev.brevo.model.CompaniesPost200Response; +import software.xdev.brevo.model.CompaniesPostRequest; +import software.xdev.brevo.model.Company; +import software.xdev.brevo.model.CompanyAttributesInner; +import software.xdev.brevo.model.ErrorModel; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesApi { + + + private ApiClient apiClient; + + public CompaniesApi() { + this(Configuration.getDefaultApiClient()); + } + + public CompaniesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get company attributes + * + * @return List<CompanyAttributesInner> + * @throws ApiException if fails to make API call + */ + public List companiesAttributesGet() throws ApiException { + return this.companiesAttributesGet(Collections.emptyMap()); + } + + + /** + * Get company attributes + * + * @param additionalHeaders additionalHeaders for this call + * @return List<CompanyAttributesInner> + * @throws ApiException if fails to make API call + */ + public List companiesAttributesGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/companies/attributes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all Companies + * + * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional) + * @param linkedContactsIds Filter by linked contacts ids (optional) + * @param linkedDealsIds Filter by linked Deals ids (optional) + * @param page Index of the first document of the page (optional) + * @param limit Number of documents per page (optional) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param sortBy The field used to sort field names. (optional) + * @return CompaniesList + * @throws ApiException if fails to make API call + */ + public CompaniesList companiesGet(String filters, Long linkedContactsIds, String linkedDealsIds, Long page, Long limit, String sort, String sortBy) throws ApiException { + return this.companiesGet(filters, linkedContactsIds, linkedDealsIds, page, limit, sort, sortBy, Collections.emptyMap()); + } + + + /** + * Get all Companies + * + * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional) + * @param linkedContactsIds Filter by linked contacts ids (optional) + * @param linkedDealsIds Filter by linked Deals ids (optional) + * @param page Index of the first document of the page (optional) + * @param limit Number of documents per page (optional) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param sortBy The field used to sort field names. (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CompaniesList + * @throws ApiException if fails to make API call + */ + public CompaniesList companiesGet(String filters, Long linkedContactsIds, String linkedDealsIds, Long page, Long limit, String sort, String sortBy, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/companies"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("filters", filters)); + localVarQueryParams.addAll(apiClient.parameterToPair("linkedContactsIds", linkedContactsIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("linkedDealsIds", linkedDealsIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a company + * + * @param id Company ID to delete (required) + * @throws ApiException if fails to make API call + */ + public void companiesIdDelete(String id) throws ApiException { + this.companiesIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a company + * + * @param id Company ID to delete (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void companiesIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling companiesIdDelete"); + } + + // create path and map variables + String localVarPath = "/companies/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a company + * + * @param id Get Company Details (required) + * @return Company + * @throws ApiException if fails to make API call + */ + public Company companiesIdGet(String id) throws ApiException { + return this.companiesIdGet(id, Collections.emptyMap()); + } + + + /** + * Get a company + * + * @param id Get Company Details (required) + * @param additionalHeaders additionalHeaders for this call + * @return Company + * @throws ApiException if fails to make API call + */ + public Company companiesIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling companiesIdGet"); + } + + // create path and map variables + String localVarPath = "/companies/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a company + * + * @param id (required) + * @param companiesIdPatchRequest Updated company details. (required) + * @return Company + * @throws ApiException if fails to make API call + */ + public Company companiesIdPatch(String id, CompaniesIdPatchRequest companiesIdPatchRequest) throws ApiException { + return this.companiesIdPatch(id, companiesIdPatchRequest, Collections.emptyMap()); + } + + + /** + * Update a company + * + * @param id (required) + * @param companiesIdPatchRequest Updated company details. (required) + * @param additionalHeaders additionalHeaders for this call + * @return Company + * @throws ApiException if fails to make API call + */ + public Company companiesIdPatch(String id, CompaniesIdPatchRequest companiesIdPatchRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = companiesIdPatchRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling companiesIdPatch"); + } + + // verify the required parameter 'companiesIdPatchRequest' is set + if (companiesIdPatchRequest == null) { + throw new ApiException(400, "Missing the required parameter 'companiesIdPatchRequest' when calling companiesIdPatch"); + } + + // create path and map variables + String localVarPath = "/companies/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Link and Unlink company with contact and deal + * + * @param id (required) + * @param companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required) + * @throws ApiException if fails to make API call + */ + public void companiesLinkUnlinkIdPatch(String id, CompaniesLinkUnlinkIdPatchRequest companiesLinkUnlinkIdPatchRequest) throws ApiException { + this.companiesLinkUnlinkIdPatch(id, companiesLinkUnlinkIdPatchRequest, Collections.emptyMap()); + } + + + /** + * Link and Unlink company with contact and deal + * + * @param id (required) + * @param companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void companiesLinkUnlinkIdPatch(String id, CompaniesLinkUnlinkIdPatchRequest companiesLinkUnlinkIdPatchRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = companiesLinkUnlinkIdPatchRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling companiesLinkUnlinkIdPatch"); + } + + // verify the required parameter 'companiesLinkUnlinkIdPatchRequest' is set + if (companiesLinkUnlinkIdPatchRequest == null) { + throw new ApiException(400, "Missing the required parameter 'companiesLinkUnlinkIdPatchRequest' when calling companiesLinkUnlinkIdPatch"); + } + + // create path and map variables + String localVarPath = "/companies/link-unlink/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a company + * + * @param companiesPostRequest Company create data. (required) + * @return CompaniesPost200Response + * @throws ApiException if fails to make API call + */ + public CompaniesPost200Response companiesPost(CompaniesPostRequest companiesPostRequest) throws ApiException { + return this.companiesPost(companiesPostRequest, Collections.emptyMap()); + } + + + /** + * Create a company + * + * @param companiesPostRequest Company create data. (required) + * @param additionalHeaders additionalHeaders for this call + * @return CompaniesPost200Response + * @throws ApiException if fails to make API call + */ + public CompaniesPost200Response companiesPost(CompaniesPostRequest companiesPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = companiesPostRequest; + + // verify the required parameter 'companiesPostRequest' is set + if (companiesPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'companiesPostRequest' when calling companiesPost"); + } + + // create path and map variables + String localVarPath = "/companies"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/ContactsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ContactsApi.java new file mode 100644 index 0000000..86e30ad --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ContactsApi.java @@ -0,0 +1,2347 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.AddContactToListRequest; +import software.xdev.brevo.model.CreateAttribute; +import software.xdev.brevo.model.CreateContact; +import software.xdev.brevo.model.CreateDoiContact; +import software.xdev.brevo.model.CreateList; +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreateUpdateContactModel; +import software.xdev.brevo.model.CreateUpdateFolder; +import software.xdev.brevo.model.CreatedProcessId; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetAttributes; +import software.xdev.brevo.model.GetContactCampaignStats; +import software.xdev.brevo.model.GetContactInfoIdentifierParameter; +import software.xdev.brevo.model.GetContacts; +import software.xdev.brevo.model.GetExtendedContactDetails; +import software.xdev.brevo.model.GetExtendedList; +import software.xdev.brevo.model.GetFolder; +import software.xdev.brevo.model.GetFolderLists; +import software.xdev.brevo.model.GetFolders; +import software.xdev.brevo.model.GetLists; +import software.xdev.brevo.model.GetSegments; +import software.xdev.brevo.model.PostContactInfo; +import software.xdev.brevo.model.RemoveContactFromListRequest; +import software.xdev.brevo.model.RequestContactExport; +import software.xdev.brevo.model.RequestContactImport; +import software.xdev.brevo.model.UpdateAttribute; +import software.xdev.brevo.model.UpdateBatchContacts; +import software.xdev.brevo.model.UpdateContact; +import software.xdev.brevo.model.UpdateList; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContactsApi { + + + private ApiClient apiClient; + + public ContactsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ContactsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add existing contacts to a list + * + * @param listId Id of the list (required) + * @param addContactToListRequest Emails addresses OR IDs of the contacts (required) + * @return PostContactInfo + * @throws ApiException if fails to make API call + */ + public PostContactInfo addContactToList(Long listId, AddContactToListRequest addContactToListRequest) throws ApiException { + return this.addContactToList(listId, addContactToListRequest, Collections.emptyMap()); + } + + + /** + * Add existing contacts to a list + * + * @param listId Id of the list (required) + * @param addContactToListRequest Emails addresses OR IDs of the contacts (required) + * @param additionalHeaders additionalHeaders for this call + * @return PostContactInfo + * @throws ApiException if fails to make API call + */ + public PostContactInfo addContactToList(Long listId, AddContactToListRequest addContactToListRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = addContactToListRequest; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling addContactToList"); + } + + // verify the required parameter 'addContactToListRequest' is set + if (addContactToListRequest == null) { + throw new ApiException(400, "Missing the required parameter 'addContactToListRequest' when calling addContactToList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}/contacts/add" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create contact attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the attribute (required) + * @param createAttribute Values to create an attribute (required) + * @throws ApiException if fails to make API call + */ + public void createAttribute(String attributeCategory, String attributeName, CreateAttribute createAttribute) throws ApiException { + this.createAttribute(attributeCategory, attributeName, createAttribute, Collections.emptyMap()); + } + + + /** + * Create contact attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the attribute (required) + * @param createAttribute Values to create an attribute (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createAttribute(String attributeCategory, String attributeName, CreateAttribute createAttribute, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createAttribute; + + // verify the required parameter 'attributeCategory' is set + if (attributeCategory == null) { + throw new ApiException(400, "Missing the required parameter 'attributeCategory' when calling createAttribute"); + } + + // verify the required parameter 'attributeName' is set + if (attributeName == null) { + throw new ApiException(400, "Missing the required parameter 'attributeName' when calling createAttribute"); + } + + // verify the required parameter 'createAttribute' is set + if (createAttribute == null) { + throw new ApiException(400, "Missing the required parameter 'createAttribute' when calling createAttribute"); + } + + // create path and map variables + String localVarPath = "/contacts/attributes/{attributeCategory}/{attributeName}" + .replaceAll("\\{" + "attributeCategory" + "\\}", apiClient.escapeString(attributeCategory.toString())) + .replaceAll("\\{" + "attributeName" + "\\}", apiClient.escapeString(attributeName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a contact + * + * @param createContact Values to create a contact (required) + * @return CreateUpdateContactModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateContactModel createContact(CreateContact createContact) throws ApiException { + return this.createContact(createContact, Collections.emptyMap()); + } + + + /** + * Create a contact + * + * @param createContact Values to create a contact (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateUpdateContactModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateContactModel createContact(CreateContact createContact, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createContact; + + // verify the required parameter 'createContact' is set + if (createContact == null) { + throw new ApiException(400, "Missing the required parameter 'createContact' when calling createContact"); + } + + // create path and map variables + String localVarPath = "/contacts"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create Contact via DOI (Double-Opt-In) Flow + * + * @param createDoiContact Values to create the Double opt-in (DOI) contact (required) + * @throws ApiException if fails to make API call + */ + public void createDoiContact(CreateDoiContact createDoiContact) throws ApiException { + this.createDoiContact(createDoiContact, Collections.emptyMap()); + } + + + /** + * Create Contact via DOI (Double-Opt-In) Flow + * + * @param createDoiContact Values to create the Double opt-in (DOI) contact (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createDoiContact(CreateDoiContact createDoiContact, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createDoiContact; + + // verify the required parameter 'createDoiContact' is set + if (createDoiContact == null) { + throw new ApiException(400, "Missing the required parameter 'createDoiContact' when calling createDoiContact"); + } + + // create path and map variables + String localVarPath = "/contacts/doubleOptinConfirmation"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a folder + * + * @param createFolder Name of the folder (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createFolder(CreateUpdateFolder createFolder) throws ApiException { + return this.createFolder(createFolder, Collections.emptyMap()); + } + + + /** + * Create a folder + * + * @param createFolder Name of the folder (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createFolder(CreateUpdateFolder createFolder, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createFolder; + + // verify the required parameter 'createFolder' is set + if (createFolder == null) { + throw new ApiException(400, "Missing the required parameter 'createFolder' when calling createFolder"); + } + + // create path and map variables + String localVarPath = "/contacts/folders"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create a list + * + * @param createList Values to create a list (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createList(CreateList createList) throws ApiException { + return this.createList(createList, Collections.emptyMap()); + } + + + /** + * Create a list + * + * @param createList Values to create a list (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createList(CreateList createList, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createList; + + // verify the required parameter 'createList' is set + if (createList == null) { + throw new ApiException(400, "Missing the required parameter 'createList' when calling createList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete an attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the existing attribute (required) + * @throws ApiException if fails to make API call + */ + public void deleteAttribute(String attributeCategory, String attributeName) throws ApiException { + this.deleteAttribute(attributeCategory, attributeName, Collections.emptyMap()); + } + + + /** + * Delete an attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the existing attribute (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteAttribute(String attributeCategory, String attributeName, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'attributeCategory' is set + if (attributeCategory == null) { + throw new ApiException(400, "Missing the required parameter 'attributeCategory' when calling deleteAttribute"); + } + + // verify the required parameter 'attributeName' is set + if (attributeName == null) { + throw new ApiException(400, "Missing the required parameter 'attributeName' when calling deleteAttribute"); + } + + // create path and map variables + String localVarPath = "/contacts/attributes/{attributeCategory}/{attributeName}" + .replaceAll("\\{" + "attributeCategory" + "\\}", apiClient.escapeString(attributeCategory.toString())) + .replaceAll("\\{" + "attributeName" + "\\}", apiClient.escapeString(attributeName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @throws ApiException if fails to make API call + */ + public void deleteContact(GetContactInfoIdentifierParameter identifier) throws ApiException { + this.deleteContact(identifier, Collections.emptyMap()); + } + + + /** + * Delete a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteContact(GetContactInfoIdentifierParameter identifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling deleteContact"); + } + + // create path and map variables + String localVarPath = "/contacts/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a folder (and all its lists) + * + * @param folderId Id of the folder (required) + * @throws ApiException if fails to make API call + */ + public void deleteFolder(Long folderId) throws ApiException { + this.deleteFolder(folderId, Collections.emptyMap()); + } + + + /** + * Delete a folder (and all its lists) + * + * @param folderId Id of the folder (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteFolder(Long folderId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'folderId' is set + if (folderId == null) { + throw new ApiException(400, "Missing the required parameter 'folderId' when calling deleteFolder"); + } + + // create path and map variables + String localVarPath = "/contacts/folders/{folderId}" + .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a list + * + * @param listId Id of the list (required) + * @throws ApiException if fails to make API call + */ + public void deleteList(Long listId) throws ApiException { + this.deleteList(listId, Collections.emptyMap()); + } + + + /** + * Delete a list + * + * @param listId Id of the list (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteList(Long listId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling deleteList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * List all attributes + * + * @return GetAttributes + * @throws ApiException if fails to make API call + */ + public GetAttributes getAttributes() throws ApiException { + return this.getAttributes(Collections.emptyMap()); + } + + + /** + * List all attributes + * + * @param additionalHeaders additionalHeaders for this call + * @return GetAttributes + * @throws ApiException if fails to make API call + */ + public GetAttributes getAttributes(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/contacts/attributes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a contact's details + * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. + * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value (required) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) + * @return GetExtendedContactDetails + * @throws ApiException if fails to make API call + */ + public GetExtendedContactDetails getContactInfo(GetContactInfoIdentifierParameter identifier, String startDate, String endDate) throws ApiException { + return this.getContactInfo(identifier, startDate, endDate, Collections.emptyMap()); + } + + + /** + * Get a contact's details + * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. + * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value (required) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetExtendedContactDetails + * @throws ApiException if fails to make API call + */ + public GetExtendedContactDetails getContactInfo(GetContactInfoIdentifierParameter identifier, String startDate, String endDate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling getContactInfo"); + } + + // create path and map variables + String localVarPath = "/contacts/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get email campaigns' statistics for a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) + * @return GetContactCampaignStats + * @throws ApiException if fails to make API call + */ + public GetContactCampaignStats getContactStats(GetContactInfoIdentifierParameter identifier, String startDate, String endDate) throws ApiException { + return this.getContactStats(identifier, startDate, endDate, Collections.emptyMap()); + } + + + /** + * Get email campaigns' statistics for a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetContactCampaignStats + * @throws ApiException if fails to make API call + */ + public GetContactCampaignStats getContactStats(GetContactInfoIdentifierParameter identifier, String startDate, String endDate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling getContactStats"); + } + + // create path and map variables + String localVarPath = "/contacts/{identifier}/campaignStats" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all the contacts + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document of the page (optional, default to 0) + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional) + * @param listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional + * @return GetContacts + * @throws ApiException if fails to make API call + */ + public GetContacts getContacts(Long limit, Long offset, String modifiedSince, String createdSince, String sort, Long segmentId, List listIds) throws ApiException { + return this.getContacts(limit, offset, modifiedSince, createdSince, sort, segmentId, listIds, Collections.emptyMap()); + } + + + /** + * Get all the contacts + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document of the page (optional, default to 0) + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param segmentId Id of the segment. **Either listIds or segmentId can be passed.** (optional) + * @param listIds Ids of the list. **Either listIds or segmentId can be passed.** (optional + * @param additionalHeaders additionalHeaders for this call + * @return GetContacts + * @throws ApiException if fails to make API call + */ + public GetContacts getContacts(Long limit, Long offset, String modifiedSince, String createdSince, String sort, Long segmentId, List listIds, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/contacts"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("modifiedSince", modifiedSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("createdSince", createdSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("segmentId", segmentId)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "listIds", listIds)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get contacts in a list + * + * @param listId Id of the list (required) + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetContacts + * @throws ApiException if fails to make API call + */ + public GetContacts getContactsFromList(Long listId, String modifiedSince, Long limit, Long offset, String sort) throws ApiException { + return this.getContactsFromList(listId, modifiedSince, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get contacts in a list + * + * @param listId Id of the list (required) + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetContacts + * @throws ApiException if fails to make API call + */ + public GetContacts getContactsFromList(Long listId, String modifiedSince, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling getContactsFromList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}/contacts" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("modifiedSince", modifiedSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Returns a folder's details + * + * @param folderId id of the folder (required) + * @return GetFolder + * @throws ApiException if fails to make API call + */ + public GetFolder getFolder(Long folderId) throws ApiException { + return this.getFolder(folderId, Collections.emptyMap()); + } + + + /** + * Returns a folder's details + * + * @param folderId id of the folder (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetFolder + * @throws ApiException if fails to make API call + */ + public GetFolder getFolder(Long folderId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'folderId' is set + if (folderId == null) { + throw new ApiException(400, "Missing the required parameter 'folderId' when calling getFolder"); + } + + // create path and map variables + String localVarPath = "/contacts/folders/{folderId}" + .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get lists in a folder + * + * @param folderId Id of the folder (required) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetFolderLists + * @throws ApiException if fails to make API call + */ + public GetFolderLists getFolderLists(Long folderId, Long limit, Long offset, String sort) throws ApiException { + return this.getFolderLists(folderId, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get lists in a folder + * + * @param folderId Id of the folder (required) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetFolderLists + * @throws ApiException if fails to make API call + */ + public GetFolderLists getFolderLists(Long folderId, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'folderId' is set + if (folderId == null) { + throw new ApiException(400, "Missing the required parameter 'folderId' when calling getFolderLists"); + } + + // create path and map variables + String localVarPath = "/contacts/folders/{folderId}/lists" + .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all folders + * + * @param limit Number of documents per page (required) + * @param offset Index of the first document of the page (required) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetFolders + * @throws ApiException if fails to make API call + */ + public GetFolders getFolders(Long limit, Long offset, String sort) throws ApiException { + return this.getFolders(limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get all folders + * + * @param limit Number of documents per page (required) + * @param offset Index of the first document of the page (required) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetFolders + * @throws ApiException if fails to make API call + */ + public GetFolders getFolders(Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'limit' is set + if (limit == null) { + throw new ApiException(400, "Missing the required parameter 'limit' when calling getFolders"); + } + + // verify the required parameter 'offset' is set + if (offset == null) { + throw new ApiException(400, "Missing the required parameter 'offset' when calling getFolders"); + } + + // create path and map variables + String localVarPath = "/contacts/folders"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a list's details + * + * @param listId Id of the list (required) + * @param startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @return GetExtendedList + * @throws ApiException if fails to make API call + */ + public GetExtendedList getList(Long listId, String startDate, String endDate) throws ApiException { + return this.getList(listId, startDate, endDate, Collections.emptyMap()); + } + + + /** + * Get a list's details + * + * @param listId Id of the list (required) + * @param startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetExtendedList + * @throws ApiException if fails to make API call + */ + public GetExtendedList getList(Long listId, String startDate, String endDate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling getList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all the lists + * + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetLists + * @throws ApiException if fails to make API call + */ + public GetLists getLists(Long limit, Long offset, String sort) throws ApiException { + return this.getLists(limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get all the lists + * + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetLists + * @throws ApiException if fails to make API call + */ + public GetLists getLists(Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/contacts/lists"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all the segments + * + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetSegments + * @throws ApiException if fails to make API call + */ + public GetSegments getSegments(Long limit, Long offset, String sort) throws ApiException { + return this.getSegments(limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get all the segments + * + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document of the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetSegments + * @throws ApiException if fails to make API call + */ + public GetSegments getSegments(Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/contacts/segments"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Import contacts + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @param requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId importContacts(RequestContactImport requestContactImport) throws ApiException { + return this.importContacts(requestContactImport, Collections.emptyMap()); + } + + + /** + * Import contacts + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @param requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId importContacts(RequestContactImport requestContactImport, Map additionalHeaders) throws ApiException { + Object localVarPostBody = requestContactImport; + + // verify the required parameter 'requestContactImport' is set + if (requestContactImport == null) { + throw new ApiException(400, "Missing the required parameter 'requestContactImport' when calling importContacts"); + } + + // create path and map variables + String localVarPath = "/contacts/import"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a contact from a list + * + * @param listId Id of the list (required) + * @param contactEmails Emails adresses OR IDs of the contacts OR 'all' true (required) + * @return PostContactInfo + * @throws ApiException if fails to make API call + */ + public PostContactInfo removeContactFromList(Long listId, RemoveContactFromListRequest contactEmails) throws ApiException { + return this.removeContactFromList(listId, contactEmails, Collections.emptyMap()); + } + + + /** + * Delete a contact from a list + * + * @param listId Id of the list (required) + * @param contactEmails Emails adresses OR IDs of the contacts OR 'all' true (required) + * @param additionalHeaders additionalHeaders for this call + * @return PostContactInfo + * @throws ApiException if fails to make API call + */ + public PostContactInfo removeContactFromList(Long listId, RemoveContactFromListRequest contactEmails, Map additionalHeaders) throws ApiException { + Object localVarPostBody = contactEmails; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling removeContactFromList"); + } + + // verify the required parameter 'contactEmails' is set + if (contactEmails == null) { + throw new ApiException(400, "Missing the required parameter 'contactEmails' when calling removeContactFromList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}/contacts/remove" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Export contacts + * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. + * @param requestContactExport Values to request a contact export (required) + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId requestContactExport(RequestContactExport requestContactExport) throws ApiException { + return this.requestContactExport(requestContactExport, Collections.emptyMap()); + } + + + /** + * Export contacts + * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. + * @param requestContactExport Values to request a contact export (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId requestContactExport(RequestContactExport requestContactExport, Map additionalHeaders) throws ApiException { + Object localVarPostBody = requestContactExport; + + // verify the required parameter 'requestContactExport' is set + if (requestContactExport == null) { + throw new ApiException(400, "Missing the required parameter 'requestContactExport' when calling requestContactExport"); + } + + // create path and map variables + String localVarPath = "/contacts/export"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update contact attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the existing attribute (required) + * @param updateAttribute Values to update an attribute (required) + * @throws ApiException if fails to make API call + */ + public void updateAttribute(String attributeCategory, String attributeName, UpdateAttribute updateAttribute) throws ApiException { + this.updateAttribute(attributeCategory, attributeName, updateAttribute, Collections.emptyMap()); + } + + + /** + * Update contact attribute + * + * @param attributeCategory Category of the attribute (required) + * @param attributeName Name of the existing attribute (required) + * @param updateAttribute Values to update an attribute (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateAttribute(String attributeCategory, String attributeName, UpdateAttribute updateAttribute, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateAttribute; + + // verify the required parameter 'attributeCategory' is set + if (attributeCategory == null) { + throw new ApiException(400, "Missing the required parameter 'attributeCategory' when calling updateAttribute"); + } + + // verify the required parameter 'attributeName' is set + if (attributeName == null) { + throw new ApiException(400, "Missing the required parameter 'attributeName' when calling updateAttribute"); + } + + // verify the required parameter 'updateAttribute' is set + if (updateAttribute == null) { + throw new ApiException(400, "Missing the required parameter 'updateAttribute' when calling updateAttribute"); + } + + // create path and map variables + String localVarPath = "/contacts/attributes/{attributeCategory}/{attributeName}" + .replaceAll("\\{" + "attributeCategory" + "\\}", apiClient.escapeString(attributeCategory.toString())) + .replaceAll("\\{" + "attributeName" + "\\}", apiClient.escapeString(attributeName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update multiple contacts + * + * @param updateBatchContacts Values to update multiple contacts (required) + * @throws ApiException if fails to make API call + */ + public void updateBatchContacts(UpdateBatchContacts updateBatchContacts) throws ApiException { + this.updateBatchContacts(updateBatchContacts, Collections.emptyMap()); + } + + + /** + * Update multiple contacts + * + * @param updateBatchContacts Values to update multiple contacts (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateBatchContacts(UpdateBatchContacts updateBatchContacts, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateBatchContacts; + + // verify the required parameter 'updateBatchContacts' is set + if (updateBatchContacts == null) { + throw new ApiException(400, "Missing the required parameter 'updateBatchContacts' when calling updateBatchContacts"); + } + + // create path and map variables + String localVarPath = "/contacts/batch"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @param updateContact Values to update a contact (required) + * @throws ApiException if fails to make API call + */ + public void updateContact(GetContactInfoIdentifierParameter identifier, UpdateContact updateContact) throws ApiException { + this.updateContact(identifier, updateContact, Collections.emptyMap()); + } + + + /** + * Update a contact + * + * @param identifier Email (urlencoded) OR ID of the contact (required) + * @param updateContact Values to update a contact (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateContact(GetContactInfoIdentifierParameter identifier, UpdateContact updateContact, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateContact; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling updateContact"); + } + + // verify the required parameter 'updateContact' is set + if (updateContact == null) { + throw new ApiException(400, "Missing the required parameter 'updateContact' when calling updateContact"); + } + + // create path and map variables + String localVarPath = "/contacts/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update a folder + * + * @param folderId Id of the folder (required) + * @param updateFolder Name of the folder (required) + * @throws ApiException if fails to make API call + */ + public void updateFolder(Long folderId, CreateUpdateFolder updateFolder) throws ApiException { + this.updateFolder(folderId, updateFolder, Collections.emptyMap()); + } + + + /** + * Update a folder + * + * @param folderId Id of the folder (required) + * @param updateFolder Name of the folder (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateFolder(Long folderId, CreateUpdateFolder updateFolder, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateFolder; + + // verify the required parameter 'folderId' is set + if (folderId == null) { + throw new ApiException(400, "Missing the required parameter 'folderId' when calling updateFolder"); + } + + // verify the required parameter 'updateFolder' is set + if (updateFolder == null) { + throw new ApiException(400, "Missing the required parameter 'updateFolder' when calling updateFolder"); + } + + // create path and map variables + String localVarPath = "/contacts/folders/{folderId}" + .replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update a list + * + * @param listId Id of the list (required) + * @param updateList Values to update a list (required) + * @throws ApiException if fails to make API call + */ + public void updateList(Long listId, UpdateList updateList) throws ApiException { + this.updateList(listId, updateList, Collections.emptyMap()); + } + + + /** + * Update a list + * + * @param listId Id of the list (required) + * @param updateList Values to update a list (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateList(Long listId, UpdateList updateList, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateList; + + // verify the required parameter 'listId' is set + if (listId == null) { + throw new ApiException(400, "Missing the required parameter 'listId' when calling updateList"); + } + + // verify the required parameter 'updateList' is set + if (updateList == null) { + throw new ApiException(400, "Missing the required parameter 'updateList' when calling updateList"); + } + + // create path and map variables + String localVarPath = "/contacts/lists/{listId}" + .replaceAll("\\{" + "listId" + "\\}", apiClient.escapeString(listId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/ConversationsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ConversationsApi.java new file mode 100644 index 0000000..b5ebc24 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ConversationsApi.java @@ -0,0 +1,736 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ConversationsAgentOnlinePingPostRequest; +import software.xdev.brevo.model.ConversationsMessage; +import software.xdev.brevo.model.ConversationsMessagesIdPutRequest; +import software.xdev.brevo.model.ConversationsMessagesPostRequest; +import software.xdev.brevo.model.ConversationsPushedMessagesPostRequest; +import software.xdev.brevo.model.ErrorModel; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsApi { + + + private ApiClient apiClient; + + public ConversationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConversationsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Sets agent’s status to online for 2-3 minutes + * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + * @param conversationsAgentOnlinePingPostRequest (required) + * @throws ApiException if fails to make API call + */ + public void conversationsAgentOnlinePingPost(ConversationsAgentOnlinePingPostRequest conversationsAgentOnlinePingPostRequest) throws ApiException { + this.conversationsAgentOnlinePingPost(conversationsAgentOnlinePingPostRequest, Collections.emptyMap()); + } + + + /** + * Sets agent’s status to online for 2-3 minutes + * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + * @param conversationsAgentOnlinePingPostRequest (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void conversationsAgentOnlinePingPost(ConversationsAgentOnlinePingPostRequest conversationsAgentOnlinePingPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = conversationsAgentOnlinePingPostRequest; + + // verify the required parameter 'conversationsAgentOnlinePingPostRequest' is set + if (conversationsAgentOnlinePingPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'conversationsAgentOnlinePingPostRequest' when calling conversationsAgentOnlinePingPost"); + } + + // create path and map variables + String localVarPath = "/conversations/agentOnlinePing"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a message sent by an agent + * Only agents’ messages can be deleted. + * @param id ID of the message (required) + * @throws ApiException if fails to make API call + */ + public void conversationsMessagesIdDelete(String id) throws ApiException { + this.conversationsMessagesIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a message sent by an agent + * Only agents’ messages can be deleted. + * @param id ID of the message (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void conversationsMessagesIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsMessagesIdDelete"); + } + + // create path and map variables + String localVarPath = "/conversations/messages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a message + * + * @param id ID of the message (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesIdGet(String id) throws ApiException { + return this.conversationsMessagesIdGet(id, Collections.emptyMap()); + } + + + /** + * Get a message + * + * @param id ID of the message (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsMessagesIdGet"); + } + + // create path and map variables + String localVarPath = "/conversations/messages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a message sent by an agent + * Only agents’ messages can be edited. + * @param id ID of the message (required) + * @param conversationsMessagesIdPutRequest (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesIdPut(String id, ConversationsMessagesIdPutRequest conversationsMessagesIdPutRequest) throws ApiException { + return this.conversationsMessagesIdPut(id, conversationsMessagesIdPutRequest, Collections.emptyMap()); + } + + + /** + * Update a message sent by an agent + * Only agents’ messages can be edited. + * @param id ID of the message (required) + * @param conversationsMessagesIdPutRequest (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesIdPut(String id, ConversationsMessagesIdPutRequest conversationsMessagesIdPutRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = conversationsMessagesIdPutRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsMessagesIdPut"); + } + + // verify the required parameter 'conversationsMessagesIdPutRequest' is set + if (conversationsMessagesIdPutRequest == null) { + throw new ApiException(400, "Missing the required parameter 'conversationsMessagesIdPutRequest' when calling conversationsMessagesIdPut"); + } + + // create path and map variables + String localVarPath = "/conversations/messages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send a message as an agent + * + * @param conversationsMessagesPostRequest (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesPost(ConversationsMessagesPostRequest conversationsMessagesPostRequest) throws ApiException { + return this.conversationsMessagesPost(conversationsMessagesPostRequest, Collections.emptyMap()); + } + + + /** + * Send a message as an agent + * + * @param conversationsMessagesPostRequest (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsMessagesPost(ConversationsMessagesPostRequest conversationsMessagesPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = conversationsMessagesPostRequest; + + // verify the required parameter 'conversationsMessagesPostRequest' is set + if (conversationsMessagesPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'conversationsMessagesPostRequest' when calling conversationsMessagesPost"); + } + + // create path and map variables + String localVarPath = "/conversations/messages"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete an automated message + * + * @param id ID of the message (required) + * @throws ApiException if fails to make API call + */ + public void conversationsPushedMessagesIdDelete(String id) throws ApiException { + this.conversationsPushedMessagesIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete an automated message + * + * @param id ID of the message (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void conversationsPushedMessagesIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsPushedMessagesIdDelete"); + } + + // create path and map variables + String localVarPath = "/conversations/pushedMessages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get an automated message + * + * @param id ID of the message sent previously (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesIdGet(String id) throws ApiException { + return this.conversationsPushedMessagesIdGet(id, Collections.emptyMap()); + } + + + /** + * Get an automated message + * + * @param id ID of the message sent previously (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsPushedMessagesIdGet"); + } + + // create path and map variables + String localVarPath = "/conversations/pushedMessages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update an automated message + * + * @param id ID of the message (required) + * @param conversationsMessagesIdPutRequest (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesIdPut(String id, ConversationsMessagesIdPutRequest conversationsMessagesIdPutRequest) throws ApiException { + return this.conversationsPushedMessagesIdPut(id, conversationsMessagesIdPutRequest, Collections.emptyMap()); + } + + + /** + * Update an automated message + * + * @param id ID of the message (required) + * @param conversationsMessagesIdPutRequest (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesIdPut(String id, ConversationsMessagesIdPutRequest conversationsMessagesIdPutRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = conversationsMessagesIdPutRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling conversationsPushedMessagesIdPut"); + } + + // verify the required parameter 'conversationsMessagesIdPutRequest' is set + if (conversationsMessagesIdPutRequest == null) { + throw new ApiException(400, "Missing the required parameter 'conversationsMessagesIdPutRequest' when calling conversationsPushedMessagesIdPut"); + } + + // create path and map variables + String localVarPath = "/conversations/pushedMessages/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send an automated message to a visitor + * Example of automated messages: order status, announce new features in your web app, etc. + * @param conversationsPushedMessagesPostRequest (required) + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesPost(ConversationsPushedMessagesPostRequest conversationsPushedMessagesPostRequest) throws ApiException { + return this.conversationsPushedMessagesPost(conversationsPushedMessagesPostRequest, Collections.emptyMap()); + } + + + /** + * Send an automated message to a visitor + * Example of automated messages: order status, announce new features in your web app, etc. + * @param conversationsPushedMessagesPostRequest (required) + * @param additionalHeaders additionalHeaders for this call + * @return ConversationsMessage + * @throws ApiException if fails to make API call + */ + public ConversationsMessage conversationsPushedMessagesPost(ConversationsPushedMessagesPostRequest conversationsPushedMessagesPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = conversationsPushedMessagesPostRequest; + + // verify the required parameter 'conversationsPushedMessagesPostRequest' is set + if (conversationsPushedMessagesPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'conversationsPushedMessagesPostRequest' when calling conversationsPushedMessagesPost"); + } + + // create path and map variables + String localVarPath = "/conversations/pushedMessages"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/CouponsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/CouponsApi.java new file mode 100644 index 0000000..d1bccc8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/CouponsApi.java @@ -0,0 +1,438 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateCouponCollection201Response; +import software.xdev.brevo.model.CreateCouponCollectionRequest; +import software.xdev.brevo.model.CreateCouponsRequest; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetCouponCollection; +import software.xdev.brevo.model.UpdateCouponCollection200Response; +import software.xdev.brevo.model.UpdateCouponCollectionRequest; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CouponsApi { + + + private ApiClient apiClient; + + public CouponsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CouponsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create а coupon collection + * + * @param createCouponCollectionRequest Values to create a coupon collection (required) + * @return CreateCouponCollection201Response + * @throws ApiException if fails to make API call + */ + public CreateCouponCollection201Response createCouponCollection(CreateCouponCollectionRequest createCouponCollectionRequest) throws ApiException { + return this.createCouponCollection(createCouponCollectionRequest, Collections.emptyMap()); + } + + + /** + * Create а coupon collection + * + * @param createCouponCollectionRequest Values to create a coupon collection (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateCouponCollection201Response + * @throws ApiException if fails to make API call + */ + public CreateCouponCollection201Response createCouponCollection(CreateCouponCollectionRequest createCouponCollectionRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createCouponCollectionRequest; + + // verify the required parameter 'createCouponCollectionRequest' is set + if (createCouponCollectionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'createCouponCollectionRequest' when calling createCouponCollection"); + } + + // create path and map variables + String localVarPath = "/couponCollections"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create coupons for a coupon collection + * + * @param createCouponsRequest Values to create coupons (required) + * @throws ApiException if fails to make API call + */ + public void createCoupons(CreateCouponsRequest createCouponsRequest) throws ApiException { + this.createCoupons(createCouponsRequest, Collections.emptyMap()); + } + + + /** + * Create coupons for a coupon collection + * + * @param createCouponsRequest Values to create coupons (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createCoupons(CreateCouponsRequest createCouponsRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createCouponsRequest; + + // verify the required parameter 'createCouponsRequest' is set + if (createCouponsRequest == null) { + throw new ApiException(400, "Missing the required parameter 'createCouponsRequest' when calling createCoupons"); + } + + // create path and map variables + String localVarPath = "/coupons"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a coupon collection by id + * + * @param id Id of the collection to return (required) + * @return GetCouponCollection + * @throws ApiException if fails to make API call + */ + public GetCouponCollection getCouponCollection(String id) throws ApiException { + return this.getCouponCollection(id, Collections.emptyMap()); + } + + + /** + * Get a coupon collection by id + * + * @param id Id of the collection to return (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetCouponCollection + * @throws ApiException if fails to make API call + */ + public GetCouponCollection getCouponCollection(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getCouponCollection"); + } + + // create path and map variables + String localVarPath = "/couponCollections/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all your coupon collections + * + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document on the page (optional, default to 0) + * @param sort Sort the results by creation time in ascending/descending order (optional, default to desc) + * @return GetCouponCollection + * @throws ApiException if fails to make API call + */ + public GetCouponCollection getCouponCollections(Long limit, Long offset, String sort) throws ApiException { + return this.getCouponCollections(limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get all your coupon collections + * + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document on the page (optional, default to 0) + * @param sort Sort the results by creation time in ascending/descending order (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetCouponCollection + * @throws ApiException if fails to make API call + */ + public GetCouponCollection getCouponCollections(Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/couponCollections"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a coupon collection by id + * + * @param id Id of the collection to update (required) + * @param updateCouponCollectionRequest Values to update the coupon collection (required) + * @return UpdateCouponCollection200Response + * @throws ApiException if fails to make API call + */ + public UpdateCouponCollection200Response updateCouponCollection(String id, UpdateCouponCollectionRequest updateCouponCollectionRequest) throws ApiException { + return this.updateCouponCollection(id, updateCouponCollectionRequest, Collections.emptyMap()); + } + + + /** + * Update a coupon collection by id + * + * @param id Id of the collection to update (required) + * @param updateCouponCollectionRequest Values to update the coupon collection (required) + * @param additionalHeaders additionalHeaders for this call + * @return UpdateCouponCollection200Response + * @throws ApiException if fails to make API call + */ + public UpdateCouponCollection200Response updateCouponCollection(String id, UpdateCouponCollectionRequest updateCouponCollectionRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateCouponCollectionRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling updateCouponCollection"); + } + + // verify the required parameter 'updateCouponCollectionRequest' is set + if (updateCouponCollectionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'updateCouponCollectionRequest' when calling updateCouponCollection"); + } + + // create path and map variables + String localVarPath = "/couponCollections/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/DealsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/DealsApi.java new file mode 100644 index 0000000..9c5b78b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/DealsApi.java @@ -0,0 +1,806 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CrmDealsIdPatchRequest; +import software.xdev.brevo.model.CrmDealsLinkUnlinkIdPatchRequest; +import software.xdev.brevo.model.CrmDealsPost201Response; +import software.xdev.brevo.model.CrmDealsPostRequest; +import software.xdev.brevo.model.Deal; +import software.xdev.brevo.model.DealAttributesInner; +import software.xdev.brevo.model.DealsList; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.Pipeline; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DealsApi { + + + private ApiClient apiClient; + + public DealsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DealsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get deal attributes + * + * @return List<DealAttributesInner> + * @throws ApiException if fails to make API call + */ + public List crmAttributesDealsGet() throws ApiException { + return this.crmAttributesDealsGet(Collections.emptyMap()); + } + + + /** + * Get deal attributes + * + * @param additionalHeaders additionalHeaders for this call + * @return List<DealAttributesInner> + * @throws ApiException if fails to make API call + */ + public List crmAttributesDealsGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/attributes/deals"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all deals + * + * @param filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`. (optional) + * @param filtersLinkedCompaniesIds Filter by linked companies ids (optional) + * @param filtersLinkedContactsIds Filter by linked companies ids (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @return DealsList + * @throws ApiException if fails to make API call + */ + public DealsList crmDealsGet(String filtersAttributesDealName, String filtersLinkedCompaniesIds, String filtersLinkedContactsIds, Long offset, Long limit, String sort) throws ApiException { + return this.crmDealsGet(filtersAttributesDealName, filtersLinkedCompaniesIds, filtersLinkedContactsIds, offset, limit, sort, Collections.emptyMap()); + } + + + /** + * Get all deals + * + * @param filtersAttributesDealName Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`. (optional) + * @param filtersLinkedCompaniesIds Filter by linked companies ids (optional) + * @param filtersLinkedContactsIds Filter by linked companies ids (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param additionalHeaders additionalHeaders for this call + * @return DealsList + * @throws ApiException if fails to make API call + */ + public DealsList crmDealsGet(String filtersAttributesDealName, String filtersLinkedCompaniesIds, String filtersLinkedContactsIds, Long offset, Long limit, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/deals"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("filters[attributes.deal_name]", filtersAttributesDealName)); + localVarQueryParams.addAll(apiClient.parameterToPair("filters[linkedCompaniesIds]", filtersLinkedCompaniesIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("filters[linkedContactsIds]", filtersLinkedContactsIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a deal + * + * @param id (required) + * @throws ApiException if fails to make API call + */ + public void crmDealsIdDelete(String id) throws ApiException { + this.crmDealsIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a deal + * + * @param id (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmDealsIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmDealsIdDelete"); + } + + // create path and map variables + String localVarPath = "/crm/deals/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a deal + * + * @param id (required) + * @return Deal + * @throws ApiException if fails to make API call + */ + public Deal crmDealsIdGet(String id) throws ApiException { + return this.crmDealsIdGet(id, Collections.emptyMap()); + } + + + /** + * Get a deal + * + * @param id (required) + * @param additionalHeaders additionalHeaders for this call + * @return Deal + * @throws ApiException if fails to make API call + */ + public Deal crmDealsIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmDealsIdGet"); + } + + // create path and map variables + String localVarPath = "/crm/deals/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a deal + * + * @param id (required) + * @param crmDealsIdPatchRequest Updated deal details. (required) + * @throws ApiException if fails to make API call + */ + public void crmDealsIdPatch(String id, CrmDealsIdPatchRequest crmDealsIdPatchRequest) throws ApiException { + this.crmDealsIdPatch(id, crmDealsIdPatchRequest, Collections.emptyMap()); + } + + + /** + * Update a deal + * + * @param id (required) + * @param crmDealsIdPatchRequest Updated deal details. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmDealsIdPatch(String id, CrmDealsIdPatchRequest crmDealsIdPatchRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = crmDealsIdPatchRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmDealsIdPatch"); + } + + // verify the required parameter 'crmDealsIdPatchRequest' is set + if (crmDealsIdPatchRequest == null) { + throw new ApiException(400, "Missing the required parameter 'crmDealsIdPatchRequest' when calling crmDealsIdPatch"); + } + + // create path and map variables + String localVarPath = "/crm/deals/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Link and Unlink a deal with contacts and companies + * + * @param id (required) + * @param crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required) + * @throws ApiException if fails to make API call + */ + public void crmDealsLinkUnlinkIdPatch(String id, CrmDealsLinkUnlinkIdPatchRequest crmDealsLinkUnlinkIdPatchRequest) throws ApiException { + this.crmDealsLinkUnlinkIdPatch(id, crmDealsLinkUnlinkIdPatchRequest, Collections.emptyMap()); + } + + + /** + * Link and Unlink a deal with contacts and companies + * + * @param id (required) + * @param crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmDealsLinkUnlinkIdPatch(String id, CrmDealsLinkUnlinkIdPatchRequest crmDealsLinkUnlinkIdPatchRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = crmDealsLinkUnlinkIdPatchRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmDealsLinkUnlinkIdPatch"); + } + + // verify the required parameter 'crmDealsLinkUnlinkIdPatchRequest' is set + if (crmDealsLinkUnlinkIdPatchRequest == null) { + throw new ApiException(400, "Missing the required parameter 'crmDealsLinkUnlinkIdPatchRequest' when calling crmDealsLinkUnlinkIdPatch"); + } + + // create path and map variables + String localVarPath = "/crm/deals/link-unlink/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a deal + * + * @param crmDealsPostRequest Deal create data. (required) + * @return CrmDealsPost201Response + * @throws ApiException if fails to make API call + */ + public CrmDealsPost201Response crmDealsPost(CrmDealsPostRequest crmDealsPostRequest) throws ApiException { + return this.crmDealsPost(crmDealsPostRequest, Collections.emptyMap()); + } + + + /** + * Create a deal + * + * @param crmDealsPostRequest Deal create data. (required) + * @param additionalHeaders additionalHeaders for this call + * @return CrmDealsPost201Response + * @throws ApiException if fails to make API call + */ + public CrmDealsPost201Response crmDealsPost(CrmDealsPostRequest crmDealsPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = crmDealsPostRequest; + + // verify the required parameter 'crmDealsPostRequest' is set + if (crmDealsPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'crmDealsPostRequest' when calling crmDealsPost"); + } + + // create path and map variables + String localVarPath = "/crm/deals"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all pipelines + * + * @return List<Pipeline> + * @throws ApiException if fails to make API call + */ + public List crmPipelineDetailsAllGet() throws ApiException { + return this.crmPipelineDetailsAllGet(Collections.emptyMap()); + } + + + /** + * Get all pipelines + * + * @param additionalHeaders additionalHeaders for this call + * @return List<Pipeline> + * @throws ApiException if fails to make API call + */ + public List crmPipelineDetailsAllGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/pipeline/details/all"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get pipeline stages + * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. + * @return Pipeline + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public Pipeline crmPipelineDetailsGet() throws ApiException { + return this.crmPipelineDetailsGet(Collections.emptyMap()); + } + + + /** + * Get pipeline stages + * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. + * @param additionalHeaders additionalHeaders for this call + * @return Pipeline + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public Pipeline crmPipelineDetailsGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/pipeline/details"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a pipeline + * + * @param pipelineID (required) + * @return List<Pipeline> + * @throws ApiException if fails to make API call + */ + public List crmPipelineDetailsPipelineIDGet(String pipelineID) throws ApiException { + return this.crmPipelineDetailsPipelineIDGet(pipelineID, Collections.emptyMap()); + } + + + /** + * Get a pipeline + * + * @param pipelineID (required) + * @param additionalHeaders additionalHeaders for this call + * @return List<Pipeline> + * @throws ApiException if fails to make API call + */ + public List crmPipelineDetailsPipelineIDGet(String pipelineID, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipelineID' is set + if (pipelineID == null) { + throw new ApiException(400, "Missing the required parameter 'pipelineID' when calling crmPipelineDetailsPipelineIDGet"); + } + + // create path and map variables + String localVarPath = "/crm/pipeline/details/{pipelineID}" + .replaceAll("\\{" + "pipelineID" + "\\}", apiClient.escapeString(pipelineID.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/DomainsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/DomainsApi.java new file mode 100644 index 0000000..6cc98d2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/DomainsApi.java @@ -0,0 +1,417 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.AuthenticateDomainModel; +import software.xdev.brevo.model.CreateDomain; +import software.xdev.brevo.model.CreateDomainModel; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetDomainConfigurationModel; +import software.xdev.brevo.model.GetDomainsList; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DomainsApi { + + + private ApiClient apiClient; + + public DomainsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DomainsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Authenticate a domain + * + * @param domainName Domain name (required) + * @return AuthenticateDomainModel + * @throws ApiException if fails to make API call + */ + public AuthenticateDomainModel authenticateDomain(String domainName) throws ApiException { + return this.authenticateDomain(domainName, Collections.emptyMap()); + } + + + /** + * Authenticate a domain + * + * @param domainName Domain name (required) + * @param additionalHeaders additionalHeaders for this call + * @return AuthenticateDomainModel + * @throws ApiException if fails to make API call + */ + public AuthenticateDomainModel authenticateDomain(String domainName, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException(400, "Missing the required parameter 'domainName' when calling authenticateDomain"); + } + + // create path and map variables + String localVarPath = "/senders/domains/{domainName}/authenticate" + .replaceAll("\\{" + "domainName" + "\\}", apiClient.escapeString(domainName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create a new domain + * + * @param domain domain's name (optional) + * @return CreateDomainModel + * @throws ApiException if fails to make API call + */ + public CreateDomainModel createDomain(CreateDomain domain) throws ApiException { + return this.createDomain(domain, Collections.emptyMap()); + } + + + /** + * Create a new domain + * + * @param domain domain's name (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreateDomainModel + * @throws ApiException if fails to make API call + */ + public CreateDomainModel createDomain(CreateDomain domain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = domain; + + // create path and map variables + String localVarPath = "/senders/domains"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a domain + * + * @param domainName Domain name (required) + * @throws ApiException if fails to make API call + */ + public void deleteDomain(String domainName) throws ApiException { + this.deleteDomain(domainName, Collections.emptyMap()); + } + + + /** + * Delete a domain + * + * @param domainName Domain name (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteDomain(String domainName, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException(400, "Missing the required parameter 'domainName' when calling deleteDomain"); + } + + // create path and map variables + String localVarPath = "/senders/domains/{domainName}" + .replaceAll("\\{" + "domainName" + "\\}", apiClient.escapeString(domainName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Validate domain configuration + * + * @param domainName Domain name (required) + * @return GetDomainConfigurationModel + * @throws ApiException if fails to make API call + */ + public GetDomainConfigurationModel getDomainConfiguration(String domainName) throws ApiException { + return this.getDomainConfiguration(domainName, Collections.emptyMap()); + } + + + /** + * Validate domain configuration + * + * @param domainName Domain name (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetDomainConfigurationModel + * @throws ApiException if fails to make API call + */ + public GetDomainConfigurationModel getDomainConfiguration(String domainName, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException(400, "Missing the required parameter 'domainName' when calling getDomainConfiguration"); + } + + // create path and map variables + String localVarPath = "/senders/domains/{domainName}" + .replaceAll("\\{" + "domainName" + "\\}", apiClient.escapeString(domainName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all your domains + * + * @return GetDomainsList + * @throws ApiException if fails to make API call + */ + public GetDomainsList getDomains() throws ApiException { + return this.getDomains(Collections.emptyMap()); + } + + + /** + * Get the list of all your domains + * + * @param additionalHeaders additionalHeaders for this call + * @return GetDomainsList + * @throws ApiException if fails to make API call + */ + public GetDomainsList getDomains(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/senders/domains"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/EcommerceApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/EcommerceApi.java new file mode 100644 index 0000000..6b0342b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/EcommerceApi.java @@ -0,0 +1,1001 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import java.math.BigDecimal; +import software.xdev.brevo.model.CreateCategoryModel; +import software.xdev.brevo.model.CreateProductModel; +import software.xdev.brevo.model.CreateUpdateBatchCategory; +import software.xdev.brevo.model.CreateUpdateBatchCategoryModel; +import software.xdev.brevo.model.CreateUpdateBatchProducts; +import software.xdev.brevo.model.CreateUpdateBatchProductsModel; +import software.xdev.brevo.model.CreateUpdateCategory; +import software.xdev.brevo.model.CreateUpdateProduct; +import software.xdev.brevo.model.CreatedBatchId; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetCategories; +import software.xdev.brevo.model.GetCategoryDetails; +import software.xdev.brevo.model.GetProductDetails; +import software.xdev.brevo.model.GetProducts; +import software.xdev.brevo.model.Order; +import software.xdev.brevo.model.OrderBatch; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EcommerceApi { + + + private ApiClient apiClient; + + public EcommerceApi() { + this(Configuration.getDefaultApiClient()); + } + + public EcommerceApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create orders in batch + * Create multiple orders at one time instead of one order at a time + * @param orderBatch (required) + * @return CreatedBatchId + * @throws ApiException if fails to make API call + */ + public CreatedBatchId createBatchOrder(OrderBatch orderBatch) throws ApiException { + return this.createBatchOrder(orderBatch, Collections.emptyMap()); + } + + + /** + * Create orders in batch + * Create multiple orders at one time instead of one order at a time + * @param orderBatch (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedBatchId + * @throws ApiException if fails to make API call + */ + public CreatedBatchId createBatchOrder(OrderBatch orderBatch, Map additionalHeaders) throws ApiException { + Object localVarPostBody = orderBatch; + + // verify the required parameter 'orderBatch' is set + if (orderBatch == null) { + throw new ApiException(400, "Missing the required parameter 'orderBatch' when calling createBatchOrder"); + } + + // create path and map variables + String localVarPath = "/orders/status/batch"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Managing the status of the order + * Manages the transactional status of the order + * @param order (required) + * @throws ApiException if fails to make API call + */ + public void createOrder(Order order) throws ApiException { + this.createOrder(order, Collections.emptyMap()); + } + + + /** + * Managing the status of the order + * Manages the transactional status of the order + * @param order (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createOrder(Order order, Map additionalHeaders) throws ApiException { + Object localVarPostBody = order; + + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling createOrder"); + } + + // create path and map variables + String localVarPath = "/orders/status"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create categories in batch + * + * @param createUpdateBatchCategory Values to create a batch of categories (required) + * @return CreateUpdateBatchCategoryModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateBatchCategoryModel createUpdateBatchCategory(CreateUpdateBatchCategory createUpdateBatchCategory) throws ApiException { + return this.createUpdateBatchCategory(createUpdateBatchCategory, Collections.emptyMap()); + } + + + /** + * Create categories in batch + * + * @param createUpdateBatchCategory Values to create a batch of categories (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateUpdateBatchCategoryModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateBatchCategoryModel createUpdateBatchCategory(CreateUpdateBatchCategory createUpdateBatchCategory, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createUpdateBatchCategory; + + // verify the required parameter 'createUpdateBatchCategory' is set + if (createUpdateBatchCategory == null) { + throw new ApiException(400, "Missing the required parameter 'createUpdateBatchCategory' when calling createUpdateBatchCategory"); + } + + // create path and map variables + String localVarPath = "/categories/batch"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create products in batch + * + * @param createUpdateBatchProducts Values to create a batch of products (required) + * @return CreateUpdateBatchProductsModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateBatchProductsModel createUpdateBatchProducts(CreateUpdateBatchProducts createUpdateBatchProducts) throws ApiException { + return this.createUpdateBatchProducts(createUpdateBatchProducts, Collections.emptyMap()); + } + + + /** + * Create products in batch + * + * @param createUpdateBatchProducts Values to create a batch of products (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateUpdateBatchProductsModel + * @throws ApiException if fails to make API call + */ + public CreateUpdateBatchProductsModel createUpdateBatchProducts(CreateUpdateBatchProducts createUpdateBatchProducts, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createUpdateBatchProducts; + + // verify the required parameter 'createUpdateBatchProducts' is set + if (createUpdateBatchProducts == null) { + throw new ApiException(400, "Missing the required parameter 'createUpdateBatchProducts' when calling createUpdateBatchProducts"); + } + + // create path and map variables + String localVarPath = "/products/batch"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create/Update a category + * + * @param createUpdateCategory Values to create/update a category (required) + * @return CreateCategoryModel + * @throws ApiException if fails to make API call + */ + public CreateCategoryModel createUpdateCategory(CreateUpdateCategory createUpdateCategory) throws ApiException { + return this.createUpdateCategory(createUpdateCategory, Collections.emptyMap()); + } + + + /** + * Create/Update a category + * + * @param createUpdateCategory Values to create/update a category (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateCategoryModel + * @throws ApiException if fails to make API call + */ + public CreateCategoryModel createUpdateCategory(CreateUpdateCategory createUpdateCategory, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createUpdateCategory; + + // verify the required parameter 'createUpdateCategory' is set + if (createUpdateCategory == null) { + throw new ApiException(400, "Missing the required parameter 'createUpdateCategory' when calling createUpdateCategory"); + } + + // create path and map variables + String localVarPath = "/categories"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create/Update a product + * + * @param createUpdateProduct Values to create/update a product (required) + * @return CreateProductModel + * @throws ApiException if fails to make API call + */ + public CreateProductModel createUpdateProduct(CreateUpdateProduct createUpdateProduct) throws ApiException { + return this.createUpdateProduct(createUpdateProduct, Collections.emptyMap()); + } + + + /** + * Create/Update a product + * + * @param createUpdateProduct Values to create/update a product (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateProductModel + * @throws ApiException if fails to make API call + */ + public CreateProductModel createUpdateProduct(CreateUpdateProduct createUpdateProduct, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createUpdateProduct; + + // verify the required parameter 'createUpdateProduct' is set + if (createUpdateProduct == null) { + throw new ApiException(400, "Missing the required parameter 'createUpdateProduct' when calling createUpdateProduct"); + } + + // create path and map variables + String localVarPath = "/products"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Activate the eCommerce app + * Getting access to Brevo eCommerce. + * @throws ApiException if fails to make API call + */ + public void ecommerceActivatePost() throws ApiException { + this.ecommerceActivatePost(Collections.emptyMap()); + } + + + /** + * Activate the eCommerce app + * Getting access to Brevo eCommerce. + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void ecommerceActivatePost(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/ecommerce/activate"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Return all your categories + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param ids Filter by category ids (optional + * @param name Filter by category name (optional) + * @param modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @return GetCategories + * @throws ApiException if fails to make API call + */ + public GetCategories getCategories(Long limit, Long offset, String sort, List ids, String name, String modifiedSince, String createdSince) throws ApiException { + return this.getCategories(limit, offset, sort, ids, name, modifiedSince, createdSince, Collections.emptyMap()); + } + + + /** + * Return all your categories + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param ids Filter by category ids (optional + * @param name Filter by category name (optional) + * @param modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetCategories + * @throws ApiException if fails to make API call + */ + public GetCategories getCategories(Long limit, Long offset, String sort, List ids, String name, String modifiedSince, String createdSince, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/categories"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(apiClient.parameterToPair("modifiedSince", modifiedSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("createdSince", createdSince)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a category details + * + * @param id Category ID (required) + * @return GetCategoryDetails + * @throws ApiException if fails to make API call + */ + public GetCategoryDetails getCategoryInfo(String id) throws ApiException { + return this.getCategoryInfo(id, Collections.emptyMap()); + } + + + /** + * Get a category details + * + * @param id Category ID (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetCategoryDetails + * @throws ApiException if fails to make API call + */ + public GetCategoryDetails getCategoryInfo(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getCategoryInfo"); + } + + // create path and map variables + String localVarPath = "/categories/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get order details + * Get all the orders + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @throws ApiException if fails to make API call + */ + public void getOrders(Long limit, Long offset, String sort, String modifiedSince, String createdSince) throws ApiException { + this.getOrders(limit, offset, sort, modifiedSince, createdSince, Collections.emptyMap()); + } + + + /** + * Get order details + * Get all the orders + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void getOrders(Long limit, Long offset, String sort, String modifiedSince, String createdSince, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/orders"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("modifiedSince", modifiedSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("createdSince", createdSince)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a product's details + * + * @param id Product ID (required) + * @return GetProductDetails + * @throws ApiException if fails to make API call + */ + public GetProductDetails getProductInfo(String id) throws ApiException { + return this.getProductInfo(id, Collections.emptyMap()); + } + + + /** + * Get a product's details + * + * @param id Product ID (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetProductDetails + * @throws ApiException if fails to make API call + */ + public GetProductDetails getProductInfo(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getProductInfo"); + } + + // create path and map variables + String localVarPath = "/products/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Return all your products + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param ids Filter by product ids (optional + * @param name Filter by product name, minimum 3 characters should be present for search (optional) + * @param priceLte Price filter for products less than and equals to particular amount (optional) + * @param priceGte Price filter for products greater than and equals to particular amount (optional) + * @param priceLt Price filter for products less than particular amount (optional) + * @param priceGt Price filter for products greater than particular amount (optional) + * @param priceEq Price filter for products equals to particular amount (optional) + * @param priceNe Price filter for products not equals to particular amount (optional) + * @param categories Filter by product categories (optional + * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @return GetProducts + * @throws ApiException if fails to make API call + */ + public GetProducts getProducts(Long limit, Long offset, String sort, List ids, String name, BigDecimal priceLte, BigDecimal priceGte, BigDecimal priceLt, BigDecimal priceGt, BigDecimal priceEq, BigDecimal priceNe, List categories, String modifiedSince, String createdSince) throws ApiException { + return this.getProducts(limit, offset, sort, ids, name, priceLte, priceGte, priceLt, priceGt, priceEq, priceNe, categories, modifiedSince, createdSince, Collections.emptyMap()); + } + + + /** + * Return all your products + * + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param ids Filter by product ids (optional + * @param name Filter by product name, minimum 3 characters should be present for search (optional) + * @param priceLte Price filter for products less than and equals to particular amount (optional) + * @param priceGte Price filter for products greater than and equals to particular amount (optional) + * @param priceLt Price filter for products less than particular amount (optional) + * @param priceGt Price filter for products greater than particular amount (optional) + * @param priceEq Price filter for products equals to particular amount (optional) + * @param priceNe Price filter for products not equals to particular amount (optional) + * @param categories Filter by product categories (optional + * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetProducts + * @throws ApiException if fails to make API call + */ + public GetProducts getProducts(Long limit, Long offset, String sort, List ids, String name, BigDecimal priceLte, BigDecimal priceGte, BigDecimal priceLt, BigDecimal priceGt, BigDecimal priceEq, BigDecimal priceNe, List categories, String modifiedSince, String createdSince, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/products"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "ids", ids)); + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[lte]", priceLte)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[gte]", priceGte)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[lt]", priceLt)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[gt]", priceGt)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[eq]", priceEq)); + localVarQueryParams.addAll(apiClient.parameterToPair("price[ne]", priceNe)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "categories", categories)); + localVarQueryParams.addAll(apiClient.parameterToPair("modifiedSince", modifiedSince)); + localVarQueryParams.addAll(apiClient.parameterToPair("createdSince", createdSince)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/EmailCampaignsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/EmailCampaignsApi.java new file mode 100644 index 0000000..42d0b01 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/EmailCampaignsApi.java @@ -0,0 +1,1076 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.AbTestCampaignResult; +import software.xdev.brevo.model.CreateEmailCampaign; +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreatedProcessId; +import software.xdev.brevo.model.EmailExportRecipients; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetEmailCampaign; +import software.xdev.brevo.model.GetEmailCampaigns; +import software.xdev.brevo.model.GetSharedTemplateUrl; +import software.xdev.brevo.model.PostSendFailed; +import software.xdev.brevo.model.SendReport; +import software.xdev.brevo.model.SendTestEmail; +import software.xdev.brevo.model.UpdateCampaignStatus; +import software.xdev.brevo.model.UpdateEmailCampaign; +import software.xdev.brevo.model.UploadImageModel; +import software.xdev.brevo.model.UploadImageToGallery; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailCampaignsApi { + + + private ApiClient apiClient; + + public EmailCampaignsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmailCampaignsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create an email campaign + * + * @param createEmailCampaign Values to create a campaign (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createEmailCampaign(CreateEmailCampaign createEmailCampaign) throws ApiException { + return this.createEmailCampaign(createEmailCampaign, Collections.emptyMap()); + } + + + /** + * Create an email campaign + * + * @param createEmailCampaign Values to create a campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createEmailCampaign(CreateEmailCampaign createEmailCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createEmailCampaign; + + // verify the required parameter 'createEmailCampaign' is set + if (createEmailCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'createEmailCampaign' when calling createEmailCampaign"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete an email campaign + * + * @param campaignId id of the campaign (required) + * @throws ApiException if fails to make API call + */ + public void deleteEmailCampaign(Long campaignId) throws ApiException { + this.deleteEmailCampaign(campaignId, Collections.emptyMap()); + } + + + /** + * Delete an email campaign + * + * @param campaignId id of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteEmailCampaign(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling deleteEmailCampaign"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Export the recipients of an email campaign + * + * @param campaignId Id of the campaign (required) + * @param emailExportRecipients Values to send for a recipient export request (optional) + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId emailExportRecipients(Long campaignId, EmailExportRecipients emailExportRecipients) throws ApiException { + return this.emailExportRecipients(campaignId, emailExportRecipients, Collections.emptyMap()); + } + + + /** + * Export the recipients of an email campaign + * + * @param campaignId Id of the campaign (required) + * @param emailExportRecipients Values to send for a recipient export request (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId emailExportRecipients(Long campaignId, EmailExportRecipients emailExportRecipients, Map additionalHeaders) throws ApiException { + Object localVarPostBody = emailExportRecipients; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling emailExportRecipients"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/exportRecipients" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get an A/B test email campaign results + * Obtain winning version of an A/B test email campaign + * @param campaignId Id of the A/B test campaign (required) + * @return AbTestCampaignResult + * @throws ApiException if fails to make API call + */ + public AbTestCampaignResult getAbTestCampaignResult(Long campaignId) throws ApiException { + return this.getAbTestCampaignResult(campaignId, Collections.emptyMap()); + } + + + /** + * Get an A/B test email campaign results + * Obtain winning version of an A/B test email campaign + * @param campaignId Id of the A/B test campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return AbTestCampaignResult + * @throws ApiException if fails to make API call + */ + public AbTestCampaignResult getAbTestCampaignResult(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling getAbTestCampaignResult"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/abTestCampaignResult" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get an email campaign report + * + * @param campaignId Id of the campaign (required) + * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) + * @return GetEmailCampaign + * @throws ApiException if fails to make API call + */ + public GetEmailCampaign getEmailCampaign(Long campaignId, String statistics) throws ApiException { + return this.getEmailCampaign(campaignId, statistics, Collections.emptyMap()); + } + + + /** + * Get an email campaign report + * + * @param campaignId Id of the campaign (required) + * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetEmailCampaign + * @throws ApiException if fails to make API call + */ + public GetEmailCampaign getEmailCampaign(Long campaignId, String statistics, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling getEmailCampaign"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("statistics", statistics)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Return all your created email campaigns + * + * @param type Filter on the type of the campaigns (optional) + * @param status Filter on the status of the campaign (optional) + * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional) + * @return GetEmailCampaigns + * @throws ApiException if fails to make API call + */ + public GetEmailCampaigns getEmailCampaigns(String type, String status, String statistics, String startDate, String endDate, Long limit, Long offset, String sort, Boolean excludeHtmlContent) throws ApiException { + return this.getEmailCampaigns(type, status, statistics, startDate, endDate, limit, offset, sort, excludeHtmlContent, Collections.emptyMap()); + } + + + /** + * Return all your created email campaigns + * + * @param type Filter on the type of the campaigns (optional) + * @param status Filter on the status of the campaign (optional) + * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. (optional) + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetEmailCampaigns + * @throws ApiException if fails to make API call + */ + public GetEmailCampaigns getEmailCampaigns(String type, String status, String statistics, String startDate, String endDate, Long limit, Long offset, String sort, Boolean excludeHtmlContent, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/emailCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); + localVarQueryParams.addAll(apiClient.parameterToPair("statistics", statistics)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("excludeHtmlContent", excludeHtmlContent)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a shared template url + * Get a unique URL to share & import an email template from one Brevo account to another. + * @param campaignId Id of the campaign or template (required) + * @return GetSharedTemplateUrl + * @throws ApiException if fails to make API call + */ + public GetSharedTemplateUrl getSharedTemplateUrl(Long campaignId) throws ApiException { + return this.getSharedTemplateUrl(campaignId, Collections.emptyMap()); + } + + + /** + * Get a shared template url + * Get a unique URL to share & import an email template from one Brevo account to another. + * @param campaignId Id of the campaign or template (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetSharedTemplateUrl + * @throws ApiException if fails to make API call + */ + public GetSharedTemplateUrl getSharedTemplateUrl(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling getSharedTemplateUrl"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/sharedUrl" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send an email campaign immediately, based on campaignId + * + * @param campaignId Id of the campaign (required) + * @throws ApiException if fails to make API call + */ + public void sendEmailCampaignNow(Long campaignId) throws ApiException { + this.sendEmailCampaignNow(campaignId, Collections.emptyMap()); + } + + + /** + * Send an email campaign immediately, based on campaignId + * + * @param campaignId Id of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendEmailCampaignNow(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendEmailCampaignNow"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/sendNow" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Send the report of a campaign + * A PDF will be sent to the specified email addresses + * @param campaignId Id of the campaign (required) + * @param sendReport Values for send a report (required) + * @throws ApiException if fails to make API call + */ + public void sendReport(Long campaignId, SendReport sendReport) throws ApiException { + this.sendReport(campaignId, sendReport, Collections.emptyMap()); + } + + + /** + * Send the report of a campaign + * A PDF will be sent to the specified email addresses + * @param campaignId Id of the campaign (required) + * @param sendReport Values for send a report (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendReport(Long campaignId, SendReport sendReport, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendReport; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendReport"); + } + + // verify the required parameter 'sendReport' is set + if (sendReport == null) { + throw new ApiException(400, "Missing the required parameter 'sendReport' when calling sendReport"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/sendReport" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Send an email campaign to your test list + * + * @param campaignId Id of the campaign (required) + * @param sendTestEmail (required) + * @throws ApiException if fails to make API call + */ + public void sendTestEmail(Long campaignId, SendTestEmail sendTestEmail) throws ApiException { + this.sendTestEmail(campaignId, sendTestEmail, Collections.emptyMap()); + } + + + /** + * Send an email campaign to your test list + * + * @param campaignId Id of the campaign (required) + * @param sendTestEmail (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendTestEmail(Long campaignId, SendTestEmail sendTestEmail, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendTestEmail; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendTestEmail"); + } + + // verify the required parameter 'sendTestEmail' is set + if (sendTestEmail == null) { + throw new ApiException(400, "Missing the required parameter 'sendTestEmail' when calling sendTestEmail"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/sendTest" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update an email campaign status + * + * @param campaignId Id of the campaign (required) + * @param updateCampaignStatus Status of the campaign (required) + * @throws ApiException if fails to make API call + */ + public void updateCampaignStatus(Long campaignId, UpdateCampaignStatus updateCampaignStatus) throws ApiException { + this.updateCampaignStatus(campaignId, updateCampaignStatus, Collections.emptyMap()); + } + + + /** + * Update an email campaign status + * + * @param campaignId Id of the campaign (required) + * @param updateCampaignStatus Status of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateCampaignStatus(Long campaignId, UpdateCampaignStatus updateCampaignStatus, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateCampaignStatus; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling updateCampaignStatus"); + } + + // verify the required parameter 'updateCampaignStatus' is set + if (updateCampaignStatus == null) { + throw new ApiException(400, "Missing the required parameter 'updateCampaignStatus' when calling updateCampaignStatus"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}/status" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update an email campaign + * + * @param campaignId Id of the campaign (required) + * @param updateEmailCampaign Values to update a campaign (required) + * @throws ApiException if fails to make API call + */ + public void updateEmailCampaign(Long campaignId, UpdateEmailCampaign updateEmailCampaign) throws ApiException { + this.updateEmailCampaign(campaignId, updateEmailCampaign, Collections.emptyMap()); + } + + + /** + * Update an email campaign + * + * @param campaignId Id of the campaign (required) + * @param updateEmailCampaign Values to update a campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateEmailCampaign(Long campaignId, UpdateEmailCampaign updateEmailCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateEmailCampaign; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling updateEmailCampaign"); + } + + // verify the required parameter 'updateEmailCampaign' is set + if (updateEmailCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'updateEmailCampaign' when calling updateEmailCampaign"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Upload an image to your account's image gallery + * + * @param uploadImageToGallery Parameters to upload an image (required) + * @return UploadImageModel + * @throws ApiException if fails to make API call + */ + public UploadImageModel uploadImageToGallery(UploadImageToGallery uploadImageToGallery) throws ApiException { + return this.uploadImageToGallery(uploadImageToGallery, Collections.emptyMap()); + } + + + /** + * Upload an image to your account's image gallery + * + * @param uploadImageToGallery Parameters to upload an image (required) + * @param additionalHeaders additionalHeaders for this call + * @return UploadImageModel + * @throws ApiException if fails to make API call + */ + public UploadImageModel uploadImageToGallery(UploadImageToGallery uploadImageToGallery, Map additionalHeaders) throws ApiException { + Object localVarPostBody = uploadImageToGallery; + + // verify the required parameter 'uploadImageToGallery' is set + if (uploadImageToGallery == null) { + throw new ApiException(400, "Missing the required parameter 'uploadImageToGallery' when calling uploadImageToGallery"); + } + + // create path and map variables + String localVarPath = "/emailCampaigns/images"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/ExternalFeedsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ExternalFeedsApi.java new file mode 100644 index 0000000..f55227a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ExternalFeedsApi.java @@ -0,0 +1,448 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateExternalFeed; +import software.xdev.brevo.model.CreateExternalFeed201Response; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetAllExternalFeeds; +import software.xdev.brevo.model.GetExternalFeedByUUID; +import java.time.LocalDate; +import software.xdev.brevo.model.UpdateExternalFeed; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ExternalFeedsApi { + + + private ApiClient apiClient; + + public ExternalFeedsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ExternalFeedsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create an external feed + * This endpoint will create an external feed. + * @param createExternalFeed Values to create a feed (required) + * @return CreateExternalFeed201Response + * @throws ApiException if fails to make API call + */ + public CreateExternalFeed201Response createExternalFeed(CreateExternalFeed createExternalFeed) throws ApiException { + return this.createExternalFeed(createExternalFeed, Collections.emptyMap()); + } + + + /** + * Create an external feed + * This endpoint will create an external feed. + * @param createExternalFeed Values to create a feed (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateExternalFeed201Response + * @throws ApiException if fails to make API call + */ + public CreateExternalFeed201Response createExternalFeed(CreateExternalFeed createExternalFeed, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createExternalFeed; + + // verify the required parameter 'createExternalFeed' is set + if (createExternalFeed == null) { + throw new ApiException(400, "Missing the required parameter 'createExternalFeed' when calling createExternalFeed"); + } + + // create path and map variables + String localVarPath = "/feeds"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete an external feed + * This endpoint will delete an external feed. + * @param uuid UUID of the feed to delete (required) + * @throws ApiException if fails to make API call + */ + public void deleteExternalFeed(String uuid) throws ApiException { + this.deleteExternalFeed(uuid, Collections.emptyMap()); + } + + + /** + * Delete an external feed + * This endpoint will delete an external feed. + * @param uuid UUID of the feed to delete (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteExternalFeed(String uuid, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling deleteExternalFeed"); + } + + // create path and map variables + String localVarPath = "/feeds/{uuid}" + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Fetch all external feeds + * This endpoint can fetch all created external feeds. + * @param search Can be used to filter records by search keyword on feed name (optional) + * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional) + * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc) + * @param authType Filter the records by `authType` of the feed. (optional) + * @param limit Number of documents returned per page. (optional, default to 50) + * @param offset Index of the first document on the page. (optional, default to 0) + * @return GetAllExternalFeeds + * @throws ApiException if fails to make API call + */ + public GetAllExternalFeeds getAllExternalFeeds(String search, LocalDate startDate, LocalDate endDate, String sort, String authType, Long limit, Long offset) throws ApiException { + return this.getAllExternalFeeds(search, startDate, endDate, sort, authType, limit, offset, Collections.emptyMap()); + } + + + /** + * Fetch all external feeds + * This endpoint can fetch all created external feeds. + * @param search Can be used to filter records by search keyword on feed name (optional) + * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. (optional) + * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. (optional, default to desc) + * @param authType Filter the records by `authType` of the feed. (optional) + * @param limit Number of documents returned per page. (optional, default to 50) + * @param offset Index of the first document on the page. (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetAllExternalFeeds + * @throws ApiException if fails to make API call + */ + public GetAllExternalFeeds getAllExternalFeeds(String search, LocalDate startDate, LocalDate endDate, String sort, String authType, Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/feeds"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("search", search)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("authType", authType)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get an external feed by UUID + * This endpoint will update an external feed. + * @param uuid UUID of the feed to fetch (required) + * @return GetExternalFeedByUUID + * @throws ApiException if fails to make API call + */ + public GetExternalFeedByUUID getExternalFeedByUUID(String uuid) throws ApiException { + return this.getExternalFeedByUUID(uuid, Collections.emptyMap()); + } + + + /** + * Get an external feed by UUID + * This endpoint will update an external feed. + * @param uuid UUID of the feed to fetch (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetExternalFeedByUUID + * @throws ApiException if fails to make API call + */ + public GetExternalFeedByUUID getExternalFeedByUUID(String uuid, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling getExternalFeedByUUID"); + } + + // create path and map variables + String localVarPath = "/feeds/{uuid}" + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update an external feed + * This endpoint will update an external feed. + * @param uuid UUID of the feed to update (required) + * @param updateExternalFeed Values to update a feed (required) + * @throws ApiException if fails to make API call + */ + public void updateExternalFeed(String uuid, UpdateExternalFeed updateExternalFeed) throws ApiException { + this.updateExternalFeed(uuid, updateExternalFeed, Collections.emptyMap()); + } + + + /** + * Update an external feed + * This endpoint will update an external feed. + * @param uuid UUID of the feed to update (required) + * @param updateExternalFeed Values to update a feed (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateExternalFeed(String uuid, UpdateExternalFeed updateExternalFeed, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateExternalFeed; + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling updateExternalFeed"); + } + + // verify the required parameter 'updateExternalFeed' is set + if (updateExternalFeed == null) { + throw new ApiException(400, "Missing the required parameter 'updateExternalFeed' when calling updateExternalFeed"); + } + + // create path and map variables + String localVarPath = "/feeds/{uuid}" + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/FilesApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/FilesApi.java new file mode 100644 index 0000000..1175313 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/FilesApi.java @@ -0,0 +1,455 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import java.io.File; +import software.xdev.brevo.model.FileData; +import software.xdev.brevo.model.FileDownloadableLink; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FilesApi { + + + private ApiClient apiClient; + + public FilesApi() { + this(Configuration.getDefaultApiClient()); + } + + public FilesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get all files + * + * @param entity Filter by file entity type (optional) + * @param entityIds Filter by file entity IDs (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @return List<FileData> + * @throws ApiException if fails to make API call + */ + public List crmFilesGet(String entity, String entityIds, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort) throws ApiException { + return this.crmFilesGet(entity, entityIds, dateFrom, dateTo, offset, limit, sort, Collections.emptyMap()); + } + + + /** + * Get all files + * + * @param entity Filter by file entity type (optional) + * @param entityIds Filter by file entity IDs (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param additionalHeaders additionalHeaders for this call + * @return List<FileData> + * @throws ApiException if fails to make API call + */ + public List crmFilesGet(String entity, String entityIds, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/files"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("entity", entity)); + localVarQueryParams.addAll(apiClient.parameterToPair("entityIds", entityIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateFrom", dateFrom)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateTo", dateTo)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get file details + * + * @param id File id to get file data. (required) + * @return FileData + * @throws ApiException if fails to make API call + */ + public FileData crmFilesIdDataGet(String id) throws ApiException { + return this.crmFilesIdDataGet(id, Collections.emptyMap()); + } + + + /** + * Get file details + * + * @param id File id to get file data. (required) + * @param additionalHeaders additionalHeaders for this call + * @return FileData + * @throws ApiException if fails to make API call + */ + public FileData crmFilesIdDataGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmFilesIdDataGet"); + } + + // create path and map variables + String localVarPath = "/crm/files/{id}/data" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a file + * + * @param id File id to delete. (required) + * @throws ApiException if fails to make API call + */ + public void crmFilesIdDelete(String id) throws ApiException { + this.crmFilesIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a file + * + * @param id File id to delete. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmFilesIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmFilesIdDelete"); + } + + // create path and map variables + String localVarPath = "/crm/files/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Download a file + * + * @param id File id to download. (required) + * @return FileDownloadableLink + * @throws ApiException if fails to make API call + */ + public FileDownloadableLink crmFilesIdGet(String id) throws ApiException { + return this.crmFilesIdGet(id, Collections.emptyMap()); + } + + + /** + * Download a file + * + * @param id File id to download. (required) + * @param additionalHeaders additionalHeaders for this call + * @return FileDownloadableLink + * @throws ApiException if fails to make API call + */ + public FileDownloadableLink crmFilesIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmFilesIdGet"); + } + + // create path and map variables + String localVarPath = "/crm/files/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Upload a file + * + * @param _file File data to create a file. (required) + * @param dealId (optional) + * @param contactId (optional) + * @param companyId (optional) + * @return FileData + * @throws ApiException if fails to make API call + */ + public FileData crmFilesPost(File _file, String dealId, Long contactId, String companyId) throws ApiException { + return this.crmFilesPost(_file, dealId, contactId, companyId, Collections.emptyMap()); + } + + + /** + * Upload a file + * + * @param _file File data to create a file. (required) + * @param dealId (optional) + * @param contactId (optional) + * @param companyId (optional) + * @param additionalHeaders additionalHeaders for this call + * @return FileData + * @throws ApiException if fails to make API call + */ + public FileData crmFilesPost(File _file, String dealId, Long contactId, String companyId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException(400, "Missing the required parameter '_file' when calling crmFilesPost"); + } + + // create path and map variables + String localVarPath = "/crm/files"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + if (_file != null) + localVarFormParams.put("file", _file); +if (dealId != null) + localVarFormParams.put("dealId", dealId); +if (contactId != null) + localVarFormParams.put("contactId", contactId); +if (companyId != null) + localVarFormParams.put("companyId", companyId); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/InboundParsingApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/InboundParsingApi.java new file mode 100644 index 0000000..298383f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/InboundParsingApi.java @@ -0,0 +1,292 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import java.io.File; +import software.xdev.brevo.model.GetInboundEmailEvents; +import software.xdev.brevo.model.GetInboundEmailEventsByUuid; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InboundParsingApi { + + + private ApiClient apiClient; + + public InboundParsingApi() { + this(Configuration.getDefaultApiClient()); + } + + public InboundParsingApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Retrieve inbound attachment with download token. + * This endpoint will retrieve inbound attachment with download token. + * @param downloadToken Token to fetch a particular attachment (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getInboundEmailAttachment(String downloadToken) throws ApiException { + return this.getInboundEmailAttachment(downloadToken, Collections.emptyMap()); + } + + + /** + * Retrieve inbound attachment with download token. + * This endpoint will retrieve inbound attachment with download token. + * @param downloadToken Token to fetch a particular attachment (required) + * @param additionalHeaders additionalHeaders for this call + * @return File + * @throws ApiException if fails to make API call + */ + public File getInboundEmailAttachment(String downloadToken, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'downloadToken' is set + if (downloadToken == null) { + throw new ApiException(400, "Missing the required parameter 'downloadToken' when calling getInboundEmailAttachment"); + } + + // create path and map variables + String localVarPath = "/inbound/attachments/{downloadToken}" + .replaceAll("\\{" + "downloadToken" + "\\}", apiClient.escapeString(downloadToken.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/octet-stream", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all the events for the received emails. + * This endpoint will show the list of all the events for the received emails. + * @param sender Email address of the sender. (optional) + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents returned per page (optional, default to 100) + * @param offset Index of the first document on the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation (optional, default to desc) + * @return GetInboundEmailEvents + * @throws ApiException if fails to make API call + */ + public GetInboundEmailEvents getInboundEmailEvents(String sender, String startDate, String endDate, Long limit, Long offset, String sort) throws ApiException { + return this.getInboundEmailEvents(sender, startDate, endDate, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get the list of all the events for the received emails. + * This endpoint will show the list of all the events for the received emails. + * @param sender Email address of the sender. (optional) + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents returned per page (optional, default to 100) + * @param offset Index of the first document on the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetInboundEmailEvents + * @throws ApiException if fails to make API call + */ + public GetInboundEmailEvents getInboundEmailEvents(String sender, String startDate, String endDate, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/inbound/events"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("sender", sender)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Fetch all events history for one particular received email. + * This endpoint will show the list of all events history for one particular received email. + * @param uuid UUID to fetch events specific to recieved email (required) + * @return GetInboundEmailEventsByUuid + * @throws ApiException if fails to make API call + */ + public GetInboundEmailEventsByUuid getInboundEmailEventsByUuid(String uuid) throws ApiException { + return this.getInboundEmailEventsByUuid(uuid, Collections.emptyMap()); + } + + + /** + * Fetch all events history for one particular received email. + * This endpoint will show the list of all events history for one particular received email. + * @param uuid UUID to fetch events specific to recieved email (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetInboundEmailEventsByUuid + * @throws ApiException if fails to make API call + */ + public GetInboundEmailEventsByUuid getInboundEmailEventsByUuid(String uuid, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling getInboundEmailEventsByUuid"); + } + + // create path and map variables + String localVarPath = "/inbound/events/{uuid}" + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/MasterAccountApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/MasterAccountApi.java new file mode 100644 index 0000000..d1f750e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/MasterAccountApi.java @@ -0,0 +1,1558 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CorporateGroupDetailsResponse; +import software.xdev.brevo.model.CorporateGroupIdPutRequest; +import software.xdev.brevo.model.CorporateGroupPost201Response; +import software.xdev.brevo.model.CorporateGroupPostRequest; +import software.xdev.brevo.model.CorporateGroupUnlinkGroupIdSubAccountsPutRequest; +import software.xdev.brevo.model.CorporateSubAccountKeyPostRequest; +import software.xdev.brevo.model.CorporateSubAccountSsoTokenPostRequest; +import software.xdev.brevo.model.CorporateUserInvitationActionEmailPut200Response; +import software.xdev.brevo.model.CreateApiKeyResponse; +import software.xdev.brevo.model.CreateSubAccount; +import software.xdev.brevo.model.CreateSubAccountResponse; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetAccountActivity; +import software.xdev.brevo.model.GetCorporateInvitedUsersList; +import software.xdev.brevo.model.GetSsoToken; +import software.xdev.brevo.model.GetSubAccountGroups200ResponseInner; +import software.xdev.brevo.model.InviteAdminUser; +import software.xdev.brevo.model.MasterDetailsResponse; +import software.xdev.brevo.model.SubAccountAppsToggleRequest; +import software.xdev.brevo.model.SubAccountDetailsResponse; +import software.xdev.brevo.model.SubAccountUpdatePlanRequest; +import software.xdev.brevo.model.SubAccountsResponse; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterAccountApi { + + + private ApiClient apiClient; + + public MasterAccountApi() { + this(Configuration.getDefaultApiClient()); + } + + public MasterAccountApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete a group + * This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted. + * @param id Id of the group (required) + * @throws ApiException if fails to make API call + */ + public void corporateGroupIdDelete(String id) throws ApiException { + this.corporateGroupIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a group + * This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted. + * @param id Id of the group (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateGroupIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateGroupIdDelete"); + } + + // create path and map variables + String localVarPath = "/corporate/group/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * GET a group details + * This endpoint allows you to retrieve a specific group’s information such as the list of sub-organizations and the user associated with the group. + * @param id Id of the group of sub-organization (required) + * @return CorporateGroupDetailsResponse + * @throws ApiException if fails to make API call + */ + public CorporateGroupDetailsResponse corporateGroupIdGet(String id) throws ApiException { + return this.corporateGroupIdGet(id, Collections.emptyMap()); + } + + + /** + * GET a group details + * This endpoint allows you to retrieve a specific group’s information such as the list of sub-organizations and the user associated with the group. + * @param id Id of the group of sub-organization (required) + * @param additionalHeaders additionalHeaders for this call + * @return CorporateGroupDetailsResponse + * @throws ApiException if fails to make API call + */ + public CorporateGroupDetailsResponse corporateGroupIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateGroupIdGet"); + } + + // create path and map variables + String localVarPath = "/corporate/group/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a group of sub-accounts + * This endpoint allows to update a group of sub-accounts + * @param id Id of the group (required) + * @param corporateGroupIdPutRequest Group details to be updated. (required) + * @throws ApiException if fails to make API call + */ + public void corporateGroupIdPut(String id, CorporateGroupIdPutRequest corporateGroupIdPutRequest) throws ApiException { + this.corporateGroupIdPut(id, corporateGroupIdPutRequest, Collections.emptyMap()); + } + + + /** + * Update a group of sub-accounts + * This endpoint allows to update a group of sub-accounts + * @param id Id of the group (required) + * @param corporateGroupIdPutRequest Group details to be updated. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateGroupIdPut(String id, CorporateGroupIdPutRequest corporateGroupIdPutRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = corporateGroupIdPutRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateGroupIdPut"); + } + + // verify the required parameter 'corporateGroupIdPutRequest' is set + if (corporateGroupIdPutRequest == null) { + throw new ApiException(400, "Missing the required parameter 'corporateGroupIdPutRequest' when calling corporateGroupIdPut"); + } + + // create path and map variables + String localVarPath = "/corporate/group/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a group of sub-accounts + * This endpoint allows to create a group of sub-accounts + * @param corporateGroupPostRequest (optional) + * @return CorporateGroupPost201Response + * @throws ApiException if fails to make API call + */ + public CorporateGroupPost201Response corporateGroupPost(CorporateGroupPostRequest corporateGroupPostRequest) throws ApiException { + return this.corporateGroupPost(corporateGroupPostRequest, Collections.emptyMap()); + } + + + /** + * Create a group of sub-accounts + * This endpoint allows to create a group of sub-accounts + * @param corporateGroupPostRequest (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CorporateGroupPost201Response + * @throws ApiException if fails to make API call + */ + public CorporateGroupPost201Response corporateGroupPost(CorporateGroupPostRequest corporateGroupPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = corporateGroupPostRequest; + + // create path and map variables + String localVarPath = "/corporate/group"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete sub-account from group + * This endpoint allows you to remove a sub-organization from a group. + * @param groupId Group id (required) + * @param corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required) + * @throws ApiException if fails to make API call + */ + public void corporateGroupUnlinkGroupIdSubAccountsPut(String groupId, CorporateGroupUnlinkGroupIdSubAccountsPutRequest corporateGroupUnlinkGroupIdSubAccountsPutRequest) throws ApiException { + this.corporateGroupUnlinkGroupIdSubAccountsPut(groupId, corporateGroupUnlinkGroupIdSubAccountsPutRequest, Collections.emptyMap()); + } + + + /** + * Delete sub-account from group + * This endpoint allows you to remove a sub-organization from a group. + * @param groupId Group id (required) + * @param corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateGroupUnlinkGroupIdSubAccountsPut(String groupId, CorporateGroupUnlinkGroupIdSubAccountsPutRequest corporateGroupUnlinkGroupIdSubAccountsPutRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = corporateGroupUnlinkGroupIdSubAccountsPutRequest; + + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException(400, "Missing the required parameter 'groupId' when calling corporateGroupUnlinkGroupIdSubAccountsPut"); + } + + // verify the required parameter 'corporateGroupUnlinkGroupIdSubAccountsPutRequest' is set + if (corporateGroupUnlinkGroupIdSubAccountsPutRequest == null) { + throw new ApiException(400, "Missing the required parameter 'corporateGroupUnlinkGroupIdSubAccountsPutRequest' when calling corporateGroupUnlinkGroupIdSubAccountsPut"); + } + + // create path and map variables + String localVarPath = "/corporate/group/unlink/{groupId}/subAccounts" + .replaceAll("\\{" + "groupId" + "\\}", apiClient.escapeString(groupId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get the details of requested master account + * This endpoint will provide the details of the master account. + * @return MasterDetailsResponse + * @throws ApiException if fails to make API call + */ + public MasterDetailsResponse corporateMasterAccountGet() throws ApiException { + return this.corporateMasterAccountGet(Collections.emptyMap()); + } + + + /** + * Get the details of requested master account + * This endpoint will provide the details of the master account. + * @param additionalHeaders additionalHeaders for this call + * @return MasterDetailsResponse + * @throws ApiException if fails to make API call + */ + public MasterDetailsResponse corporateMasterAccountGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/corporate/masterAccount"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all the sub-accounts of the master account. + * This endpoint will provide the list all the sub-accounts of the master account. + * @param offset Index of the first sub-account in the page (required) + * @param limit Number of sub-accounts to be displayed on each page (required) + * @return SubAccountsResponse + * @throws ApiException if fails to make API call + */ + public SubAccountsResponse corporateSubAccountGet(Integer offset, Integer limit) throws ApiException { + return this.corporateSubAccountGet(offset, limit, Collections.emptyMap()); + } + + + /** + * Get the list of all the sub-accounts of the master account. + * This endpoint will provide the list all the sub-accounts of the master account. + * @param offset Index of the first sub-account in the page (required) + * @param limit Number of sub-accounts to be displayed on each page (required) + * @param additionalHeaders additionalHeaders for this call + * @return SubAccountsResponse + * @throws ApiException if fails to make API call + */ + public SubAccountsResponse corporateSubAccountGet(Integer offset, Integer limit, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'offset' is set + if (offset == null) { + throw new ApiException(400, "Missing the required parameter 'offset' when calling corporateSubAccountGet"); + } + + // verify the required parameter 'limit' is set + if (limit == null) { + throw new ApiException(400, "Missing the required parameter 'limit' when calling corporateSubAccountGet"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Enable/disable sub-account application(s) + * API endpoints for the Corporate owner to enable/disable applications on the sub-account + * @param id Id of the sub-account organization (mandatory) (required) + * @param subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required) + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdApplicationsTogglePut(Long id, SubAccountAppsToggleRequest subAccountAppsToggleRequest) throws ApiException { + this.corporateSubAccountIdApplicationsTogglePut(id, subAccountAppsToggleRequest, Collections.emptyMap()); + } + + + /** + * Enable/disable sub-account application(s) + * API endpoints for the Corporate owner to enable/disable applications on the sub-account + * @param id Id of the sub-account organization (mandatory) (required) + * @param subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdApplicationsTogglePut(Long id, SubAccountAppsToggleRequest subAccountAppsToggleRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = subAccountAppsToggleRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateSubAccountIdApplicationsTogglePut"); + } + + // verify the required parameter 'subAccountAppsToggleRequest' is set + if (subAccountAppsToggleRequest == null) { + throw new ApiException(400, "Missing the required parameter 'subAccountAppsToggleRequest' when calling corporateSubAccountIdApplicationsTogglePut"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount/{id}/applications/toggle" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a sub-account + * + * @param id Id of the sub-account organization to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdDelete(Long id) throws ApiException { + this.corporateSubAccountIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a sub-account + * + * @param id Id of the sub-account organization to be deleted (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdDelete(Long id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateSubAccountIdDelete"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get sub-account details + * This endpoint will provide the details for the specified sub-account company + * @param id Id of the sub-account organization (required) + * @return SubAccountDetailsResponse + * @throws ApiException if fails to make API call + */ + public SubAccountDetailsResponse corporateSubAccountIdGet(Long id) throws ApiException { + return this.corporateSubAccountIdGet(id, Collections.emptyMap()); + } + + + /** + * Get sub-account details + * This endpoint will provide the details for the specified sub-account company + * @param id Id of the sub-account organization (required) + * @param additionalHeaders additionalHeaders for this call + * @return SubAccountDetailsResponse + * @throws ApiException if fails to make API call + */ + public SubAccountDetailsResponse corporateSubAccountIdGet(Long id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateSubAccountIdGet"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update sub-account plan + * This endpoint will update the sub-account plan + * @param id Id of the sub-account organization (required) + * @param subAccountUpdatePlanRequest Values to update a sub-account plan (required) + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdPlanPut(Long id, SubAccountUpdatePlanRequest subAccountUpdatePlanRequest) throws ApiException { + this.corporateSubAccountIdPlanPut(id, subAccountUpdatePlanRequest, Collections.emptyMap()); + } + + + /** + * Update sub-account plan + * This endpoint will update the sub-account plan + * @param id Id of the sub-account organization (required) + * @param subAccountUpdatePlanRequest Values to update a sub-account plan (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateSubAccountIdPlanPut(Long id, SubAccountUpdatePlanRequest subAccountUpdatePlanRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = subAccountUpdatePlanRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling corporateSubAccountIdPlanPut"); + } + + // verify the required parameter 'subAccountUpdatePlanRequest' is set + if (subAccountUpdatePlanRequest == null) { + throw new ApiException(400, "Missing the required parameter 'subAccountUpdatePlanRequest' when calling corporateSubAccountIdPlanPut"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount/{id}/plan" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create an API key for a sub-account + * This endpoint will generate an API v3 key for a sub account + * @param corporateSubAccountKeyPostRequest (optional) + * @return CreateApiKeyResponse + * @throws ApiException if fails to make API call + */ + public CreateApiKeyResponse corporateSubAccountKeyPost(CorporateSubAccountKeyPostRequest corporateSubAccountKeyPostRequest) throws ApiException { + return this.corporateSubAccountKeyPost(corporateSubAccountKeyPostRequest, Collections.emptyMap()); + } + + + /** + * Create an API key for a sub-account + * This endpoint will generate an API v3 key for a sub account + * @param corporateSubAccountKeyPostRequest (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreateApiKeyResponse + * @throws ApiException if fails to make API call + */ + public CreateApiKeyResponse corporateSubAccountKeyPost(CorporateSubAccountKeyPostRequest corporateSubAccountKeyPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = corporateSubAccountKeyPostRequest; + + // create path and map variables + String localVarPath = "/corporate/subAccount/key"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create a new sub-account under a master account. + * This endpoint will create a new sub-account under a master account + * @param createSubAccount Request body with sub-account organization name (required) + * @return CreateSubAccountResponse + * @throws ApiException if fails to make API call + */ + public CreateSubAccountResponse corporateSubAccountPost(CreateSubAccount createSubAccount) throws ApiException { + return this.corporateSubAccountPost(createSubAccount, Collections.emptyMap()); + } + + + /** + * Create a new sub-account under a master account. + * This endpoint will create a new sub-account under a master account + * @param createSubAccount Request body with sub-account organization name (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateSubAccountResponse + * @throws ApiException if fails to make API call + */ + public CreateSubAccountResponse corporateSubAccountPost(CreateSubAccount createSubAccount, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createSubAccount; + + // verify the required parameter 'createSubAccount' is set + if (createSubAccount == null) { + throw new ApiException(400, "Missing the required parameter 'createSubAccount' when calling corporateSubAccountPost"); + } + + // create path and map variables + String localVarPath = "/corporate/subAccount"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Generate SSO token to access Brevo + * This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. + * @param corporateSubAccountSsoTokenPostRequest (optional) + * @return GetSsoToken + * @throws ApiException if fails to make API call + */ + public GetSsoToken corporateSubAccountSsoTokenPost(CorporateSubAccountSsoTokenPostRequest corporateSubAccountSsoTokenPostRequest) throws ApiException { + return this.corporateSubAccountSsoTokenPost(corporateSubAccountSsoTokenPostRequest, Collections.emptyMap()); + } + + + /** + * Generate SSO token to access Brevo + * This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. + * @param corporateSubAccountSsoTokenPostRequest (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetSsoToken + * @throws ApiException if fails to make API call + */ + public GetSsoToken corporateSubAccountSsoTokenPost(CorporateSubAccountSsoTokenPostRequest corporateSubAccountSsoTokenPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = corporateSubAccountSsoTokenPostRequest; + + // create path and map variables + String localVarPath = "/corporate/subAccount/ssoToken"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Resend / cancel admin user invitation + * This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation + * @param action Action to be performed (cancel / resend) (required) + * @param email Email address of the recipient (required) + * @return CorporateUserInvitationActionEmailPut200Response + * @throws ApiException if fails to make API call + */ + public CorporateUserInvitationActionEmailPut200Response corporateUserInvitationActionEmailPut(String action, String email) throws ApiException { + return this.corporateUserInvitationActionEmailPut(action, email, Collections.emptyMap()); + } + + + /** + * Resend / cancel admin user invitation + * This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation + * @param action Action to be performed (cancel / resend) (required) + * @param email Email address of the recipient (required) + * @param additionalHeaders additionalHeaders for this call + * @return CorporateUserInvitationActionEmailPut200Response + * @throws ApiException if fails to make API call + */ + public CorporateUserInvitationActionEmailPut200Response corporateUserInvitationActionEmailPut(String action, String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'action' is set + if (action == null) { + throw new ApiException(400, "Missing the required parameter 'action' when calling corporateUserInvitationActionEmailPut"); + } + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling corporateUserInvitationActionEmailPut"); + } + + // create path and map variables + String localVarPath = "/corporate/user/invitation/{action}/{email}" + .replaceAll("\\{" + "action" + "\\}", apiClient.escapeString(action.toString())) + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Revoke an admin user + * This endpoint allows to revoke/remove an invited member of your Admin account + * @param email Email of the invited user (required) + * @throws ApiException if fails to make API call + */ + public void corporateUserRevokeEmailDelete(String email) throws ApiException { + this.corporateUserRevokeEmailDelete(email, Collections.emptyMap()); + } + + + /** + * Revoke an admin user + * This endpoint allows to revoke/remove an invited member of your Admin account + * @param email Email of the invited user (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void corporateUserRevokeEmailDelete(String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling corporateUserRevokeEmailDelete"); + } + + // create path and map variables + String localVarPath = "/corporate/user/revoke/{email}" + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get user activity logs + * + * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional) + * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document in the page. (optional, default to 0) + * @return GetAccountActivity + * @throws ApiException if fails to make API call + */ + public GetAccountActivity getAccountActivity(String startDate, String endDate, Long limit, Long offset) throws ApiException { + return this.getAccountActivity(startDate, endDate, limit, offset, Collections.emptyMap()); + } + + + /** + * Get user activity logs + * + * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. (optional) + * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. (optional) + * @param limit Number of documents per page (optional, default to 10) + * @param offset Index of the first document in the page. (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetAccountActivity + * @throws ApiException if fails to make API call + */ + public GetAccountActivity getAccountActivity(String startDate, String endDate, Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/organization/activities"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all admin users + * This endpoint allows you to list all Admin users of your Admin account + * @return GetCorporateInvitedUsersList + * @throws ApiException if fails to make API call + */ + public GetCorporateInvitedUsersList getCorporateInvitedUsersList() throws ApiException { + return this.getCorporateInvitedUsersList(Collections.emptyMap()); + } + + + /** + * Get the list of all admin users + * This endpoint allows you to list all Admin users of your Admin account + * @param additionalHeaders additionalHeaders for this call + * @return GetCorporateInvitedUsersList + * @throws ApiException if fails to make API call + */ + public GetCorporateInvitedUsersList getCorporateInvitedUsersList(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/corporate/invited/users"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of groups + * This endpoint allows you to list all groups created on your Admin account. + * @return List<GetSubAccountGroups200ResponseInner> + * @throws ApiException if fails to make API call + */ + public List getSubAccountGroups() throws ApiException { + return this.getSubAccountGroups(Collections.emptyMap()); + } + + + /** + * Get the list of groups + * This endpoint allows you to list all groups created on your Admin account. + * @param additionalHeaders additionalHeaders for this call + * @return List<GetSubAccountGroups200ResponseInner> + * @throws ApiException if fails to make API call + */ + public List getSubAccountGroups(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/corporate/groups"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send invitation to an admin user + * `This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited admin user. + * @param inviteAdminUser Payload to send an invitation (required) + * @return CorporateGroupPost201Response + * @throws ApiException if fails to make API call + */ + public CorporateGroupPost201Response inviteAdminUser(InviteAdminUser inviteAdminUser) throws ApiException { + return this.inviteAdminUser(inviteAdminUser, Collections.emptyMap()); + } + + + /** + * Send invitation to an admin user + * `This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited admin user. + * @param inviteAdminUser Payload to send an invitation (required) + * @param additionalHeaders additionalHeaders for this call + * @return CorporateGroupPost201Response + * @throws ApiException if fails to make API call + */ + public CorporateGroupPost201Response inviteAdminUser(InviteAdminUser inviteAdminUser, Map additionalHeaders) throws ApiException { + Object localVarPostBody = inviteAdminUser; + + // verify the required parameter 'inviteAdminUser' is set + if (inviteAdminUser == null) { + throw new ApiException(400, "Missing the required parameter 'inviteAdminUser' when calling inviteAdminUser"); + } + + // create path and map variables + String localVarPath = "/corporate/user/invitation/send"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/NotesApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/NotesApi.java new file mode 100644 index 0000000..3ce2cca --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/NotesApi.java @@ -0,0 +1,445 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.Note; +import software.xdev.brevo.model.NoteData; +import software.xdev.brevo.model.NoteId; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NotesApi { + + + private ApiClient apiClient; + + public NotesApi() { + this(Configuration.getDefaultApiClient()); + } + + public NotesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get all notes + * + * @param entity Filter by note entity type (optional) + * @param entityIds Filter by note entity IDs (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @return List<Note> + * @throws ApiException if fails to make API call + */ + public List crmNotesGet(String entity, String entityIds, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort) throws ApiException { + return this.crmNotesGet(entity, entityIds, dateFrom, dateTo, offset, limit, sort, Collections.emptyMap()); + } + + + /** + * Get all notes + * + * @param entity Filter by note entity type (optional) + * @param entityIds Filter by note entity IDs (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param additionalHeaders additionalHeaders for this call + * @return List<Note> + * @throws ApiException if fails to make API call + */ + public List crmNotesGet(String entity, String entityIds, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/notes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("entity", entity)); + localVarQueryParams.addAll(apiClient.parameterToPair("entityIds", entityIds)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateFrom", dateFrom)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateTo", dateTo)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a note + * + * @param id Note ID to delete (required) + * @throws ApiException if fails to make API call + */ + public void crmNotesIdDelete(String id) throws ApiException { + this.crmNotesIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a note + * + * @param id Note ID to delete (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmNotesIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmNotesIdDelete"); + } + + // create path and map variables + String localVarPath = "/crm/notes/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a note + * + * @param id Note ID to get (required) + * @return Note + * @throws ApiException if fails to make API call + */ + public Note crmNotesIdGet(String id) throws ApiException { + return this.crmNotesIdGet(id, Collections.emptyMap()); + } + + + /** + * Get a note + * + * @param id Note ID to get (required) + * @param additionalHeaders additionalHeaders for this call + * @return Note + * @throws ApiException if fails to make API call + */ + public Note crmNotesIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmNotesIdGet"); + } + + // create path and map variables + String localVarPath = "/crm/notes/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a note + * + * @param id Note ID to update (required) + * @param noteData Note data to update a note. (required) + * @throws ApiException if fails to make API call + */ + public void crmNotesIdPatch(String id, NoteData noteData) throws ApiException { + this.crmNotesIdPatch(id, noteData, Collections.emptyMap()); + } + + + /** + * Update a note + * + * @param id Note ID to update (required) + * @param noteData Note data to update a note. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmNotesIdPatch(String id, NoteData noteData, Map additionalHeaders) throws ApiException { + Object localVarPostBody = noteData; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmNotesIdPatch"); + } + + // verify the required parameter 'noteData' is set + if (noteData == null) { + throw new ApiException(400, "Missing the required parameter 'noteData' when calling crmNotesIdPatch"); + } + + // create path and map variables + String localVarPath = "/crm/notes/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a note + * + * @param noteData Note data to create a note. (required) + * @return NoteId + * @throws ApiException if fails to make API call + */ + public NoteId crmNotesPost(NoteData noteData) throws ApiException { + return this.crmNotesPost(noteData, Collections.emptyMap()); + } + + + /** + * Create a note + * + * @param noteData Note data to create a note. (required) + * @param additionalHeaders additionalHeaders for this call + * @return NoteId + * @throws ApiException if fails to make API call + */ + public NoteId crmNotesPost(NoteData noteData, Map additionalHeaders) throws ApiException { + Object localVarPostBody = noteData; + + // verify the required parameter 'noteData' is set + if (noteData == null) { + throw new ApiException(400, "Missing the required parameter 'noteData' when calling crmNotesPost"); + } + + // create path and map variables + String localVarPath = "/crm/notes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/ProcessApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ProcessApi.java new file mode 100644 index 0000000..bc7245a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ProcessApi.java @@ -0,0 +1,207 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetProcess; +import software.xdev.brevo.model.GetProcesses; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ProcessApi { + + + private ApiClient apiClient; + + public ProcessApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProcessApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Return the informations for a process + * + * @param processId Id of the process (required) + * @return GetProcess + * @throws ApiException if fails to make API call + */ + public GetProcess getProcess(Long processId) throws ApiException { + return this.getProcess(processId, Collections.emptyMap()); + } + + + /** + * Return the informations for a process + * + * @param processId Id of the process (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetProcess + * @throws ApiException if fails to make API call + */ + public GetProcess getProcess(Long processId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'processId' is set + if (processId == null) { + throw new ApiException(400, "Missing the required parameter 'processId' when calling getProcess"); + } + + // create path and map variables + String localVarPath = "/processes/{processId}" + .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Return all the processes for your account + * + * @param limit Number limitation for the result returned (optional, default to 10) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetProcesses + * @throws ApiException if fails to make API call + */ + public GetProcesses getProcesses(Long limit, Long offset, String sort) throws ApiException { + return this.getProcesses(limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Return all the processes for your account + * + * @param limit Number limitation for the result returned (optional, default to 10) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetProcesses + * @throws ApiException if fails to make API call + */ + public GetProcesses getProcesses(Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/processes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/ResellerApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ResellerApi.java new file mode 100644 index 0000000..80e1ec9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/ResellerApi.java @@ -0,0 +1,1309 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.AddChildDomain; +import software.xdev.brevo.model.AddCredits; +import software.xdev.brevo.model.CreateChild; +import software.xdev.brevo.model.CreateReseller; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetChildAccountCreationStatus; +import software.xdev.brevo.model.GetChildDomain; +import software.xdev.brevo.model.GetChildInfo; +import software.xdev.brevo.model.GetChildrenList; +import software.xdev.brevo.model.GetSsoToken; +import software.xdev.brevo.model.ManageIp; +import software.xdev.brevo.model.RemainingCreditModel; +import software.xdev.brevo.model.RemoveCredits; +import software.xdev.brevo.model.UpdateChild; +import software.xdev.brevo.model.UpdateChildAccountStatus; +import software.xdev.brevo.model.UpdateChildDomain; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ResellerApi { + + + private ApiClient apiClient; + + public ResellerApi() { + this(Configuration.getDefaultApiClient()); + } + + public ResellerApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add Email and/or SMS credits to a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param addCredits Values to post to add credit to a specific child account (required) + * @return RemainingCreditModel + * @throws ApiException if fails to make API call + */ + public RemainingCreditModel addCredits(String childIdentifier, AddCredits addCredits) throws ApiException { + return this.addCredits(childIdentifier, addCredits, Collections.emptyMap()); + } + + + /** + * Add Email and/or SMS credits to a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param addCredits Values to post to add credit to a specific child account (required) + * @param additionalHeaders additionalHeaders for this call + * @return RemainingCreditModel + * @throws ApiException if fails to make API call + */ + public RemainingCreditModel addCredits(String childIdentifier, AddCredits addCredits, Map additionalHeaders) throws ApiException { + Object localVarPostBody = addCredits; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling addCredits"); + } + + // verify the required parameter 'addCredits' is set + if (addCredits == null) { + throw new ApiException(400, "Missing the required parameter 'addCredits' when calling addCredits"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/credits/add" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Associate a dedicated IP to the child + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param ip IP to associate (required) + * @throws ApiException if fails to make API call + */ + public void associateIpToChild(String childIdentifier, ManageIp ip) throws ApiException { + this.associateIpToChild(childIdentifier, ip, Collections.emptyMap()); + } + + + /** + * Associate a dedicated IP to the child + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param ip IP to associate (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void associateIpToChild(String childIdentifier, ManageIp ip, Map additionalHeaders) throws ApiException { + Object localVarPostBody = ip; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling associateIpToChild"); + } + + // verify the required parameter 'ip' is set + if (ip == null) { + throw new ApiException(400, "Missing the required parameter 'ip' when calling associateIpToChild"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/ips/associate" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a domain for a child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) + * @throws ApiException if fails to make API call + */ + public void createChildDomain(String childIdentifier, AddChildDomain addChildDomain) throws ApiException { + this.createChildDomain(childIdentifier, addChildDomain, Collections.emptyMap()); + } + + + /** + * Create a domain for a child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createChildDomain(String childIdentifier, AddChildDomain addChildDomain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = addChildDomain; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling createChildDomain"); + } + + // verify the required parameter 'addChildDomain' is set + if (addChildDomain == null) { + throw new ApiException(400, "Missing the required parameter 'addChildDomain' when calling createChildDomain"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/domains" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Creates a reseller child + * + * @param createChild reseller child to add (optional) + * @return CreateReseller + * @throws ApiException if fails to make API call + */ + public CreateReseller createResellerChild(CreateChild createChild) throws ApiException { + return this.createResellerChild(createChild, Collections.emptyMap()); + } + + + /** + * Creates a reseller child + * + * @param createChild reseller child to add (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreateReseller + * @throws ApiException if fails to make API call + */ + public CreateReseller createResellerChild(CreateChild createChild, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createChild; + + // create path and map variables + String localVarPath = "/reseller/children"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param domainName Pass the existing domain that needs to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteChildDomain(String childIdentifier, String domainName) throws ApiException { + this.deleteChildDomain(childIdentifier, domainName, Collections.emptyMap()); + } + + + /** + * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param domainName Pass the existing domain that needs to be deleted (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteChildDomain(String childIdentifier, String domainName, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling deleteChildDomain"); + } + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException(400, "Missing the required parameter 'domainName' when calling deleteChildDomain"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/domains/{domainName}" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())) + .replaceAll("\\{" + "domainName" + "\\}", apiClient.escapeString(domainName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete a single reseller child based on the child identifier supplied + * + * @param childIdentifier Either auth key or child id of reseller's child (required) + * @throws ApiException if fails to make API call + */ + public void deleteResellerChild(String childIdentifier) throws ApiException { + this.deleteResellerChild(childIdentifier, Collections.emptyMap()); + } + + + /** + * Delete a single reseller child based on the child identifier supplied + * + * @param childIdentifier Either auth key or child id of reseller's child (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteResellerChild(String childIdentifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling deleteResellerChild"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Dissociate a dedicated IP to the child + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param ip IP to dissociate (required) + * @throws ApiException if fails to make API call + */ + public void dissociateIpFromChild(String childIdentifier, ManageIp ip) throws ApiException { + this.dissociateIpFromChild(childIdentifier, ip, Collections.emptyMap()); + } + + + /** + * Dissociate a dedicated IP to the child + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param ip IP to dissociate (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void dissociateIpFromChild(String childIdentifier, ManageIp ip, Map additionalHeaders) throws ApiException { + Object localVarPostBody = ip; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling dissociateIpFromChild"); + } + + // verify the required parameter 'ip' is set + if (ip == null) { + throw new ApiException(400, "Missing the required parameter 'ip' when calling dissociateIpFromChild"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/ips/dissociate" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the childIdentifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @return GetChildAccountCreationStatus + * @throws ApiException if fails to make API call + */ + public GetChildAccountCreationStatus getChildAccountCreationStatus(String childIdentifier) throws ApiException { + return this.getChildAccountCreationStatus(childIdentifier, Collections.emptyMap()); + } + + + /** + * Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the childIdentifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetChildAccountCreationStatus + * @throws ApiException if fails to make API call + */ + public GetChildAccountCreationStatus getChildAccountCreationStatus(String childIdentifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling getChildAccountCreationStatus"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/accountCreationStatus" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all sender domains for a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @return List<GetChildDomain> + * @throws ApiException if fails to make API call + */ + public List getChildDomains(String childIdentifier) throws ApiException { + return this.getChildDomains(childIdentifier, Collections.emptyMap()); + } + + + /** + * Get all sender domains for a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param additionalHeaders additionalHeaders for this call + * @return List<GetChildDomain> + * @throws ApiException if fails to make API call + */ + public List getChildDomains(String childIdentifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling getChildDomains"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/domains" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference> localVarReturnType = new TypeReference>() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a child account's details + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @return GetChildInfo + * @throws ApiException if fails to make API call + */ + public GetChildInfo getChildInfo(String childIdentifier) throws ApiException { + return this.getChildInfo(childIdentifier, Collections.emptyMap()); + } + + + /** + * Get a child account's details + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetChildInfo + * @throws ApiException if fails to make API call + */ + public GetChildInfo getChildInfo(String childIdentifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling getChildInfo"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all children accounts + * + * @param limit Number of documents for child accounts information per page (optional, default to 10) + * @param offset Index of the first document in the page (optional, default to 0) + * @return GetChildrenList + * @throws ApiException if fails to make API call + */ + public GetChildrenList getResellerChilds(Long limit, Long offset) throws ApiException { + return this.getResellerChilds(limit, offset, Collections.emptyMap()); + } + + + /** + * Get the list of all children accounts + * + * @param limit Number of documents for child accounts information per page (optional, default to 10) + * @param offset Index of the first document in the page (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetChildrenList + * @throws ApiException if fails to make API call + */ + public GetChildrenList getResellerChilds(Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/reseller/children"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get session token to access Brevo (SSO) + * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] + * @param childIdentifier Either auth key or id of reseller's child (required) + * @return GetSsoToken + * @throws ApiException if fails to make API call + */ + public GetSsoToken getSsoToken(String childIdentifier) throws ApiException { + return this.getSsoToken(childIdentifier, Collections.emptyMap()); + } + + + /** + * Get session token to access Brevo (SSO) + * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetSsoToken + * @throws ApiException if fails to make API call + */ + public GetSsoToken getSsoToken(String childIdentifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling getSsoToken"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/auth" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Remove Email and/or SMS credits from a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @return RemainingCreditModel + * @throws ApiException if fails to make API call + */ + public RemainingCreditModel removeCredits(String childIdentifier, RemoveCredits removeCredits) throws ApiException { + return this.removeCredits(childIdentifier, removeCredits, Collections.emptyMap()); + } + + + /** + * Remove Email and/or SMS credits from a specific child account + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param additionalHeaders additionalHeaders for this call + * @return RemainingCreditModel + * @throws ApiException if fails to make API call + */ + public RemainingCreditModel removeCredits(String childIdentifier, RemoveCredits removeCredits, Map additionalHeaders) throws ApiException { + Object localVarPostBody = removeCredits; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling removeCredits"); + } + + // verify the required parameter 'removeCredits' is set + if (removeCredits == null) { + throw new ApiException(400, "Missing the required parameter 'removeCredits' when calling removeCredits"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/credits/remove" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update info of reseller's child account status based on the identifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param updateChildAccountStatus values to update in child account status (required) + * @throws ApiException if fails to make API call + */ + public void updateChildAccountStatus(String childIdentifier, UpdateChildAccountStatus updateChildAccountStatus) throws ApiException { + this.updateChildAccountStatus(childIdentifier, updateChildAccountStatus, Collections.emptyMap()); + } + + + /** + * Update info of reseller's child account status based on the identifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param updateChildAccountStatus values to update in child account status (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateChildAccountStatus(String childIdentifier, UpdateChildAccountStatus updateChildAccountStatus, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateChildAccountStatus; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling updateChildAccountStatus"); + } + + // verify the required parameter 'updateChildAccountStatus' is set + if (updateChildAccountStatus == null) { + throw new ApiException(400, "Missing the required parameter 'updateChildAccountStatus' when calling updateChildAccountStatus"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/accountStatus" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update the sender domain of reseller's child based on the childIdentifier and domainName passed + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param domainName Pass the existing domain that needs to be updated (required) + * @param updateChildDomain value to update for sender domain (required) + * @throws ApiException if fails to make API call + */ + public void updateChildDomain(String childIdentifier, String domainName, UpdateChildDomain updateChildDomain) throws ApiException { + this.updateChildDomain(childIdentifier, domainName, updateChildDomain, Collections.emptyMap()); + } + + + /** + * Update the sender domain of reseller's child based on the childIdentifier and domainName passed + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param domainName Pass the existing domain that needs to be updated (required) + * @param updateChildDomain value to update for sender domain (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateChildDomain(String childIdentifier, String domainName, UpdateChildDomain updateChildDomain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateChildDomain; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling updateChildDomain"); + } + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException(400, "Missing the required parameter 'domainName' when calling updateChildDomain"); + } + + // verify the required parameter 'updateChildDomain' is set + if (updateChildDomain == null) { + throw new ApiException(400, "Missing the required parameter 'updateChildDomain' when calling updateChildDomain"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}/domains/{domainName}" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())) + .replaceAll("\\{" + "domainName" + "\\}", apiClient.escapeString(domainName.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update info of reseller's child based on the child identifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param resellerChild values to update in child profile (required) + * @throws ApiException if fails to make API call + */ + public void updateResellerChild(String childIdentifier, UpdateChild resellerChild) throws ApiException { + this.updateResellerChild(childIdentifier, resellerChild, Collections.emptyMap()); + } + + + /** + * Update info of reseller's child based on the child identifier supplied + * + * @param childIdentifier Either auth key or id of reseller's child (required) + * @param resellerChild values to update in child profile (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateResellerChild(String childIdentifier, UpdateChild resellerChild, Map additionalHeaders) throws ApiException { + Object localVarPostBody = resellerChild; + + // verify the required parameter 'childIdentifier' is set + if (childIdentifier == null) { + throw new ApiException(400, "Missing the required parameter 'childIdentifier' when calling updateResellerChild"); + } + + // verify the required parameter 'resellerChild' is set + if (resellerChild == null) { + throw new ApiException(400, "Missing the required parameter 'resellerChild' when calling updateResellerChild"); + } + + // create path and map variables + String localVarPath = "/reseller/children/{childIdentifier}" + .replaceAll("\\{" + "childIdentifier" + "\\}", apiClient.escapeString(childIdentifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/SendersApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/SendersApi.java new file mode 100644 index 0000000..d455b2b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/SendersApi.java @@ -0,0 +1,565 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateSender; +import software.xdev.brevo.model.CreateSenderModel; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetIps; +import software.xdev.brevo.model.GetIpsFromSender; +import software.xdev.brevo.model.GetSendersList; +import software.xdev.brevo.model.Otp; +import software.xdev.brevo.model.UpdateSender; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendersApi { + + + private ApiClient apiClient; + + public SendersApi() { + this(Configuration.getDefaultApiClient()); + } + + public SendersApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a new sender + * + * @param sender sender's name (optional) + * @return CreateSenderModel + * @throws ApiException if fails to make API call + */ + public CreateSenderModel createSender(CreateSender sender) throws ApiException { + return this.createSender(sender, Collections.emptyMap()); + } + + + /** + * Create a new sender + * + * @param sender sender's name (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreateSenderModel + * @throws ApiException if fails to make API call + */ + public CreateSenderModel createSender(CreateSender sender, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sender; + + // create path and map variables + String localVarPath = "/senders"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a sender + * + * @param senderId Id of the sender (required) + * @throws ApiException if fails to make API call + */ + public void deleteSender(Long senderId) throws ApiException { + this.deleteSender(senderId, Collections.emptyMap()); + } + + + /** + * Delete a sender + * + * @param senderId Id of the sender (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteSender(Long senderId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'senderId' is set + if (senderId == null) { + throw new ApiException(400, "Missing the required parameter 'senderId' when calling deleteSender"); + } + + // create path and map variables + String localVarPath = "/senders/{senderId}" + .replaceAll("\\{" + "senderId" + "\\}", apiClient.escapeString(senderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get all the dedicated IPs for your account + * + * @return GetIps + * @throws ApiException if fails to make API call + */ + public GetIps getIps() throws ApiException { + return this.getIps(Collections.emptyMap()); + } + + + /** + * Get all the dedicated IPs for your account + * + * @param additionalHeaders additionalHeaders for this call + * @return GetIps + * @throws ApiException if fails to make API call + */ + public GetIps getIps(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/senders/ips"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all the dedicated IPs for a sender + * + * @param senderId Id of the sender (required) + * @return GetIpsFromSender + * @throws ApiException if fails to make API call + */ + public GetIpsFromSender getIpsFromSender(Long senderId) throws ApiException { + return this.getIpsFromSender(senderId, Collections.emptyMap()); + } + + + /** + * Get all the dedicated IPs for a sender + * + * @param senderId Id of the sender (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetIpsFromSender + * @throws ApiException if fails to make API call + */ + public GetIpsFromSender getIpsFromSender(Long senderId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'senderId' is set + if (senderId == null) { + throw new ApiException(400, "Missing the required parameter 'senderId' when calling getIpsFromSender"); + } + + // create path and map variables + String localVarPath = "/senders/{senderId}/ips" + .replaceAll("\\{" + "senderId" + "\\}", apiClient.escapeString(senderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all your senders + * + * @param ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional) + * @param domain Filter your senders for a specific domain (optional) + * @return GetSendersList + * @throws ApiException if fails to make API call + */ + public GetSendersList getSenders(String ip, String domain) throws ApiException { + return this.getSenders(ip, domain, Collections.emptyMap()); + } + + + /** + * Get the list of all your senders + * + * @param ip Filter your senders for a specific ip. **Available for dedicated IP usage only** (optional) + * @param domain Filter your senders for a specific domain (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetSendersList + * @throws ApiException if fails to make API call + */ + public GetSendersList getSenders(String ip, String domain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/senders"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("ip", ip)); + localVarQueryParams.addAll(apiClient.parameterToPair("domain", domain)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a sender + * + * @param senderId Id of the sender (required) + * @param sender sender's name (optional) + * @throws ApiException if fails to make API call + */ + public void updateSender(Long senderId, UpdateSender sender) throws ApiException { + this.updateSender(senderId, sender, Collections.emptyMap()); + } + + + /** + * Update a sender + * + * @param senderId Id of the sender (required) + * @param sender sender's name (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateSender(Long senderId, UpdateSender sender, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sender; + + // verify the required parameter 'senderId' is set + if (senderId == null) { + throw new ApiException(400, "Missing the required parameter 'senderId' when calling updateSender"); + } + + // create path and map variables + String localVarPath = "/senders/{senderId}" + .replaceAll("\\{" + "senderId" + "\\}", apiClient.escapeString(senderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Validate Sender using OTP + * + * @param senderId Id of the sender (required) + * @param sender otp (optional) + * @throws ApiException if fails to make API call + */ + public void validateSenderByOTP(Long senderId, Otp sender) throws ApiException { + this.validateSenderByOTP(senderId, sender, Collections.emptyMap()); + } + + + /** + * Validate Sender using OTP + * + * @param senderId Id of the sender (required) + * @param sender otp (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void validateSenderByOTP(Long senderId, Otp sender, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sender; + + // verify the required parameter 'senderId' is set + if (senderId == null) { + throw new ApiException(400, "Missing the required parameter 'senderId' when calling validateSenderByOTP"); + } + + // create path and map variables + String localVarPath = "/senders/{senderId}/validate" + .replaceAll("\\{" + "senderId" + "\\}", apiClient.escapeString(senderId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/SmsCampaignsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/SmsCampaignsApi.java new file mode 100644 index 0000000..08010f8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/SmsCampaignsApi.java @@ -0,0 +1,836 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreateSmsCampaign; +import software.xdev.brevo.model.CreatedProcessId; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetSmsCampaign; +import software.xdev.brevo.model.GetSmsCampaigns; +import software.xdev.brevo.model.PostSendSmsTestFailed; +import software.xdev.brevo.model.RequestSmsRecipientExport; +import software.xdev.brevo.model.SendReport; +import software.xdev.brevo.model.SendTestSms; +import software.xdev.brevo.model.UpdateCampaignStatus; +import software.xdev.brevo.model.UpdateSmsCampaign; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SmsCampaignsApi { + + + private ApiClient apiClient; + + public SmsCampaignsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SmsCampaignsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Creates an SMS campaign + * + * @param createSmsCampaign Values to create an SMS Campaign (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createSmsCampaign(CreateSmsCampaign createSmsCampaign) throws ApiException { + return this.createSmsCampaign(createSmsCampaign, Collections.emptyMap()); + } + + + /** + * Creates an SMS campaign + * + * @param createSmsCampaign Values to create an SMS Campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createSmsCampaign(CreateSmsCampaign createSmsCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createSmsCampaign; + + // verify the required parameter 'createSmsCampaign' is set + if (createSmsCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'createSmsCampaign' when calling createSmsCampaign"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @throws ApiException if fails to make API call + */ + public void deleteSmsCampaign(Long campaignId) throws ApiException { + this.deleteSmsCampaign(campaignId, Collections.emptyMap()); + } + + + /** + * Delete an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteSmsCampaign(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling deleteSmsCampaign"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @return GetSmsCampaign + * @throws ApiException if fails to make API call + */ + public GetSmsCampaign getSmsCampaign(Long campaignId) throws ApiException { + return this.getSmsCampaign(campaignId, Collections.emptyMap()); + } + + + /** + * Get an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetSmsCampaign + * @throws ApiException if fails to make API call + */ + public GetSmsCampaign getSmsCampaign(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling getSmsCampaign"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Returns the information for all your created SMS campaigns + * + * @param status Status of campaign. (optional) + * @param startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param limit Number limitation for the result returned (optional, default to 500) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetSmsCampaigns + * @throws ApiException if fails to make API call + */ + public GetSmsCampaigns getSmsCampaigns(String status, String startDate, String endDate, Long limit, Long offset, String sort) throws ApiException { + return this.getSmsCampaigns(status, startDate, endDate, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Returns the information for all your created SMS campaigns + * + * @param status Status of campaign. (optional) + * @param startDate **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param endDate **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param limit Number limitation for the result returned (optional, default to 500) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetSmsCampaigns + * @throws ApiException if fails to make API call + */ + public GetSmsCampaigns getSmsCampaigns(String status, String startDate, String endDate, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smsCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Export an SMS campaign's recipients + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @param campaignId id of the campaign (required) + * @param recipientExport Values to send for a recipient export request (optional) + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId requestSmsRecipientExport(Long campaignId, RequestSmsRecipientExport recipientExport) throws ApiException { + return this.requestSmsRecipientExport(campaignId, recipientExport, Collections.emptyMap()); + } + + + /** + * Export an SMS campaign's recipients + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @param campaignId id of the campaign (required) + * @param recipientExport Values to send for a recipient export request (optional) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId requestSmsRecipientExport(Long campaignId, RequestSmsRecipientExport recipientExport, Map additionalHeaders) throws ApiException { + Object localVarPostBody = recipientExport; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling requestSmsRecipientExport"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}/exportRecipients" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send your SMS campaign immediately + * + * @param campaignId id of the campaign (required) + * @throws ApiException if fails to make API call + */ + public void sendSmsCampaignNow(Long campaignId) throws ApiException { + this.sendSmsCampaignNow(campaignId, Collections.emptyMap()); + } + + + /** + * Send your SMS campaign immediately + * + * @param campaignId id of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendSmsCampaignNow(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendSmsCampaignNow"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}/sendNow" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Send an SMS campaign's report + * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. + * @param campaignId id of the campaign (required) + * @param sendReport Values for send a report (required) + * @throws ApiException if fails to make API call + */ + public void sendSmsReport(Long campaignId, SendReport sendReport) throws ApiException { + this.sendSmsReport(campaignId, sendReport, Collections.emptyMap()); + } + + + /** + * Send an SMS campaign's report + * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. + * @param campaignId id of the campaign (required) + * @param sendReport Values for send a report (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendSmsReport(Long campaignId, SendReport sendReport, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendReport; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendSmsReport"); + } + + // verify the required parameter 'sendReport' is set + if (sendReport == null) { + throw new ApiException(400, "Missing the required parameter 'sendReport' when calling sendSmsReport"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}/sendReport" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Send a test SMS campaign + * + * @param campaignId Id of the SMS campaign (required) + * @param sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required) + * @throws ApiException if fails to make API call + */ + public void sendTestSms(Long campaignId, SendTestSms sendTestSms) throws ApiException { + this.sendTestSms(campaignId, sendTestSms, Collections.emptyMap()); + } + + + /** + * Send a test SMS campaign + * + * @param campaignId Id of the SMS campaign (required) + * @param sendTestSms Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendTestSms(Long campaignId, SendTestSms sendTestSms, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendTestSms; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling sendTestSms"); + } + + // verify the required parameter 'sendTestSms' is set + if (sendTestSms == null) { + throw new ApiException(400, "Missing the required parameter 'sendTestSms' when calling sendTestSms"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}/sendTest" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @param updateSmsCampaign Values to update an SMS Campaign (required) + * @throws ApiException if fails to make API call + */ + public void updateSmsCampaign(Long campaignId, UpdateSmsCampaign updateSmsCampaign) throws ApiException { + this.updateSmsCampaign(campaignId, updateSmsCampaign, Collections.emptyMap()); + } + + + /** + * Update an SMS campaign + * + * @param campaignId id of the SMS campaign (required) + * @param updateSmsCampaign Values to update an SMS Campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateSmsCampaign(Long campaignId, UpdateSmsCampaign updateSmsCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateSmsCampaign; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling updateSmsCampaign"); + } + + // verify the required parameter 'updateSmsCampaign' is set + if (updateSmsCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'updateSmsCampaign' when calling updateSmsCampaign"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update a campaign's status + * + * @param campaignId id of the campaign (required) + * @param status Status of the campaign. (required) + * @throws ApiException if fails to make API call + */ + public void updateSmsCampaignStatus(Long campaignId, UpdateCampaignStatus status) throws ApiException { + this.updateSmsCampaignStatus(campaignId, status, Collections.emptyMap()); + } + + + /** + * Update a campaign's status + * + * @param campaignId id of the campaign (required) + * @param status Status of the campaign. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateSmsCampaignStatus(Long campaignId, UpdateCampaignStatus status, Map additionalHeaders) throws ApiException { + Object localVarPostBody = status; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling updateSmsCampaignStatus"); + } + + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException(400, "Missing the required parameter 'status' when calling updateSmsCampaignStatus"); + } + + // create path and map variables + String localVarPath = "/smsCampaigns/{campaignId}/status" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/TasksApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TasksApi.java new file mode 100644 index 0000000..3634c53 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TasksApi.java @@ -0,0 +1,533 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CrmTasksIdPatchRequest; +import software.xdev.brevo.model.CrmTasksPost201Response; +import software.xdev.brevo.model.CrmTasksPostRequest; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.Task; +import software.xdev.brevo.model.TaskList; +import software.xdev.brevo.model.TaskTypes; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TasksApi { + + + private ApiClient apiClient; + + public TasksApi() { + this(Configuration.getDefaultApiClient()); + } + + public TasksApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get all tasks + * + * @param filterType Filter by task type (ID) (optional) + * @param filterStatus Filter by task status (optional) + * @param filterDate Filter by date (optional) + * @param filterAssignTo Filter by assignTo id (optional) + * @param filterContacts Filter by contact ids (optional) + * @param filterDeals Filter by deals ids (optional) + * @param filterCompanies Filter by companies ids (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param sortBy The field used to sort field names. (optional) + * @return TaskList + * @throws ApiException if fails to make API call + */ + public TaskList crmTasksGet(String filterType, String filterStatus, String filterDate, String filterAssignTo, String filterContacts, String filterDeals, String filterCompanies, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort, String sortBy) throws ApiException { + return this.crmTasksGet(filterType, filterStatus, filterDate, filterAssignTo, filterContacts, filterDeals, filterCompanies, dateFrom, dateTo, offset, limit, sort, sortBy, Collections.emptyMap()); + } + + + /** + * Get all tasks + * + * @param filterType Filter by task type (ID) (optional) + * @param filterStatus Filter by task status (optional) + * @param filterDate Filter by date (optional) + * @param filterAssignTo Filter by assignTo id (optional) + * @param filterContacts Filter by contact ids (optional) + * @param filterDeals Filter by deals ids (optional) + * @param filterCompanies Filter by companies ids (optional) + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) (optional) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) (optional) + * @param offset Index of the first document of the page (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) + * @param sortBy The field used to sort field names. (optional) + * @param additionalHeaders additionalHeaders for this call + * @return TaskList + * @throws ApiException if fails to make API call + */ + public TaskList crmTasksGet(String filterType, String filterStatus, String filterDate, String filterAssignTo, String filterContacts, String filterDeals, String filterCompanies, Integer dateFrom, Integer dateTo, Long offset, Long limit, String sort, String sortBy, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/tasks"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("filter[type]", filterType)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[status]", filterStatus)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[date]", filterDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[assignTo]", filterAssignTo)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[contacts]", filterContacts)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[deals]", filterDeals)); + localVarQueryParams.addAll(apiClient.parameterToPair("filter[companies]", filterCompanies)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateFrom", dateFrom)); + localVarQueryParams.addAll(apiClient.parameterToPair("dateTo", dateTo)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a task + * + * @param id (required) + * @throws ApiException if fails to make API call + */ + public void crmTasksIdDelete(String id) throws ApiException { + this.crmTasksIdDelete(id, Collections.emptyMap()); + } + + + /** + * Delete a task + * + * @param id (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmTasksIdDelete(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmTasksIdDelete"); + } + + // create path and map variables + String localVarPath = "/crm/tasks/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a task + * + * @param id (required) + * @return Task + * @throws ApiException if fails to make API call + */ + public Task crmTasksIdGet(String id) throws ApiException { + return this.crmTasksIdGet(id, Collections.emptyMap()); + } + + + /** + * Get a task + * + * @param id (required) + * @param additionalHeaders additionalHeaders for this call + * @return Task + * @throws ApiException if fails to make API call + */ + public Task crmTasksIdGet(String id, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmTasksIdGet"); + } + + // create path and map variables + String localVarPath = "/crm/tasks/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a task + * + * @param id (required) + * @param crmTasksIdPatchRequest Updated task details. (required) + * @throws ApiException if fails to make API call + */ + public void crmTasksIdPatch(String id, CrmTasksIdPatchRequest crmTasksIdPatchRequest) throws ApiException { + this.crmTasksIdPatch(id, crmTasksIdPatchRequest, Collections.emptyMap()); + } + + + /** + * Update a task + * + * @param id (required) + * @param crmTasksIdPatchRequest Updated task details. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void crmTasksIdPatch(String id, CrmTasksIdPatchRequest crmTasksIdPatchRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = crmTasksIdPatchRequest; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling crmTasksIdPatch"); + } + + // verify the required parameter 'crmTasksIdPatchRequest' is set + if (crmTasksIdPatchRequest == null) { + throw new ApiException(400, "Missing the required parameter 'crmTasksIdPatchRequest' when calling crmTasksIdPatch"); + } + + // create path and map variables + String localVarPath = "/crm/tasks/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create a task + * + * @param crmTasksPostRequest Task name. (required) + * @return CrmTasksPost201Response + * @throws ApiException if fails to make API call + */ + public CrmTasksPost201Response crmTasksPost(CrmTasksPostRequest crmTasksPostRequest) throws ApiException { + return this.crmTasksPost(crmTasksPostRequest, Collections.emptyMap()); + } + + + /** + * Create a task + * + * @param crmTasksPostRequest Task name. (required) + * @param additionalHeaders additionalHeaders for this call + * @return CrmTasksPost201Response + * @throws ApiException if fails to make API call + */ + public CrmTasksPost201Response crmTasksPost(CrmTasksPostRequest crmTasksPostRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = crmTasksPostRequest; + + // verify the required parameter 'crmTasksPostRequest' is set + if (crmTasksPostRequest == null) { + throw new ApiException(400, "Missing the required parameter 'crmTasksPostRequest' when calling crmTasksPost"); + } + + // create path and map variables + String localVarPath = "/crm/tasks"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all task types + * + * @return TaskTypes + * @throws ApiException if fails to make API call + */ + public TaskTypes crmTasktypesGet() throws ApiException { + return this.crmTasktypesGet(Collections.emptyMap()); + } + + + /** + * Get all task types + * + * @param additionalHeaders additionalHeaders for this call + * @return TaskTypes + * @throws ApiException if fails to make API call + */ + public TaskTypes crmTasktypesGet(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crm/tasktypes"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalEmailsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalEmailsApi.java new file mode 100644 index 0000000..455fc1e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalEmailsApi.java @@ -0,0 +1,1710 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.BlockDomain; +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreateSmtpEmail; +import software.xdev.brevo.model.CreateSmtpTemplate; +import software.xdev.brevo.model.DeleteHardbounces; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetAggregatedReport; +import software.xdev.brevo.model.GetBlockedDomains; +import software.xdev.brevo.model.GetEmailEventReport; +import software.xdev.brevo.model.GetReports; +import software.xdev.brevo.model.GetScheduledEmailById200Response; +import software.xdev.brevo.model.GetSmtpTemplateOverview; +import software.xdev.brevo.model.GetSmtpTemplates; +import software.xdev.brevo.model.GetTransacBlockedContacts; +import software.xdev.brevo.model.GetTransacEmailContent; +import software.xdev.brevo.model.GetTransacEmailsList; +import java.time.LocalDate; +import software.xdev.brevo.model.PostSendFailed; +import software.xdev.brevo.model.ScheduleSmtpEmail; +import software.xdev.brevo.model.SendSmtpEmail; +import software.xdev.brevo.model.SendTestEmail; +import software.xdev.brevo.model.UpdateSmtpTemplate; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionalEmailsApi { + + + private ApiClient apiClient; + + public TransactionalEmailsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TransactionalEmailsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a new domain to the list of blocked domains + * Blocks a new domain in order to avoid messages being sent to the same + * @param blockDomain Name of the domain to be blocked (required) + * @throws ApiException if fails to make API call + */ + public void blockNewDomain(BlockDomain blockDomain) throws ApiException { + this.blockNewDomain(blockDomain, Collections.emptyMap()); + } + + + /** + * Add a new domain to the list of blocked domains + * Blocks a new domain in order to avoid messages being sent to the same + * @param blockDomain Name of the domain to be blocked (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void blockNewDomain(BlockDomain blockDomain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = blockDomain; + + // verify the required parameter 'blockDomain' is set + if (blockDomain == null) { + throw new ApiException(400, "Missing the required parameter 'blockDomain' when calling blockNewDomain"); + } + + // create path and map variables + String localVarPath = "/smtp/blockedDomains"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Create an email template + * + * @param createSmtpTemplate values to update in transactional email template (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createSmtpTemplate(CreateSmtpTemplate createSmtpTemplate) throws ApiException { + return this.createSmtpTemplate(createSmtpTemplate, Collections.emptyMap()); + } + + + /** + * Create an email template + * + * @param createSmtpTemplate values to update in transactional email template (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createSmtpTemplate(CreateSmtpTemplate createSmtpTemplate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createSmtpTemplate; + + // verify the required parameter 'createSmtpTemplate' is set + if (createSmtpTemplate == null) { + throw new ApiException(400, "Missing the required parameter 'createSmtpTemplate' when calling createSmtpTemplate"); + } + + // create path and map variables + String localVarPath = "/smtp/templates"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Unblock an existing domain from the list of blocked domains + * Unblocks an existing domain from the list of blocked domains + * @param domain The name of the domain to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteBlockedDomain(String domain) throws ApiException { + this.deleteBlockedDomain(domain, Collections.emptyMap()); + } + + + /** + * Unblock an existing domain from the list of blocked domains + * Unblocks an existing domain from the list of blocked domains + * @param domain The name of the domain to be deleted (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteBlockedDomain(String domain, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException(400, "Missing the required parameter 'domain' when calling deleteBlockedDomain"); + } + + // create path and map variables + String localVarPath = "/smtp/blockedDomains/{domain}" + .replaceAll("\\{" + "domain" + "\\}", apiClient.escapeString(domain.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete hardbounces + * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) + * @param deleteHardbounces values to delete hardbounces (optional) + * @throws ApiException if fails to make API call + */ + public void deleteHardbounces(DeleteHardbounces deleteHardbounces) throws ApiException { + this.deleteHardbounces(deleteHardbounces, Collections.emptyMap()); + } + + + /** + * Delete hardbounces + * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) + * @param deleteHardbounces values to delete hardbounces (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteHardbounces(DeleteHardbounces deleteHardbounces, Map additionalHeaders) throws ApiException { + Object localVarPostBody = deleteHardbounces; + + // create path and map variables + String localVarPath = "/smtp/deleteHardbounces"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete scheduled emails by batchId or messageId + * Delete scheduled batch of emails by batchId or single scheduled email by messageId + * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required) + * @throws ApiException if fails to make API call + */ + public void deleteScheduledEmailById(String identifier) throws ApiException { + this.deleteScheduledEmailById(identifier, Collections.emptyMap()); + } + + + /** + * Delete scheduled emails by batchId or messageId + * Delete scheduled batch of emails by batchId or single scheduled email by messageId + * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteScheduledEmailById(String identifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling deleteScheduledEmailById"); + } + + // create path and map variables + String localVarPath = "/smtp/email/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete an inactive email template + * + * @param templateId id of the template (required) + * @throws ApiException if fails to make API call + */ + public void deleteSmtpTemplate(Long templateId) throws ApiException { + this.deleteSmtpTemplate(templateId, Collections.emptyMap()); + } + + + /** + * Delete an inactive email template + * + * @param templateId id of the template (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteSmtpTemplate(Long templateId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling deleteSmtpTemplate"); + } + + // create path and map variables + String localVarPath = "/smtp/templates/{templateId}" + .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get your transactional email activity aggregated over a period of time + * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param tag Tag of the emails (optional) + * @return GetAggregatedReport + * @throws ApiException if fails to make API call + */ + public GetAggregatedReport getAggregatedSmtpReport(String startDate, String endDate, Long days, String tag) throws ApiException { + return this.getAggregatedSmtpReport(startDate, endDate, days, tag, Collections.emptyMap()); + } + + + /** + * Get your transactional email activity aggregated over a period of time + * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param tag Tag of the emails (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetAggregatedReport + * @throws ApiException if fails to make API call + */ + public GetAggregatedReport getAggregatedSmtpReport(String startDate, String endDate, Long days, String tag, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/statistics/aggregatedReport"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("tag", tag)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of blocked domains + * Get the list of blocked domains + * @return GetBlockedDomains + * @throws ApiException if fails to make API call + */ + public GetBlockedDomains getBlockedDomains() throws ApiException { + return this.getBlockedDomains(Collections.emptyMap()); + } + + + /** + * Get the list of blocked domains + * Get the list of blocked domains + * @param additionalHeaders additionalHeaders for this call + * @return GetBlockedDomains + * @throws ApiException if fails to make API call + */ + public GetBlockedDomains getBlockedDomains(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/blockedDomains"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all your transactional email activity (unaggregated events) + * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @param limit Number limitation for the result returned (optional, default to 2500) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param email Filter the report for a specific email addresses (optional) + * @param event Filter the report for a specific event type (optional) + * @param tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param messageId Filter on a specific message id (optional) + * @param templateId Filter on a specific template id (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetEmailEventReport + * @throws ApiException if fails to make API call + */ + public GetEmailEventReport getEmailEventReport(Long limit, Long offset, String startDate, String endDate, Long days, String email, String event, String tags, String messageId, Long templateId, String sort) throws ApiException { + return this.getEmailEventReport(limit, offset, startDate, endDate, days, email, event, tags, messageId, templateId, sort, Collections.emptyMap()); + } + + + /** + * Get all your transactional email activity (unaggregated events) + * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @param limit Number limitation for the result returned (optional, default to 2500) + * @param offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param email Filter the report for a specific email addresses (optional) + * @param event Filter the report for a specific event type (optional) + * @param tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param messageId Filter on a specific message id (optional) + * @param templateId Filter on a specific template id (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetEmailEventReport + * @throws ApiException if fails to make API call + */ + public GetEmailEventReport getEmailEventReport(Long limit, Long offset, String startDate, String endDate, Long days, String email, String event, String tags, String messageId, Long templateId, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/statistics/events"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("email", email)); + localVarQueryParams.addAll(apiClient.parameterToPair("event", event)); + localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPair("messageId", messageId)); + localVarQueryParams.addAll(apiClient.parameterToPair("templateId", templateId)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Fetch scheduled emails by batchId or messageId + * Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old) + * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required) + * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) + * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to desc) + * @param status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional) + * @param limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100) + * @param offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0) + * @return GetScheduledEmailById200Response + * @throws ApiException if fails to make API call + */ + public GetScheduledEmailById200Response getScheduledEmailById(String identifier, LocalDate startDate, LocalDate endDate, String sort, String status, Long limit, Long offset) throws ApiException { + return this.getScheduledEmailById(identifier, startDate, endDate, sort, status, limit, offset, Collections.emptyMap()); + } + + + /** + * Fetch scheduled emails by batchId or messageId + * Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old) + * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. (required) + * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. (optional) + * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. (optional, default to desc) + * @param status Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. (optional) + * @param limit Number of documents returned per page. Not valid when identifier is `messageId`. (optional, default to 100) + * @param offset Index of the first document on the page. Not valid when identifier is `messageId`. (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetScheduledEmailById200Response + * @throws ApiException if fails to make API call + */ + public GetScheduledEmailById200Response getScheduledEmailById(String identifier, LocalDate startDate, LocalDate endDate, String sort, String status, Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling getScheduledEmailById"); + } + + // create path and map variables + String localVarPath = "/smtp/emailStatus/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get your transactional email activity aggregated per day + * + * @param limit Number of documents returned per page (optional, default to 10) + * @param offset Index of the first document on the page (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param tag Tag of the emails (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetReports + * @throws ApiException if fails to make API call + */ + public GetReports getSmtpReport(Long limit, Long offset, String startDate, String endDate, Long days, String tag, String sort) throws ApiException { + return this.getSmtpReport(limit, offset, startDate, endDate, days, tag, sort, Collections.emptyMap()); + } + + + /** + * Get your transactional email activity aggregated per day + * + * @param limit Number of documents returned per page (optional, default to 10) + * @param offset Index of the first document on the page (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param tag Tag of the emails (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetReports + * @throws ApiException if fails to make API call + */ + public GetReports getSmtpReport(Long limit, Long offset, String startDate, String endDate, Long days, String tag, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/statistics/reports"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("tag", tag)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Returns the template information + * + * @param templateId id of the template (required) + * @return GetSmtpTemplateOverview + * @throws ApiException if fails to make API call + */ + public GetSmtpTemplateOverview getSmtpTemplate(Long templateId) throws ApiException { + return this.getSmtpTemplate(templateId, Collections.emptyMap()); + } + + + /** + * Returns the template information + * + * @param templateId id of the template (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetSmtpTemplateOverview + * @throws ApiException if fails to make API call + */ + public GetSmtpTemplateOverview getSmtpTemplate(Long templateId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling getSmtpTemplate"); + } + + // create path and map variables + String localVarPath = "/smtp/templates/{templateId}" + .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of email templates + * + * @param templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetSmtpTemplates + * @throws ApiException if fails to make API call + */ + public GetSmtpTemplates getSmtpTemplates(Boolean templateStatus, Long limit, Long offset, String sort) throws ApiException { + return this.getSmtpTemplates(templateStatus, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Get the list of email templates + * + * @param templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetSmtpTemplates + * @throws ApiException if fails to make API call + */ + public GetSmtpTemplates getSmtpTemplates(Boolean templateStatus, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/templates"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("templateStatus", templateStatus)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of blocked or unsubscribed transactional contacts + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document on the page (optional, default to 0) + * @param senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetTransacBlockedContacts + * @throws ApiException if fails to make API call + */ + public GetTransacBlockedContacts getTransacBlockedContacts(String startDate, String endDate, Long limit, Long offset, List senders, String sort) throws ApiException { + return this.getTransacBlockedContacts(startDate, endDate, limit, offset, senders, sort, Collections.emptyMap()); + } + + + /** + * Get the list of blocked or unsubscribed transactional contacts + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param limit Number of documents returned per page (optional, default to 50) + * @param offset Index of the first document on the page (optional, default to 0) + * @param senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetTransacBlockedContacts + * @throws ApiException if fails to make API call + */ + public GetTransacBlockedContacts getTransacBlockedContacts(String startDate, String endDate, Long limit, Long offset, List senders, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/blockedContacts"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "senders", senders)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the personalized content of a sent transactional email + * + * @param uuid Unique id of the transactional email that has been sent to a particular contact (required) + * @return GetTransacEmailContent + * @throws ApiException if fails to make API call + */ + public GetTransacEmailContent getTransacEmailContent(String uuid) throws ApiException { + return this.getTransacEmailContent(uuid, Collections.emptyMap()); + } + + + /** + * Get the personalized content of a sent transactional email + * + * @param uuid Unique id of the transactional email that has been sent to a particular contact (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetTransacEmailContent + * @throws ApiException if fails to make API call + */ + public GetTransacEmailContent getTransacEmailContent(String uuid, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling getTransacEmailContent"); + } + + // create path and map variables + String localVarPath = "/smtp/emails/{uuid}" + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of transactional emails on the basis of allowed filters + * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. + * @param email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional) + * @param templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional) + * @param messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param limit Number of documents returned per page (optional, default to 500) + * @param offset Index of the first document in the page (optional, default to 0) + * @return GetTransacEmailsList + * @throws ApiException if fails to make API call + */ + public GetTransacEmailsList getTransacEmailsList(String email, Long templateId, String messageId, String startDate, String endDate, String sort, Long limit, Long offset) throws ApiException { + return this.getTransacEmailsList(email, templateId, messageId, startDate, endDate, sort, limit, offset, Collections.emptyMap()); + } + + + /** + * Get the list of transactional emails on the basis of allowed filters + * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. + * @param email **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. (optional) + * @param templateId **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. (optional) + * @param messageId **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. (optional) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param limit Number of documents returned per page (optional, default to 500) + * @param offset Index of the first document in the page (optional, default to 0) + * @param additionalHeaders additionalHeaders for this call + * @return GetTransacEmailsList + * @throws ApiException if fails to make API call + */ + public GetTransacEmailsList getTransacEmailsList(String email, Long templateId, String messageId, String startDate, String endDate, String sort, Long limit, Long offset, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/smtp/emails"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("email", email)); + localVarQueryParams.addAll(apiClient.parameterToPair("templateId", templateId)); + localVarQueryParams.addAll(apiClient.parameterToPair("messageId", messageId)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send a template to your test list + * + * @param templateId Id of the template (required) + * @param sendTestEmail (required) + * @throws ApiException if fails to make API call + */ + public void sendTestTemplate(Long templateId, SendTestEmail sendTestEmail) throws ApiException { + this.sendTestTemplate(templateId, sendTestEmail, Collections.emptyMap()); + } + + + /** + * Send a template to your test list + * + * @param templateId Id of the template (required) + * @param sendTestEmail (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendTestTemplate(Long templateId, SendTestEmail sendTestEmail, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendTestEmail; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling sendTestTemplate"); + } + + // verify the required parameter 'sendTestEmail' is set + if (sendTestEmail == null) { + throw new ApiException(400, "Missing the required parameter 'sendTestEmail' when calling sendTestTemplate"); + } + + // create path and map variables + String localVarPath = "/smtp/templates/{templateId}/sendTest" + .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Send a transactional email + * + * @param sendSmtpEmail Values to send a transactional email (required) + * @return CreateSmtpEmail + * @throws ApiException if fails to make API call + */ + public CreateSmtpEmail sendTransacEmail(SendSmtpEmail sendSmtpEmail) throws ApiException { + return this.sendTransacEmail(sendSmtpEmail, Collections.emptyMap()); + } + + + /** + * Send a transactional email + * + * @param sendSmtpEmail Values to send a transactional email (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateSmtpEmail + * @throws ApiException if fails to make API call + */ + public CreateSmtpEmail sendTransacEmail(SendSmtpEmail sendSmtpEmail, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendSmtpEmail; + + // verify the required parameter 'sendSmtpEmail' is set + if (sendSmtpEmail == null) { + throw new ApiException(400, "Missing the required parameter 'sendSmtpEmail' when calling sendTransacEmail"); + } + + // create path and map variables + String localVarPath = "/smtp/email"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Unblock or resubscribe a transactional contact + * + * @param email contact email (urlencoded) to unblock. (required) + * @throws ApiException if fails to make API call + */ + public void smtpBlockedContactsEmailDelete(String email) throws ApiException { + this.smtpBlockedContactsEmailDelete(email, Collections.emptyMap()); + } + + + /** + * Unblock or resubscribe a transactional contact + * + * @param email contact email (urlencoded) to unblock. (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void smtpBlockedContactsEmailDelete(String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling smtpBlockedContactsEmailDelete"); + } + + // create path and map variables + String localVarPath = "/smtp/blockedContacts/{email}" + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Delete an SMTP transactional log + * + * @param identifier MessageId or Email of the transactional log(s) to delete (required) + * @throws ApiException if fails to make API call + */ + public void smtpLogIdentifierDelete(String identifier) throws ApiException { + this.smtpLogIdentifierDelete(identifier, Collections.emptyMap()); + } + + + /** + * Delete an SMTP transactional log + * + * @param identifier MessageId or Email of the transactional log(s) to delete (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void smtpLogIdentifierDelete(String identifier, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException(400, "Missing the required parameter 'identifier' when calling smtpLogIdentifierDelete"); + } + + // create path and map variables + String localVarPath = "/smtp/log/{identifier}" + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update an email template + * + * @param templateId id of the template (required) + * @param updateSmtpTemplate values to update in transactional email template (required) + * @throws ApiException if fails to make API call + */ + public void updateSmtpTemplate(Long templateId, UpdateSmtpTemplate updateSmtpTemplate) throws ApiException { + this.updateSmtpTemplate(templateId, updateSmtpTemplate, Collections.emptyMap()); + } + + + /** + * Update an email template + * + * @param templateId id of the template (required) + * @param updateSmtpTemplate values to update in transactional email template (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateSmtpTemplate(Long templateId, UpdateSmtpTemplate updateSmtpTemplate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateSmtpTemplate; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling updateSmtpTemplate"); + } + + // verify the required parameter 'updateSmtpTemplate' is set + if (updateSmtpTemplate == null) { + throw new ApiException(400, "Missing the required parameter 'updateSmtpTemplate' when calling updateSmtpTemplate"); + } + + // create path and map variables + String localVarPath = "/smtp/templates/{templateId}" + .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalSmsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalSmsApi.java new file mode 100644 index 0000000..f5deb0b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalSmsApi.java @@ -0,0 +1,388 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetSmsEventReport; +import software.xdev.brevo.model.GetTransacAggregatedSmsReport; +import software.xdev.brevo.model.GetTransacSmsReport; +import software.xdev.brevo.model.SendSms; +import software.xdev.brevo.model.SendTransacSms; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionalSmsApi { + + + private ApiClient apiClient; + + public TransactionalSmsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TransactionalSmsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get all your SMS activity (unaggregated events) + * + * @param limit Number of documents per page (optional, default to 50) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param offset Index of the first document of the page (optional, default to 0) + * @param days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional) + * @param phoneNumber Filter the report for a specific phone number (optional) + * @param event Filter the report for specific events (optional) + * @param tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetSmsEventReport + * @throws ApiException if fails to make API call + */ + public GetSmsEventReport getSmsEvents(Long limit, String startDate, String endDate, Long offset, Long days, String phoneNumber, String event, String tags, String sort) throws ApiException { + return this.getSmsEvents(limit, startDate, endDate, offset, days, phoneNumber, event, tags, sort, Collections.emptyMap()); + } + + + /** + * Get all your SMS activity (unaggregated events) + * + * @param limit Number of documents per page (optional, default to 50) + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param offset Index of the first document of the page (optional, default to 0) + * @param days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional) + * @param phoneNumber Filter the report for a specific phone number (optional) + * @param event Filter the report for specific events (optional) + * @param tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetSmsEventReport + * @throws ApiException if fails to make API call + */ + public GetSmsEventReport getSmsEvents(Long limit, String startDate, String endDate, Long offset, Long days, String phoneNumber, String event, String tags, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/transactionalSMS/statistics/events"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("phoneNumber", phoneNumber)); + localVarQueryParams.addAll(apiClient.parameterToPair("event", event)); + localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get your SMS activity aggregated over a period of time + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional) + * @param tag Filter on a tag (optional) + * @return GetTransacAggregatedSmsReport + * @throws ApiException if fails to make API call + */ + public GetTransacAggregatedSmsReport getTransacAggregatedSmsReport(String startDate, String endDate, Long days, String tag) throws ApiException { + return this.getTransacAggregatedSmsReport(startDate, endDate, days, tag, Collections.emptyMap()); + } + + + /** + * Get your SMS activity aggregated over a period of time + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param days Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** (optional) + * @param tag Filter on a tag (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetTransacAggregatedSmsReport + * @throws ApiException if fails to make API call + */ + public GetTransacAggregatedSmsReport getTransacAggregatedSmsReport(String startDate, String endDate, Long days, String tag, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/transactionalSMS/statistics/aggregatedReport"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("tag", tag)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get your SMS activity aggregated per day + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional) + * @param tag Filter on a tag (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetTransacSmsReport + * @throws ApiException if fails to make API call + */ + public GetTransacSmsReport getTransacSmsReport(String startDate, String endDate, Long days, String tag, String sort) throws ApiException { + return this.getTransacSmsReport(startDate, endDate, days, tag, sort, Collections.emptyMap()); + } + + + /** + * Get your SMS activity aggregated per day + * + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report (optional) + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report (optional) + * @param days Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** (optional) + * @param tag Filter on a tag (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetTransacSmsReport + * @throws ApiException if fails to make API call + */ + public GetTransacSmsReport getTransacSmsReport(String startDate, String endDate, Long days, String tag, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/transactionalSMS/statistics/reports"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("tag", tag)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send SMS message to a mobile number + * + * @param sendTransacSms Values to send a transactional SMS (required) + * @return SendSms + * @throws ApiException if fails to make API call + */ + public SendSms sendTransacSms(SendTransacSms sendTransacSms) throws ApiException { + return this.sendTransacSms(sendTransacSms, Collections.emptyMap()); + } + + + /** + * Send SMS message to a mobile number + * + * @param sendTransacSms Values to send a transactional SMS (required) + * @param additionalHeaders additionalHeaders for this call + * @return SendSms + * @throws ApiException if fails to make API call + */ + public SendSms sendTransacSms(SendTransacSms sendTransacSms, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendTransacSms; + + // verify the required parameter 'sendTransacSms' is set + if (sendTransacSms == null) { + throw new ApiException(400, "Missing the required parameter 'sendTransacSms' when calling sendTransacSms"); + } + + // create path and map variables + String localVarPath = "/transactionalSMS/sms"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalWhatsAppApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalWhatsAppApi.java new file mode 100644 index 0000000..869cc76 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/TransactionalWhatsAppApi.java @@ -0,0 +1,222 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetWhatsappEventReport; +import software.xdev.brevo.model.SendWhatsappMessage201Response; +import software.xdev.brevo.model.SendWhatsappMessageRequest; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionalWhatsAppApi { + + + private ApiClient apiClient; + + public TransactionalWhatsAppApi() { + this(Configuration.getDefaultApiClient()); + } + + public TransactionalWhatsAppApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get all your WhatsApp activity (unaggregated events) + * This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) + * @param limit Number limitation for the result returned (optional, default to 2500) + * @param offset Beginning point in the list to retrieve from (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional) + * @param event Filter the report for a specific event type (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetWhatsappEventReport + * @throws ApiException if fails to make API call + */ + public GetWhatsappEventReport getWhatsappEventReport(Long limit, Long offset, String startDate, String endDate, Long days, String contactNumber, String event, String sort) throws ApiException { + return this.getWhatsappEventReport(limit, offset, startDate, endDate, days, contactNumber, event, sort, Collections.emptyMap()); + } + + + /** + * Get all your WhatsApp activity (unaggregated events) + * This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) + * @param limit Number limitation for the result returned (optional, default to 2500) + * @param offset Beginning point in the list to retrieve from (optional, default to 0) + * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param days Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ (optional) + * @param contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) (optional) + * @param event Filter the report for a specific event type (optional) + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetWhatsappEventReport + * @throws ApiException if fails to make API call + */ + public GetWhatsappEventReport getWhatsappEventReport(Long limit, Long offset, String startDate, String endDate, Long days, String contactNumber, String event, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/whatsapp/statistics/events"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("days", days)); + localVarQueryParams.addAll(apiClient.parameterToPair("contactNumber", contactNumber)); + localVarQueryParams.addAll(apiClient.parameterToPair("event", event)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send a WhatsApp message + * This endpoint is used to send a WhatsApp message. <br/>(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) + * @param sendWhatsappMessageRequest Values to send WhatsApp message (required) + * @return SendWhatsappMessage201Response + * @throws ApiException if fails to make API call + */ + public SendWhatsappMessage201Response sendWhatsappMessage(SendWhatsappMessageRequest sendWhatsappMessageRequest) throws ApiException { + return this.sendWhatsappMessage(sendWhatsappMessageRequest, Collections.emptyMap()); + } + + + /** + * Send a WhatsApp message + * This endpoint is used to send a WhatsApp message. <br/>(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) + * @param sendWhatsappMessageRequest Values to send WhatsApp message (required) + * @param additionalHeaders additionalHeaders for this call + * @return SendWhatsappMessage201Response + * @throws ApiException if fails to make API call + */ + public SendWhatsappMessage201Response sendWhatsappMessage(SendWhatsappMessageRequest sendWhatsappMessageRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = sendWhatsappMessageRequest; + + // verify the required parameter 'sendWhatsappMessageRequest' is set + if (sendWhatsappMessageRequest == null) { + throw new ApiException(400, "Missing the required parameter 'sendWhatsappMessageRequest' when calling sendWhatsappMessage"); + } + + // create path and map variables + String localVarPath = "/whatsapp/sendMessage"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/UserApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/UserApi.java new file mode 100644 index 0000000..0d6928c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/UserApi.java @@ -0,0 +1,509 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetInvitedUsersList; +import software.xdev.brevo.model.GetUserPermission; +import software.xdev.brevo.model.Inviteuser; +import software.xdev.brevo.model.InviteuserResponse; +import software.xdev.brevo.model.PutRevokeUserPermissionResponse; +import software.xdev.brevo.model.PutresendcancelinvitationResponse; +import software.xdev.brevo.model.UpdateUserResponse; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserApi { + + + private ApiClient apiClient; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Update permission for a user + * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + * @param inviteuser Values to create an invitation (required) + * @return UpdateUserResponse + * @throws ApiException if fails to make API call + */ + public UpdateUserResponse editUserPermission(Inviteuser inviteuser) throws ApiException { + return this.editUserPermission(inviteuser, Collections.emptyMap()); + } + + + /** + * Update permission for a user + * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + * @param inviteuser Values to create an invitation (required) + * @param additionalHeaders additionalHeaders for this call + * @return UpdateUserResponse + * @throws ApiException if fails to make API call + */ + public UpdateUserResponse editUserPermission(Inviteuser inviteuser, Map additionalHeaders) throws ApiException { + Object localVarPostBody = inviteuser; + + // verify the required parameter 'inviteuser' is set + if (inviteuser == null) { + throw new ApiException(400, "Missing the required parameter 'inviteuser' when calling editUserPermission"); + } + + // create path and map variables + String localVarPath = "/organization/user/update/permissions"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get the list of all your users + * + * @return GetInvitedUsersList + * @throws ApiException if fails to make API call + */ + public GetInvitedUsersList getInvitedUsersList() throws ApiException { + return this.getInvitedUsersList(Collections.emptyMap()); + } + + + /** + * Get the list of all your users + * + * @param additionalHeaders additionalHeaders for this call + * @return GetInvitedUsersList + * @throws ApiException if fails to make API call + */ + public GetInvitedUsersList getInvitedUsersList(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/organization/invited/users"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Check user permission + * + * @param email Email of the invited user. (required) + * @return GetUserPermission + * @throws ApiException if fails to make API call + */ + public GetUserPermission getUserPermission(String email) throws ApiException { + return this.getUserPermission(email, Collections.emptyMap()); + } + + + /** + * Check user permission + * + * @param email Email of the invited user. (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetUserPermission + * @throws ApiException if fails to make API call + */ + public GetUserPermission getUserPermission(String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling getUserPermission"); + } + + // create path and map variables + String localVarPath = "/organization/user/{email}/permissions" + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send invitation to user + * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited user. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + * @param inviteuser Values to create an invitation (required) + * @return InviteuserResponse + * @throws ApiException if fails to make API call + */ + public InviteuserResponse inviteuser(Inviteuser inviteuser) throws ApiException { + return this.inviteuser(inviteuser, Collections.emptyMap()); + } + + + /** + * Send invitation to user + * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"send_schedule_suspend\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited user. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + * @param inviteuser Values to create an invitation (required) + * @param additionalHeaders additionalHeaders for this call + * @return InviteuserResponse + * @throws ApiException if fails to make API call + */ + public InviteuserResponse inviteuser(Inviteuser inviteuser, Map additionalHeaders) throws ApiException { + Object localVarPostBody = inviteuser; + + // verify the required parameter 'inviteuser' is set + if (inviteuser == null) { + throw new ApiException(400, "Missing the required parameter 'inviteuser' when calling inviteuser"); + } + + // create path and map variables + String localVarPath = "/organization/user/invitation/send"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Revoke user permission + * + * @param email Email of the invited user. (required) + * @return PutRevokeUserPermissionResponse + * @throws ApiException if fails to make API call + */ + public PutRevokeUserPermissionResponse putRevokeUserPermission(String email) throws ApiException { + return this.putRevokeUserPermission(email, Collections.emptyMap()); + } + + + /** + * Revoke user permission + * + * @param email Email of the invited user. (required) + * @param additionalHeaders additionalHeaders for this call + * @return PutRevokeUserPermissionResponse + * @throws ApiException if fails to make API call + */ + public PutRevokeUserPermissionResponse putRevokeUserPermission(String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling putRevokeUserPermission"); + } + + // create path and map variables + String localVarPath = "/organization/user/invitation/revoke/{email}" + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Resend / Cancel invitation + * + * @param action action (required) + * @param email Email of the invited user. (required) + * @return PutresendcancelinvitationResponse + * @throws ApiException if fails to make API call + */ + public PutresendcancelinvitationResponse putresendcancelinvitation(String action, String email) throws ApiException { + return this.putresendcancelinvitation(action, email, Collections.emptyMap()); + } + + + /** + * Resend / Cancel invitation + * + * @param action action (required) + * @param email Email of the invited user. (required) + * @param additionalHeaders additionalHeaders for this call + * @return PutresendcancelinvitationResponse + * @throws ApiException if fails to make API call + */ + public PutresendcancelinvitationResponse putresendcancelinvitation(String action, String email, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'action' is set + if (action == null) { + throw new ApiException(400, "Missing the required parameter 'action' when calling putresendcancelinvitation"); + } + + // verify the required parameter 'email' is set + if (email == null) { + throw new ApiException(400, "Missing the required parameter 'email' when calling putresendcancelinvitation"); + } + + // create path and map variables + String localVarPath = "/organization/user/invitation/{action}/{email}" + .replaceAll("\\{" + "action" + "\\}", apiClient.escapeString(action.toString())) + .replaceAll("\\{" + "email" + "\\}", apiClient.escapeString(email.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/WebhooksApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/WebhooksApi.java new file mode 100644 index 0000000..cbc76e7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/WebhooksApi.java @@ -0,0 +1,508 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreateWebhook; +import software.xdev.brevo.model.CreatedProcessId; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.ExportWebhooksHistoryRequest; +import software.xdev.brevo.model.GetWebhook; +import software.xdev.brevo.model.GetWebhooks; +import software.xdev.brevo.model.UpdateWebhook; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WebhooksApi { + + + private ApiClient apiClient; + + public WebhooksApi() { + this(Configuration.getDefaultApiClient()); + } + + public WebhooksApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a webhook + * + * @param createWebhook Values to create a webhook (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWebhook(CreateWebhook createWebhook) throws ApiException { + return this.createWebhook(createWebhook, Collections.emptyMap()); + } + + + /** + * Create a webhook + * + * @param createWebhook Values to create a webhook (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWebhook(CreateWebhook createWebhook, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createWebhook; + + // verify the required parameter 'createWebhook' is set + if (createWebhook == null) { + throw new ApiException(400, "Missing the required parameter 'createWebhook' when calling createWebhook"); + } + + // create path and map variables + String localVarPath = "/webhooks"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a webhook + * + * @param webhookId Id of the webhook (required) + * @throws ApiException if fails to make API call + */ + public void deleteWebhook(Long webhookId) throws ApiException { + this.deleteWebhook(webhookId, Collections.emptyMap()); + } + + + /** + * Delete a webhook + * + * @param webhookId Id of the webhook (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteWebhook(Long webhookId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException(400, "Missing the required parameter 'webhookId' when calling deleteWebhook"); + } + + // create path and map variables + String localVarPath = "/webhooks/{webhookId}" + .replaceAll("\\{" + "webhookId" + "\\}", apiClient.escapeString(webhookId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Export all webhook events + * This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL. + * @param exportWebhooksHistoryRequest Values to submit for webhooks history (required) + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId exportWebhooksHistory(ExportWebhooksHistoryRequest exportWebhooksHistoryRequest) throws ApiException { + return this.exportWebhooksHistory(exportWebhooksHistoryRequest, Collections.emptyMap()); + } + + + /** + * Export all webhook events + * This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL. + * @param exportWebhooksHistoryRequest Values to submit for webhooks history (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreatedProcessId + * @throws ApiException if fails to make API call + */ + public CreatedProcessId exportWebhooksHistory(ExportWebhooksHistoryRequest exportWebhooksHistoryRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = exportWebhooksHistoryRequest; + + // verify the required parameter 'exportWebhooksHistoryRequest' is set + if (exportWebhooksHistoryRequest == null) { + throw new ApiException(400, "Missing the required parameter 'exportWebhooksHistoryRequest' when calling exportWebhooksHistory"); + } + + // create path and map variables + String localVarPath = "/webhooks/export"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get a webhook details + * + * @param webhookId Id of the webhook (required) + * @return GetWebhook + * @throws ApiException if fails to make API call + */ + public GetWebhook getWebhook(Long webhookId) throws ApiException { + return this.getWebhook(webhookId, Collections.emptyMap()); + } + + + /** + * Get a webhook details + * + * @param webhookId Id of the webhook (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetWebhook + * @throws ApiException if fails to make API call + */ + public GetWebhook getWebhook(Long webhookId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException(400, "Missing the required parameter 'webhookId' when calling getWebhook"); + } + + // create path and map variables + String localVarPath = "/webhooks/{webhookId}" + .replaceAll("\\{" + "webhookId" + "\\}", apiClient.escapeString(webhookId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get all webhooks + * + * @param type Filter on webhook type (optional, default to transactional) + * @param sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc) + * @return GetWebhooks + * @throws ApiException if fails to make API call + */ + public GetWebhooks getWebhooks(String type, String sort) throws ApiException { + return this.getWebhooks(type, sort, Collections.emptyMap()); + } + + + /** + * Get all webhooks + * + * @param type Filter on webhook type (optional, default to transactional) + * @param sort Sort the results in the ascending/descending order of webhook creation (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetWebhooks + * @throws ApiException if fails to make API call + */ + public GetWebhooks getWebhooks(String type, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/webhooks"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Update a webhook + * + * @param webhookId Id of the webhook (required) + * @param updateWebhook Values to update a webhook (required) + * @throws ApiException if fails to make API call + */ + public void updateWebhook(Long webhookId, UpdateWebhook updateWebhook) throws ApiException { + this.updateWebhook(webhookId, updateWebhook, Collections.emptyMap()); + } + + + /** + * Update a webhook + * + * @param webhookId Id of the webhook (required) + * @param updateWebhook Values to update a webhook (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateWebhook(Long webhookId, UpdateWebhook updateWebhook, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateWebhook; + + // verify the required parameter 'webhookId' is set + if (webhookId == null) { + throw new ApiException(400, "Missing the required parameter 'webhookId' when calling updateWebhook"); + } + + // verify the required parameter 'updateWebhook' is set + if (updateWebhook == null) { + throw new ApiException(400, "Missing the required parameter 'updateWebhook' when calling updateWebhook"); + } + + // create path and map variables + String localVarPath = "/webhooks/{webhookId}" + .replaceAll("\\{" + "webhookId" + "\\}", apiClient.escapeString(webhookId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/api/WhatsAppCampaignsApi.java b/brevo-java-client/src/generated/java/software/xdev/brevo/api/WhatsAppCampaignsApi.java new file mode 100644 index 0000000..8ab625a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/api/WhatsAppCampaignsApi.java @@ -0,0 +1,742 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.api; + +import com.fasterxml.jackson.core.type.TypeReference; + +import software.xdev.brevo.client.ApiException; +import software.xdev.brevo.client.ApiClient; +import software.xdev.brevo.client.Configuration; +import software.xdev.brevo.client.Pair; + +import software.xdev.brevo.model.CreateModel; +import software.xdev.brevo.model.CreateWhatsAppCampaign; +import software.xdev.brevo.model.CreateWhatsAppTemplate; +import software.xdev.brevo.model.ErrorModel; +import software.xdev.brevo.model.GetWhatsAppConfig; +import software.xdev.brevo.model.GetWhatsappCampaignOverview; +import software.xdev.brevo.model.GetWhatsappCampaigns; +import software.xdev.brevo.model.GetWhatsappTemplates; +import software.xdev.brevo.model.UpdateWhatsAppCampaign; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WhatsAppCampaignsApi { + + + private ApiClient apiClient; + + public WhatsAppCampaignsApi() { + this(Configuration.getDefaultApiClient()); + } + + public WhatsAppCampaignsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create and Send a WhatsApp campaign + * + * @param createWhatsAppCampaign Values to create a WhatsApp Campaign (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWhatsAppCampaign(CreateWhatsAppCampaign createWhatsAppCampaign) throws ApiException { + return this.createWhatsAppCampaign(createWhatsAppCampaign, Collections.emptyMap()); + } + + + /** + * Create and Send a WhatsApp campaign + * + * @param createWhatsAppCampaign Values to create a WhatsApp Campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWhatsAppCampaign(CreateWhatsAppCampaign createWhatsAppCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createWhatsAppCampaign; + + // verify the required parameter 'createWhatsAppCampaign' is set + if (createWhatsAppCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'createWhatsAppCampaign' when calling createWhatsAppCampaign"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Create a WhatsApp template + * + * @param createWhatsAppTemplate Values to create a WhatsApp template (required) + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWhatsAppTemplate(CreateWhatsAppTemplate createWhatsAppTemplate) throws ApiException { + return this.createWhatsAppTemplate(createWhatsAppTemplate, Collections.emptyMap()); + } + + + /** + * Create a WhatsApp template + * + * @param createWhatsAppTemplate Values to create a WhatsApp template (required) + * @param additionalHeaders additionalHeaders for this call + * @return CreateModel + * @throws ApiException if fails to make API call + */ + public CreateModel createWhatsAppTemplate(CreateWhatsAppTemplate createWhatsAppTemplate, Map additionalHeaders) throws ApiException { + Object localVarPostBody = createWhatsAppTemplate; + + // verify the required parameter 'createWhatsAppTemplate' is set + if (createWhatsAppTemplate == null) { + throw new ApiException(400, "Missing the required parameter 'createWhatsAppTemplate' when calling createWhatsAppTemplate"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns/template"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Delete a WhatsApp campaign + * + * @param campaignId id of the campaign (required) + * @throws ApiException if fails to make API call + */ + public void deleteWhatsAppCampaign(Long campaignId) throws ApiException { + this.deleteWhatsAppCampaign(campaignId, Collections.emptyMap()); + } + + + /** + * Delete a WhatsApp campaign + * + * @param campaignId id of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteWhatsAppCampaign(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling deleteWhatsAppCampaign"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Get a WhatsApp campaign + * + * @param campaignId Id of the campaign (required) + * @return GetWhatsappCampaignOverview + * @throws ApiException if fails to make API call + */ + public GetWhatsappCampaignOverview getWhatsAppCampaign(Long campaignId) throws ApiException { + return this.getWhatsAppCampaign(campaignId, Collections.emptyMap()); + } + + + /** + * Get a WhatsApp campaign + * + * @param campaignId Id of the campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @return GetWhatsappCampaignOverview + * @throws ApiException if fails to make API call + */ + public GetWhatsappCampaignOverview getWhatsAppCampaign(Long campaignId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling getWhatsAppCampaign"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Return all your created WhatsApp campaigns + * + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @return GetWhatsappCampaigns + * @throws ApiException if fails to make API call + */ + public GetWhatsappCampaigns getWhatsAppCampaigns(String startDate, String endDate, Long limit, Long offset, String sort) throws ApiException { + return this.getWhatsAppCampaigns(startDate, endDate, limit, offset, sort, Collections.emptyMap()); + } + + + /** + * Return all your created WhatsApp campaigns + * + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param additionalHeaders additionalHeaders for this call + * @return GetWhatsappCampaigns + * @throws ApiException if fails to make API call + */ + public GetWhatsappCampaigns getWhatsAppCampaigns(String startDate, String endDate, Long limit, Long offset, String sort, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/whatsappCampaigns"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Get your WhatsApp API account information + * + * @return GetWhatsAppConfig + * @throws ApiException if fails to make API call + */ + public GetWhatsAppConfig getWhatsAppConfig() throws ApiException { + return this.getWhatsAppConfig(Collections.emptyMap()); + } + + + /** + * Get your WhatsApp API account information + * + * @param additionalHeaders additionalHeaders for this call + * @return GetWhatsAppConfig + * @throws ApiException if fails to make API call + */ + public GetWhatsAppConfig getWhatsAppConfig(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/whatsappCampaigns/config"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Return all your created WhatsApp templates + * + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param source source of the template (optional) + * @return GetWhatsappTemplates + * @throws ApiException if fails to make API call + */ + public GetWhatsappTemplates getWhatsAppTemplates(String startDate, String endDate, Long limit, Long offset, String sort, String source) throws ApiException { + return this.getWhatsAppTemplates(startDate, endDate, limit, offset, sort, source, Collections.emptyMap()); + } + + + /** + * Return all your created WhatsApp templates + * + * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** (optional) + * @param limit Number of documents per page (optional, default to 50) + * @param offset Index of the first document in the page (optional, default to 0) + * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed (optional, default to desc) + * @param source source of the template (optional) + * @param additionalHeaders additionalHeaders for this call + * @return GetWhatsappTemplates + * @throws ApiException if fails to make API call + */ + public GetWhatsappTemplates getWhatsAppTemplates(String startDate, String endDate, Long limit, Long offset, String sort, String source, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/whatsappCampaigns/template-list"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPair("startDate", startDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("endDate", endDate)); + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPair("source", source)); + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + + /** + * Send your WhatsApp template for approval + * + * @param templateId id of the template (required) + * @throws ApiException if fails to make API call + */ + public void sendWhatsAppTemplateApproval(Long templateId) throws ApiException { + this.sendWhatsAppTemplateApproval(templateId, Collections.emptyMap()); + } + + + /** + * Send your WhatsApp template for approval + * + * @param templateId id of the template (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void sendWhatsAppTemplateApproval(Long templateId, Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling sendWhatsAppTemplateApproval"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns/template/approval/{templateId}" + .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * Update a WhatsApp campaign + * + * @param campaignId id of the campaign (required) + * @param updateWhatsAppCampaign Values to update a WhatsApp Campaign (required) + * @throws ApiException if fails to make API call + */ + public void updateWhatsAppCampaign(Long campaignId, UpdateWhatsAppCampaign updateWhatsAppCampaign) throws ApiException { + this.updateWhatsAppCampaign(campaignId, updateWhatsAppCampaign, Collections.emptyMap()); + } + + + /** + * Update a WhatsApp campaign + * + * @param campaignId id of the campaign (required) + * @param updateWhatsAppCampaign Values to update a WhatsApp Campaign (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateWhatsAppCampaign(Long campaignId, UpdateWhatsAppCampaign updateWhatsAppCampaign, Map additionalHeaders) throws ApiException { + Object localVarPostBody = updateWhatsAppCampaign; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException(400, "Missing the required parameter 'campaignId' when calling updateWhatsAppCampaign"); + } + + // verify the required parameter 'updateWhatsAppCampaign' is set + if (updateWhatsAppCampaign == null) { + throw new ApiException(400, "Missing the required parameter 'updateWhatsAppCampaign' when calling updateWhatsAppCampaign"); + } + + // create path and map variables + String localVarPath = "/whatsappCampaigns/{campaignId}" + .replaceAll("\\{" + "campaignId" + "\\}", apiClient.escapeString(campaignId.toString())); + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api-key" }; + + apiClient.invokeAPI( + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiClient.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiClient.java new file mode 100644 index 0000000..56b35e5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiClient.java @@ -0,0 +1,1009 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.time.OffsetDateTime; +// import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JavaType; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import org.apache.hc.client5.http.cookie.BasicCookieStore; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; +import org.apache.hc.client5.http.protocol.HttpClientContext; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.io.entity.FileEntity; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; +import org.apache.hc.core5.http.message.BasicNameValuePair; + +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.function.Supplier; +import java.util.TimeZone; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.InputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.nio.file.Paths; +import java.lang.reflect.Type; +import java.net.URI; + +import java.text.DateFormat; + +import software.xdev.brevo.client.auth.Authentication; +import software.xdev.brevo.client.auth.ApiKeyAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiClient extends JavaTimeFormatter { + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String basePath = "https://api.brevo.com/v3"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://api.brevo.com/v3", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private int connectionTimeout = 0; + + private CloseableHttpClient httpClient; + private ObjectMapper objectMapper; + protected String tempFolderPath = null; + + private Map authentications; + + private int statusCode; + private Map> responseHeaders; + + private DateFormat dateFormat; + + // Methods that can have a request body + private static List bodyMethods = Arrays.asList("POST", "PUT", "DELETE", "PATCH"); + + public ApiClient(CloseableHttpClient httpClient) { + objectMapper = new ObjectMapper(); + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(new JsonNullableModule()); + objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); + + dateFormat = ApiClient.buildDefaultDateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/3.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + authentications.put("api-key", new ApiKeyAuth("header", "api-key")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + this.httpClient = httpClient; + } + + public ApiClient() { + this(HttpClients.createDefault()); + } + + public static DateFormat buildDefaultDateFormat() { + return new RFC3339DateFormat(); + } + + /** + * Returns the current object mapper used for JSON serialization/deserialization. + *

+ * Note: If you make changes to the object mapper, remember to set it back via + * setObjectMapper in order to trigger HTTP client rebuilding. + *

+ * @return Object mapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Sets the object mapper. + * + * @param objectMapper object mapper + * @return API client + */ + public ApiClient setObjectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + return this; + } + + public CloseableHttpClient getHttpClient() { + return httpClient; + } + + /** + * Sets the HTTP client. + * + * @param httpClient HTTP client + * @return API client + */ + public ApiClient setHttpClient(CloseableHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + public String getBasePath() { + return basePath; + } + + /** + * Sets the base path. + * + * @param basePath base path + * @return API client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + /** + * Sets the server. + * + * @param servers a list of server configuration + * @return API client + */ + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + /** + * Sets the server index. + * + * @param serverIndex server index + * @return API client + */ + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + /** + * Sets the server variables. + * + * @param serverVariables server variables + * @return API client + */ + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Gets the status code of the previous request + * + * @return Status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Gets the response headers of the previous request + * @return Response headers + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map of authentication + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + * @return API client + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + * @return API client + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent User agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + // TODO: implement debugging mode + this.debugging = debugging; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // Also set the date format for model (de)serialization with Date properties. + this.objectMapper.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, escapeString(parameterToString(value)))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime MIME + * @return True if MIME type is boolean + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Transforms response headers into map. + * + * @param headers HTTP headers + * @return a map of string array + */ + protected Map> transformResponseHeaders(Header[] headers) { + Map> headersMap = new HashMap<>(); + for (Header header : headers) { + List valuesList = headersMap.get(header.getName()); + if (valuesList != null) { + valuesList.add(header.getValue()); + } else { + valuesList = new ArrayList<>(); + valuesList.add(header.getValue()); + headersMap.put(header.getName(), valuesList); + } + } + return headersMap; + } + + /** + * Parse content type object from header value + */ + private ContentType getContentType(String headerValue) throws ApiException { + try { + return ContentType.parse(headerValue); + } catch (UnsupportedCharsetException e) { + throw new ApiException("Could not parse content type " + headerValue); + } + } + + /** + * Get content type of a response or null if one was not provided + */ + private String getResponseMimeType(HttpResponse response) throws ApiException { + Header contentTypeHeader = response.getFirstHeader("Content-Type"); + if (contentTypeHeader != null) { + return getContentType(contentTypeHeader.getValue()).getMimeType(); + } + return null; + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param contentType Content type + * @param formParams Form parameters + * @return Object + * @throws ApiException API exception + */ + public HttpEntity serialize(Object obj, Map formParams, ContentType contentType) throws ApiException { + String mimeType = contentType.getMimeType(); + if (isJsonMime(mimeType)) { + try { + return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8)); + } catch (JsonProcessingException e) { + throw new ApiException(e); + } + } else if (mimeType.equals(ContentType.MULTIPART_FORM_DATA.getMimeType())) { + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + for (Entry paramEntry : formParams.entrySet()) { + Object value = paramEntry.getValue(); + if (value instanceof File) { + multiPartBuilder.addBinaryBody(paramEntry.getKey(), (File) value); + } else if (value instanceof byte[]) { + multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value); + } else { + Charset charset = contentType.getCharset(); + if (charset != null) { + ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset); + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()), + customContentType); + } else { + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + } + } + } + return multiPartBuilder.build(); + } else if (mimeType.equals(ContentType.APPLICATION_FORM_URLENCODED.getMimeType())) { + List formValues = new ArrayList<>(); + for (Entry paramEntry : formParams.entrySet()) { + formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue()))); + } + return new UrlEncodedFormEntity(formValues, contentType.getCharset()); + } else { + // Handle files with unknown content type + if (obj instanceof File) { + return new FileEntity((File) obj, contentType); + } else if (obj instanceof byte[]) { + return new ByteArrayEntity((byte[]) obj, contentType); + } + throw new ApiException("Serialization for content type '" + contentType + "' not supported"); + } + } + + /** + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param valueType Return type + * @return Deserialized object + * @throws ApiException API exception + * @throws IOException IO exception + */ + @SuppressWarnings("unchecked") + public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException { + if (valueType == null) { + return null; + } + HttpEntity entity = response.getEntity(); + Type valueRawType = valueType.getType(); + if (valueRawType.equals(byte[].class)) { + return (T) EntityUtils.toByteArray(entity); + } else if (valueRawType.equals(File.class)) { + return (T) downloadFileFromResponse(response); + } + String mimeType = getResponseMimeType(response); + if (mimeType == null || isJsonMime(mimeType)) { + // Assume json if no mime type + // convert input stream to string + java.util.Scanner s = new java.util.Scanner(entity.getContent()).useDelimiter("\\A"); + String content = (String) (s.hasNext() ? s.next() : ""); + + if ("".equals(content)) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, valueType); + } else if ("text/plain".equalsIgnoreCase(mimeType)) { + // convert input stream to string + java.util.Scanner s = new java.util.Scanner(entity.getContent()).useDelimiter("\\A"); + return (T) (s.hasNext() ? s.next() : ""); + } else { + throw new ApiException( + "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", + response.getCode(), + responseHeaders, + EntityUtils.toString(entity) + ); + } + } + + private File downloadFileFromResponse(CloseableHttpResponse response) throws IOException { + Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); + String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); + File file = prepareDownloadFile(contentDisposition); + Files.copy(response.getEntity().getContent(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } + + protected File prepareDownloadFile(String contentDisposition) throws IOException { + String filename = null; + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject URL query string of the deep object parameters + * @return The full URL + */ + private String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + + final StringBuilder url = new StringBuilder(); + url.append(baseURL).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // query parameter value already escaped as part of parameterToPair + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) { + url.append(url.toString().contains("?") ? "&" : "?"); + url.append(urlQueryDeepObject); + } + + return url.toString(); + } + + protected boolean isSuccessfulStatus(int statusCode) { + return statusCode >= 200 && statusCode < 300; + } + + protected boolean isBodyAllowed(String method) { + return bodyMethods.contains(method); + } + + protected Cookie buildCookie(String key, String value, URI uri) { + BasicClientCookie cookie = new BasicClientCookie(key, value); + cookie.setDomain(uri.getHost()); + cookie.setPath("/"); + return cookie; + } + + protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { + statusCode = response.getCode(); + if (statusCode == HttpStatus.SC_NO_CONTENT) { + return null; + } + + responseHeaders = transformResponseHeaders(response.getHeaders()); + if (isSuccessfulStatus(statusCode)) { + return this.deserialize(response, returnType); + } else { + String message = EntityUtils.toString(response.getEntity()); + throw new ApiException(message, statusCode, responseHeaders, message); + } + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject A URL query string for deep object parameters + * @param body The request body object - if it is not binary, otherwise null + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType Return type + * @return The response body in type of string + * @throws ApiException API exception + */ + public T invokeAPI( + String path, + String method, + List queryParams, + List collectionQueryParams, + String urlQueryDeepObject, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + TypeReference returnType) throws ApiException { + if (body != null && !formParams.isEmpty()) { + throw new ApiException("Cannot have body and form params"); + } + + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); + + ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); + builder.setUri(url); + + if (accept != null) { + builder.addHeader("Accept", accept); + } + for (Entry keyValue : headerParams.entrySet()) { + builder.addHeader(keyValue.getKey(), keyValue.getValue()); + } + for (Map.Entry keyValue : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(keyValue.getKey())) { + builder.addHeader(keyValue.getKey(), keyValue.getValue()); + } + } + + BasicCookieStore store = new BasicCookieStore(); + for (Entry keyValue : cookieParams.entrySet()) { + store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); + } + for (Entry keyValue : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(keyValue.getKey())) { + store.addCookie(buildCookie(keyValue.getKey(), keyValue.getValue(), builder.getUri())); + } + } + + HttpClientContext context = HttpClientContext.create(); + context.setCookieStore(store); + + ContentType contentTypeObj = getContentType(contentType); + if (body != null || !formParams.isEmpty()) { + if (isBodyAllowed(method)) { + // Add entity if we have content and a valid method + builder.setEntity(serialize(body, formParams, contentTypeObj)); + } else { + throw new ApiException("method " + method + " does not support a request body"); + } + } else { + // for empty body + builder.setEntity(new StringEntity("", contentTypeObj)); + } + + try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) { + return processResponse(response, returnType); + } catch (IOException | ParseException e) { + throw new ApiException(e); + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams Query parameters + * @param headerParams Header parameters + * @param cookieParams Cookie parameters + */ + private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiException.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiException.java new file mode 100644 index 0000000..a1f076b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ApiException.java @@ -0,0 +1,102 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", responseHeaders=" + responseHeaders + + ", responseBody='" + responseBody + '\'' + + '}'; + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/Configuration.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/Configuration.java new file mode 100644 index 0000000..4b3dd66 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "3.0.0"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/JavaTimeFormatter.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/JavaTimeFormatter.java new file mode 100644 index 0000000..a176762 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/Pair.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/Pair.java new file mode 100644 index 0000000..d19e647 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/RFC3339DateFormat.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/RFC3339DateFormat.java new file mode 100644 index 0000000..2a14d3c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerConfiguration.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerConfiguration.java new file mode 100644 index 0000000..068a372 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package software.xdev.brevo.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerVariable.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerVariable.java new file mode 100644 index 0000000..8cf73f5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/ServerVariable.java @@ -0,0 +1,23 @@ +package software.xdev.brevo.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/StringUtil.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/StringUtil.java new file mode 100644 index 0000000..78dd0ea --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/ApiKeyAuth.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..4ebce13 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/ApiKeyAuth.java @@ -0,0 +1,77 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client.auth; + +import software.xdev.brevo.client.Pair; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/Authentication.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/Authentication.java new file mode 100644 index 0000000..00cbcd6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/Authentication.java @@ -0,0 +1,30 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client.auth; + +import software.xdev.brevo.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams); +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBasicAuth.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..2091c3f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBasicAuth.java @@ -0,0 +1,53 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client.auth; + +import software.xdev.brevo.client.Pair; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.util.Map; +import java.util.List; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBearerAuth.java b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000..c3a6179 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/client/auth/HttpBearerAuth.java @@ -0,0 +1,72 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.client.auth; + +import software.xdev.brevo.client.Pair; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResult.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResult.java new file mode 100644 index 0000000..20b2a98 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResult.java @@ -0,0 +1,514 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.AbTestCampaignResultClickedLinks; +import software.xdev.brevo.model.AbTestCampaignResultStatistics; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AbTestCampaignResult + */ +@JsonPropertyOrder({ + AbTestCampaignResult.JSON_PROPERTY_WINNING_VERSION, + AbTestCampaignResult.JSON_PROPERTY_WINNING_CRITERIA, + AbTestCampaignResult.JSON_PROPERTY_WINNING_SUBJECT_LINE, + AbTestCampaignResult.JSON_PROPERTY_OPEN_RATE, + AbTestCampaignResult.JSON_PROPERTY_CLICK_RATE, + AbTestCampaignResult.JSON_PROPERTY_WINNING_VERSION_RATE, + AbTestCampaignResult.JSON_PROPERTY_STATISTICS, + AbTestCampaignResult.JSON_PROPERTY_CLICKED_LINKS +}) +@JsonTypeName("abTestCampaignResult") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AbTestCampaignResult { + /** + * Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. + */ + public enum WinningVersionEnum { + NOTAVAILABLE("notAvailable"), + + PENDING("pending"), + + TIE("tie"), + + A("A"), + + B("B"); + + private String value; + + WinningVersionEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WinningVersionEnum fromValue(String value) { + for (WinningVersionEnum b : WinningVersionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_WINNING_VERSION = "winningVersion"; + private WinningVersionEnum winningVersion; + + /** + * Criteria choosen for winning version (Open/Click) + */ + public enum WinningCriteriaEnum { + OPEN("Open"), + + CLICK("Click"); + + private String value; + + WinningCriteriaEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WinningCriteriaEnum fromValue(String value) { + for (WinningCriteriaEnum b : WinningCriteriaEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_WINNING_CRITERIA = "winningCriteria"; + private WinningCriteriaEnum winningCriteria; + + public static final String JSON_PROPERTY_WINNING_SUBJECT_LINE = "winningSubjectLine"; + private String winningSubjectLine; + + public static final String JSON_PROPERTY_OPEN_RATE = "openRate"; + private String openRate; + + public static final String JSON_PROPERTY_CLICK_RATE = "clickRate"; + private String clickRate; + + public static final String JSON_PROPERTY_WINNING_VERSION_RATE = "winningVersionRate"; + private String winningVersionRate; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private AbTestCampaignResultStatistics statistics; + + public static final String JSON_PROPERTY_CLICKED_LINKS = "clickedLinks"; + private AbTestCampaignResultClickedLinks clickedLinks; + + public AbTestCampaignResult() { + } + + public AbTestCampaignResult winningVersion(WinningVersionEnum winningVersion) { + + this.winningVersion = winningVersion; + return this; + } + + /** + * Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. + * @return winningVersion + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNING_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WinningVersionEnum getWinningVersion() { + return winningVersion; + } + + + @JsonProperty(JSON_PROPERTY_WINNING_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinningVersion(WinningVersionEnum winningVersion) { + this.winningVersion = winningVersion; + } + + + public AbTestCampaignResult winningCriteria(WinningCriteriaEnum winningCriteria) { + + this.winningCriteria = winningCriteria; + return this; + } + + /** + * Criteria choosen for winning version (Open/Click) + * @return winningCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNING_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WinningCriteriaEnum getWinningCriteria() { + return winningCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNING_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinningCriteria(WinningCriteriaEnum winningCriteria) { + this.winningCriteria = winningCriteria; + } + + + public AbTestCampaignResult winningSubjectLine(String winningSubjectLine) { + + this.winningSubjectLine = winningSubjectLine; + return this; + } + + /** + * Subject Line of current winning version + * @return winningSubjectLine + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNING_SUBJECT_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinningSubjectLine() { + return winningSubjectLine; + } + + + @JsonProperty(JSON_PROPERTY_WINNING_SUBJECT_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinningSubjectLine(String winningSubjectLine) { + this.winningSubjectLine = winningSubjectLine; + } + + + public AbTestCampaignResult openRate(String openRate) { + + this.openRate = openRate; + return this; + } + + /** + * Open rate for current winning version + * @return openRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPEN_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOpenRate() { + return openRate; + } + + + @JsonProperty(JSON_PROPERTY_OPEN_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenRate(String openRate) { + this.openRate = openRate; + } + + + public AbTestCampaignResult clickRate(String clickRate) { + + this.clickRate = clickRate; + return this; + } + + /** + * Click rate for current winning version + * @return clickRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLICK_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClickRate() { + return clickRate; + } + + + @JsonProperty(JSON_PROPERTY_CLICK_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClickRate(String clickRate) { + this.clickRate = clickRate; + } + + + public AbTestCampaignResult winningVersionRate(String winningVersionRate) { + + this.winningVersionRate = winningVersionRate; + return this; + } + + /** + * Open/Click rate for the winner version + * @return winningVersionRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNING_VERSION_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinningVersionRate() { + return winningVersionRate; + } + + + @JsonProperty(JSON_PROPERTY_WINNING_VERSION_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinningVersionRate(String winningVersionRate) { + this.winningVersionRate = winningVersionRate; + } + + + public AbTestCampaignResult statistics(AbTestCampaignResultStatistics statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AbTestCampaignResultStatistics getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatistics(AbTestCampaignResultStatistics statistics) { + this.statistics = statistics; + } + + + public AbTestCampaignResult clickedLinks(AbTestCampaignResultClickedLinks clickedLinks) { + + this.clickedLinks = clickedLinks; + return this; + } + + /** + * Get clickedLinks + * @return clickedLinks + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLICKED_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AbTestCampaignResultClickedLinks getClickedLinks() { + return clickedLinks; + } + + + @JsonProperty(JSON_PROPERTY_CLICKED_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClickedLinks(AbTestCampaignResultClickedLinks clickedLinks) { + this.clickedLinks = clickedLinks; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbTestCampaignResult abTestCampaignResult = (AbTestCampaignResult) o; + return Objects.equals(this.winningVersion, abTestCampaignResult.winningVersion) && + Objects.equals(this.winningCriteria, abTestCampaignResult.winningCriteria) && + Objects.equals(this.winningSubjectLine, abTestCampaignResult.winningSubjectLine) && + Objects.equals(this.openRate, abTestCampaignResult.openRate) && + Objects.equals(this.clickRate, abTestCampaignResult.clickRate) && + Objects.equals(this.winningVersionRate, abTestCampaignResult.winningVersionRate) && + Objects.equals(this.statistics, abTestCampaignResult.statistics) && + Objects.equals(this.clickedLinks, abTestCampaignResult.clickedLinks); + } + + @Override + public int hashCode() { + return Objects.hash(winningVersion, winningCriteria, winningSubjectLine, openRate, clickRate, winningVersionRate, statistics, clickedLinks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbTestCampaignResult {\n"); + sb.append(" winningVersion: ").append(toIndentedString(winningVersion)).append("\n"); + sb.append(" winningCriteria: ").append(toIndentedString(winningCriteria)).append("\n"); + sb.append(" winningSubjectLine: ").append(toIndentedString(winningSubjectLine)).append("\n"); + sb.append(" openRate: ").append(toIndentedString(openRate)).append("\n"); + sb.append(" clickRate: ").append(toIndentedString(clickRate)).append("\n"); + sb.append(" winningVersionRate: ").append(toIndentedString(winningVersionRate)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).append("\n"); + sb.append(" clickedLinks: ").append(toIndentedString(clickedLinks)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `winningVersion` to the URL query string + if (getWinningVersion() != null) { + try { + joiner.add(String.format("%swinningVersion%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinningVersion()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winningCriteria` to the URL query string + if (getWinningCriteria() != null) { + try { + joiner.add(String.format("%swinningCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinningCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winningSubjectLine` to the URL query string + if (getWinningSubjectLine() != null) { + try { + joiner.add(String.format("%swinningSubjectLine%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinningSubjectLine()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `openRate` to the URL query string + if (getOpenRate() != null) { + try { + joiner.add(String.format("%sopenRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOpenRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clickRate` to the URL query string + if (getClickRate() != null) { + try { + joiner.add(String.format("%sclickRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClickRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winningVersionRate` to the URL query string + if (getWinningVersionRate() != null) { + try { + joiner.add(String.format("%swinningVersionRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinningVersionRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + // add `clickedLinks` to the URL query string + if (getClickedLinks() != null) { + joiner.add(getClickedLinks().toUrlQueryString(prefix + "clickedLinks" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultClickedLinks.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultClickedLinks.java new file mode 100644 index 0000000..8a39ec9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultClickedLinks.java @@ -0,0 +1,214 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.AbTestVersionClicksInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AbTestCampaignResultClickedLinks + */ +@JsonPropertyOrder({ + AbTestCampaignResultClickedLinks.JSON_PROPERTY_VERSION_A, + AbTestCampaignResultClickedLinks.JSON_PROPERTY_VERSION_B +}) +@JsonTypeName("abTestCampaignResult_clickedLinks") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AbTestCampaignResultClickedLinks { + public static final String JSON_PROPERTY_VERSION_A = "Version A"; + private List versionA = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION_B = "Version B"; + private List versionB = new ArrayList<>(); + + public AbTestCampaignResultClickedLinks() { + } + + public AbTestCampaignResultClickedLinks versionA(List versionA) { + + this.versionA = versionA; + return this; + } + + public AbTestCampaignResultClickedLinks addVersionAItem(AbTestVersionClicksInner versionAItem) { + if (this.versionA == null) { + this.versionA = new ArrayList<>(); + } + this.versionA.add(versionAItem); + return this; + } + + /** + * Information on clicked links for a particular version + * @return versionA + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION_A) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getVersionA() { + return versionA; + } + + + @JsonProperty(JSON_PROPERTY_VERSION_A) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersionA(List versionA) { + this.versionA = versionA; + } + + + public AbTestCampaignResultClickedLinks versionB(List versionB) { + + this.versionB = versionB; + return this; + } + + public AbTestCampaignResultClickedLinks addVersionBItem(AbTestVersionClicksInner versionBItem) { + if (this.versionB == null) { + this.versionB = new ArrayList<>(); + } + this.versionB.add(versionBItem); + return this; + } + + /** + * Information on clicked links for a particular version + * @return versionB + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION_B) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getVersionB() { + return versionB; + } + + + @JsonProperty(JSON_PROPERTY_VERSION_B) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersionB(List versionB) { + this.versionB = versionB; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbTestCampaignResultClickedLinks abTestCampaignResultClickedLinks = (AbTestCampaignResultClickedLinks) o; + return Objects.equals(this.versionA, abTestCampaignResultClickedLinks.versionA) && + Objects.equals(this.versionB, abTestCampaignResultClickedLinks.versionB); + } + + @Override + public int hashCode() { + return Objects.hash(versionA, versionB); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbTestCampaignResultClickedLinks {\n"); + sb.append(" versionA: ").append(toIndentedString(versionA)).append("\n"); + sb.append(" versionB: ").append(toIndentedString(versionB)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Version A` to the URL query string + if (getVersionA() != null) { + for (int i = 0; i < getVersionA().size(); i++) { + if (getVersionA().get(i) != null) { + joiner.add(getVersionA().get(i).toUrlQueryString(String.format("%sVersion A%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `Version B` to the URL query string + if (getVersionB() != null) { + for (int i = 0; i < getVersionB().size(); i++) { + if (getVersionB().get(i) != null) { + joiner.add(getVersionB().get(i).toUrlQueryString(String.format("%sVersion B%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultStatistics.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultStatistics.java new file mode 100644 index 0000000..6ea4951 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestCampaignResultStatistics.java @@ -0,0 +1,333 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.AbTestVersionStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AbTestCampaignResultStatistics + */ +@JsonPropertyOrder({ + AbTestCampaignResultStatistics.JSON_PROPERTY_OPENERS, + AbTestCampaignResultStatistics.JSON_PROPERTY_CLICKS, + AbTestCampaignResultStatistics.JSON_PROPERTY_UNSUBSCRIBED, + AbTestCampaignResultStatistics.JSON_PROPERTY_HARD_BOUNCES, + AbTestCampaignResultStatistics.JSON_PROPERTY_SOFT_BOUNCES, + AbTestCampaignResultStatistics.JSON_PROPERTY_COMPLAINTS +}) +@JsonTypeName("abTestCampaignResult_statistics") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AbTestCampaignResultStatistics { + public static final String JSON_PROPERTY_OPENERS = "openers"; + private AbTestVersionStats openers; + + public static final String JSON_PROPERTY_CLICKS = "clicks"; + private AbTestVersionStats clicks; + + public static final String JSON_PROPERTY_UNSUBSCRIBED = "unsubscribed"; + private AbTestVersionStats unsubscribed; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private AbTestVersionStats hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private AbTestVersionStats softBounces; + + public static final String JSON_PROPERTY_COMPLAINTS = "complaints"; + private AbTestVersionStats complaints; + + public AbTestCampaignResultStatistics() { + } + + public AbTestCampaignResultStatistics openers(AbTestVersionStats openers) { + + this.openers = openers; + return this; + } + + /** + * Get openers + * @return openers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPENERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getOpeners() { + return openers; + } + + + @JsonProperty(JSON_PROPERTY_OPENERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOpeners(AbTestVersionStats openers) { + this.openers = openers; + } + + + public AbTestCampaignResultStatistics clicks(AbTestVersionStats clicks) { + + this.clicks = clicks; + return this; + } + + /** + * Get clicks + * @return clicks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getClicks() { + return clicks; + } + + + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClicks(AbTestVersionStats clicks) { + this.clicks = clicks; + } + + + public AbTestCampaignResultStatistics unsubscribed(AbTestVersionStats unsubscribed) { + + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Get unsubscribed + * @return unsubscribed + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getUnsubscribed() { + return unsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnsubscribed(AbTestVersionStats unsubscribed) { + this.unsubscribed = unsubscribed; + } + + + public AbTestCampaignResultStatistics hardBounces(AbTestVersionStats hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Get hardBounces + * @return hardBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHardBounces(AbTestVersionStats hardBounces) { + this.hardBounces = hardBounces; + } + + + public AbTestCampaignResultStatistics softBounces(AbTestVersionStats softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Get softBounces + * @return softBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSoftBounces(AbTestVersionStats softBounces) { + this.softBounces = softBounces; + } + + + public AbTestCampaignResultStatistics complaints(AbTestVersionStats complaints) { + + this.complaints = complaints; + return this; + } + + /** + * Get complaints + * @return complaints + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AbTestVersionStats getComplaints() { + return complaints; + } + + + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setComplaints(AbTestVersionStats complaints) { + this.complaints = complaints; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbTestCampaignResultStatistics abTestCampaignResultStatistics = (AbTestCampaignResultStatistics) o; + return Objects.equals(this.openers, abTestCampaignResultStatistics.openers) && + Objects.equals(this.clicks, abTestCampaignResultStatistics.clicks) && + Objects.equals(this.unsubscribed, abTestCampaignResultStatistics.unsubscribed) && + Objects.equals(this.hardBounces, abTestCampaignResultStatistics.hardBounces) && + Objects.equals(this.softBounces, abTestCampaignResultStatistics.softBounces) && + Objects.equals(this.complaints, abTestCampaignResultStatistics.complaints); + } + + @Override + public int hashCode() { + return Objects.hash(openers, clicks, unsubscribed, hardBounces, softBounces, complaints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbTestCampaignResultStatistics {\n"); + sb.append(" openers: ").append(toIndentedString(openers)).append("\n"); + sb.append(" clicks: ").append(toIndentedString(clicks)).append("\n"); + sb.append(" unsubscribed: ").append(toIndentedString(unsubscribed)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" complaints: ").append(toIndentedString(complaints)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `openers` to the URL query string + if (getOpeners() != null) { + joiner.add(getOpeners().toUrlQueryString(prefix + "openers" + suffix)); + } + + // add `clicks` to the URL query string + if (getClicks() != null) { + joiner.add(getClicks().toUrlQueryString(prefix + "clicks" + suffix)); + } + + // add `unsubscribed` to the URL query string + if (getUnsubscribed() != null) { + joiner.add(getUnsubscribed().toUrlQueryString(prefix + "unsubscribed" + suffix)); + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + joiner.add(getHardBounces().toUrlQueryString(prefix + "hardBounces" + suffix)); + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + joiner.add(getSoftBounces().toUrlQueryString(prefix + "softBounces" + suffix)); + } + + // add `complaints` to the URL query string + if (getComplaints() != null) { + joiner.add(getComplaints().toUrlQueryString(prefix + "complaints" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionClicksInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionClicksInner.java new file mode 100644 index 0000000..65a6e8c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionClicksInner.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AbTestVersionClicksInner + */ +@JsonPropertyOrder({ + AbTestVersionClicksInner.JSON_PROPERTY_LINK, + AbTestVersionClicksInner.JSON_PROPERTY_CLICKS_COUNT, + AbTestVersionClicksInner.JSON_PROPERTY_CLICK_RATE +}) +@JsonTypeName("abTestVersionClicks_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AbTestVersionClicksInner { + public static final String JSON_PROPERTY_LINK = "link"; + private String link; + + public static final String JSON_PROPERTY_CLICKS_COUNT = "clicksCount"; + private Long clicksCount; + + public static final String JSON_PROPERTY_CLICK_RATE = "clickRate"; + private String clickRate; + + public AbTestVersionClicksInner() { + } + + public AbTestVersionClicksInner link(String link) { + + this.link = link; + return this; + } + + /** + * URL of the link + * @return link + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLink() { + return link; + } + + + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLink(String link) { + this.link = link; + } + + + public AbTestVersionClicksInner clicksCount(Long clicksCount) { + + this.clicksCount = clicksCount; + return this; + } + + /** + * Number of times a link is clicked + * @return clicksCount + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICKS_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getClicksCount() { + return clicksCount; + } + + + @JsonProperty(JSON_PROPERTY_CLICKS_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClicksCount(Long clicksCount) { + this.clicksCount = clicksCount; + } + + + public AbTestVersionClicksInner clickRate(String clickRate) { + + this.clickRate = clickRate; + return this; + } + + /** + * Percentage of clicks of link with respect to total clicks + * @return clickRate + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICK_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClickRate() { + return clickRate; + } + + + @JsonProperty(JSON_PROPERTY_CLICK_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClickRate(String clickRate) { + this.clickRate = clickRate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbTestVersionClicksInner abTestVersionClicksInner = (AbTestVersionClicksInner) o; + return Objects.equals(this.link, abTestVersionClicksInner.link) && + Objects.equals(this.clicksCount, abTestVersionClicksInner.clicksCount) && + Objects.equals(this.clickRate, abTestVersionClicksInner.clickRate); + } + + @Override + public int hashCode() { + return Objects.hash(link, clicksCount, clickRate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbTestVersionClicksInner {\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" clicksCount: ").append(toIndentedString(clicksCount)).append("\n"); + sb.append(" clickRate: ").append(toIndentedString(clickRate)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `link` to the URL query string + if (getLink() != null) { + try { + joiner.add(String.format("%slink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLink()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clicksCount` to the URL query string + if (getClicksCount() != null) { + try { + joiner.add(String.format("%sclicksCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClicksCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clickRate` to the URL query string + if (getClickRate() != null) { + try { + joiner.add(String.format("%sclickRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClickRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionStats.java new file mode 100644 index 0000000..e36e3d5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AbTestVersionStats.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Percentage of a particular event for both versions + */ +@JsonPropertyOrder({ + AbTestVersionStats.JSON_PROPERTY_VERSION_A, + AbTestVersionStats.JSON_PROPERTY_VERSION_B +}) +@JsonTypeName("abTestVersionStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AbTestVersionStats { + public static final String JSON_PROPERTY_VERSION_A = "Version A"; + private String versionA; + + public static final String JSON_PROPERTY_VERSION_B = "Version B"; + private String versionB; + + public AbTestVersionStats() { + } + + public AbTestVersionStats versionA(String versionA) { + + this.versionA = versionA; + return this; + } + + /** + * percentage of an event for version A + * @return versionA + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION_A) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getVersionA() { + return versionA; + } + + + @JsonProperty(JSON_PROPERTY_VERSION_A) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersionA(String versionA) { + this.versionA = versionA; + } + + + public AbTestVersionStats versionB(String versionB) { + + this.versionB = versionB; + return this; + } + + /** + * percentage of an event for version B + * @return versionB + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION_B) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getVersionB() { + return versionB; + } + + + @JsonProperty(JSON_PROPERTY_VERSION_B) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersionB(String versionB) { + this.versionB = versionB; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbTestVersionStats abTestVersionStats = (AbTestVersionStats) o; + return Objects.equals(this.versionA, abTestVersionStats.versionA) && + Objects.equals(this.versionB, abTestVersionStats.versionB); + } + + @Override + public int hashCode() { + return Objects.hash(versionA, versionB); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbTestVersionStats {\n"); + sb.append(" versionA: ").append(toIndentedString(versionA)).append("\n"); + sb.append(" versionB: ").append(toIndentedString(versionB)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Version A` to the URL query string + if (getVersionA() != null) { + try { + joiner.add(String.format("%sVersion A%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVersionA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `Version B` to the URL query string + if (getVersionB() != null) { + try { + joiner.add(String.format("%sVersion B%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVersionB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddChildDomain.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddChildDomain.java new file mode 100644 index 0000000..a05eb18 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddChildDomain.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AddChildDomain + */ +@JsonPropertyOrder({ + AddChildDomain.JSON_PROPERTY_DOMAIN +}) +@JsonTypeName("addChildDomain") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddChildDomain { + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public AddChildDomain() { + } + + public AddChildDomain domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Sender domain to add for a specific child account + * @return domain + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(String domain) { + this.domain = domain; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddChildDomain addChildDomain = (AddChildDomain) o; + return Objects.equals(this.domain, addChildDomain.domain); + } + + @Override + public int hashCode() { + return Objects.hash(domain); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddChildDomain {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByEmails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByEmails.java new file mode 100644 index 0000000..c4bf541 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByEmails.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AddContactToListByEmails + */ +@JsonPropertyOrder({ + AddContactToListByEmails.JSON_PROPERTY_EMAILS +}) +@JsonTypeName("addContactToListByEmails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddContactToListByEmails { + public static final String JSON_PROPERTY_EMAILS = "emails"; + private List emails; + + public AddContactToListByEmails() { + } + + public AddContactToListByEmails emails(List emails) { + + this.emails = emails; + return this; + } + + public AddContactToListByEmails addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + * @return emails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEmails() { + return emails; + } + + + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmails(List emails) { + this.emails = emails; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddContactToListByEmails addContactToListByEmails = (AddContactToListByEmails) o; + return Objects.equals(this.emails, addContactToListByEmails.emails); + } + + @Override + public int hashCode() { + return Objects.hash(emails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddContactToListByEmails {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emails` to the URL query string + if (getEmails() != null) { + for (int i = 0; i < getEmails().size(); i++) { + try { + joiner.add(String.format("%semails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByIDs.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByIDs.java new file mode 100644 index 0000000..f88cde1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListByIDs.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AddContactToListByIDs + */ +@JsonPropertyOrder({ + AddContactToListByIDs.JSON_PROPERTY_IDS +}) +@JsonTypeName("addContactToListByIDs") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddContactToListByIDs { + public static final String JSON_PROPERTY_IDS = "ids"; + private List ids; + + public AddContactToListByIDs() { + } + + public AddContactToListByIDs ids(List ids) { + + this.ids = ids; + return this; + } + + public AddContactToListByIDs addIdsItem(Long idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + * @return ids + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIds() { + return ids; + } + + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(List ids) { + this.ids = ids; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddContactToListByIDs addContactToListByIDs = (AddContactToListByIDs) o; + return Objects.equals(this.ids, addContactToListByIDs.ids); + } + + @Override + public int hashCode() { + return Objects.hash(ids); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddContactToListByIDs {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + try { + joiner.add(String.format("%sids%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListRequest.java new file mode 100644 index 0000000..a4caae5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddContactToListRequest.java @@ -0,0 +1,223 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.AddContactToListByEmails; +import software.xdev.brevo.model.AddContactToListByIDs; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AddContactToListRequest + */ +@JsonPropertyOrder({ + AddContactToListRequest.JSON_PROPERTY_EMAILS, + AddContactToListRequest.JSON_PROPERTY_IDS +}) +@JsonTypeName("addContactToList_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddContactToListRequest { + public static final String JSON_PROPERTY_EMAILS = "emails"; + private List emails; + + public static final String JSON_PROPERTY_IDS = "ids"; + private List ids; + + public AddContactToListRequest() { + } + + public AddContactToListRequest emails(List emails) { + + this.emails = emails; + return this; + } + + public AddContactToListRequest addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + * @return emails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEmails() { + return emails; + } + + + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmails(List emails) { + this.emails = emails; + } + + + public AddContactToListRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public AddContactToListRequest addIdsItem(Long idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + * @return ids + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIds() { + return ids; + } + + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(List ids) { + this.ids = ids; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddContactToListRequest addContactToListRequest = (AddContactToListRequest) o; + return Objects.equals(this.emails, addContactToListRequest.emails) && + Objects.equals(this.ids, addContactToListRequest.ids); + } + + @Override + public int hashCode() { + return Objects.hash(emails, ids); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddContactToListRequest {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append(" ids: ").append(toIndentedString(ids)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emails` to the URL query string + if (getEmails() != null) { + for (int i = 0; i < getEmails().size(); i++) { + try { + joiner.add(String.format("%semails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + try { + joiner.add(String.format("%sids%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddCredits.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddCredits.java new file mode 100644 index 0000000..c0b44ac --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AddCredits.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AddCredits + */ +@JsonPropertyOrder({ + AddCredits.JSON_PROPERTY_SMS, + AddCredits.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("addCredits") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddCredits { + public static final String JSON_PROPERTY_SMS = "sms"; + private Long sms; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private Long email; + + public AddCredits() { + } + + public AddCredits sms(Long sms) { + + this.sms = sms; + return this; + } + + /** + * **Required if email credits are empty.** SMS credits to be added to the child account + * @return sms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSms(Long sms) { + this.sms = sms; + } + + + public AddCredits email(Long email) { + + this.email = email; + return this; + } + + /** + * **Required if sms credits are empty.** Email credits to be added to the child account + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(Long email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddCredits addCredits = (AddCredits) o; + return Objects.equals(this.sms, addCredits.sms) && + Objects.equals(this.email, addCredits.email); + } + + @Override + public int hashCode() { + return Objects.hash(sms, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddCredits {\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/AuthenticateDomainModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AuthenticateDomainModel.java new file mode 100644 index 0000000..a7884d7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/AuthenticateDomainModel.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * AuthenticateDomainModel + */ +@JsonPropertyOrder({ + AuthenticateDomainModel.JSON_PROPERTY_DOMAIN_NAME, + AuthenticateDomainModel.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("authenticateDomainModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuthenticateDomainModel { + public static final String JSON_PROPERTY_DOMAIN_NAME = "domain_name"; + private String domainName; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public AuthenticateDomainModel() { + } + + public AuthenticateDomainModel domainName(String domainName) { + + this.domainName = domainName; + return this; + } + + /** + * Domain + * @return domainName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomainName() { + return domainName; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + + public AuthenticateDomainModel message(String message) { + + this.message = message; + return this; + } + + /** + * Success message + * @return message + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticateDomainModel authenticateDomainModel = (AuthenticateDomainModel) o; + return Objects.equals(this.domainName, authenticateDomainModel.domainName) && + Objects.equals(this.message, authenticateDomainModel.message); + } + + @Override + public int hashCode() { + return Objects.hash(domainName, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticateDomainModel {\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain_name` to the URL query string + if (getDomainName() != null) { + try { + joiner.add(String.format("%sdomain_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomainName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/BlockDomain.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/BlockDomain.java new file mode 100644 index 0000000..ce6f159 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/BlockDomain.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * BlockDomain + */ +@JsonPropertyOrder({ + BlockDomain.JSON_PROPERTY_DOMAIN +}) +@JsonTypeName("blockDomain") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BlockDomain { + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public BlockDomain() { + } + + public BlockDomain domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * name of the domain to be blocked + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlockDomain blockDomain = (BlockDomain) o; + return Objects.equals(this.domain, blockDomain.domain); + } + + @Override + public int hashCode() { + return Objects.hash(domain); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BlockDomain {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesIdPatchRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesIdPatchRequest.java new file mode 100644 index 0000000..6c00ac7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesIdPatchRequest.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CompaniesIdPatchRequest + */ +@JsonPropertyOrder({ + CompaniesIdPatchRequest.JSON_PROPERTY_NAME, + CompaniesIdPatchRequest.JSON_PROPERTY_ATTRIBUTES, + CompaniesIdPatchRequest.JSON_PROPERTY_COUNTRY_CODE +}) +@JsonTypeName("_companies__id__patch_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesIdPatchRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; + private Long countryCode; + + public CompaniesIdPatchRequest() { + } + + public CompaniesIdPatchRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of company + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CompaniesIdPatchRequest attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Attributes for company update + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + + public CompaniesIdPatchRequest countryCode(Long countryCode) { + + this.countryCode = countryCode; + return this; + } + + /** + * Country code if phone_number is passed in attributes. + * @return countryCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCountryCode() { + return countryCode; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryCode(Long countryCode) { + this.countryCode = countryCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompaniesIdPatchRequest companiesIdPatchRequest = (CompaniesIdPatchRequest) o; + return Objects.equals(this.name, companiesIdPatchRequest.name) && + Objects.equals(this.attributes, companiesIdPatchRequest.attributes) && + Objects.equals(this.countryCode, companiesIdPatchRequest.countryCode); + } + + @Override + public int hashCode() { + return Objects.hash(name, attributes, countryCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompaniesIdPatchRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `countryCode` to the URL query string + if (getCountryCode() != null) { + try { + joiner.add(String.format("%scountryCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCountryCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesLinkUnlinkIdPatchRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesLinkUnlinkIdPatchRequest.java new file mode 100644 index 0000000..f700812 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesLinkUnlinkIdPatchRequest.java @@ -0,0 +1,329 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CompaniesLinkUnlinkIdPatchRequest + */ +@JsonPropertyOrder({ + CompaniesLinkUnlinkIdPatchRequest.JSON_PROPERTY_LINK_CONTACT_IDS, + CompaniesLinkUnlinkIdPatchRequest.JSON_PROPERTY_UNLINK_CONTACT_IDS, + CompaniesLinkUnlinkIdPatchRequest.JSON_PROPERTY_LINK_DEALS_IDS, + CompaniesLinkUnlinkIdPatchRequest.JSON_PROPERTY_UNLINK_DEALS_IDS +}) +@JsonTypeName("_companies_link_unlink__id__patch_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesLinkUnlinkIdPatchRequest { + public static final String JSON_PROPERTY_LINK_CONTACT_IDS = "linkContactIds"; + private List linkContactIds; + + public static final String JSON_PROPERTY_UNLINK_CONTACT_IDS = "unlinkContactIds"; + private List unlinkContactIds; + + public static final String JSON_PROPERTY_LINK_DEALS_IDS = "linkDealsIds"; + private List linkDealsIds; + + public static final String JSON_PROPERTY_UNLINK_DEALS_IDS = "unlinkDealsIds"; + private List unlinkDealsIds; + + public CompaniesLinkUnlinkIdPatchRequest() { + } + + public CompaniesLinkUnlinkIdPatchRequest linkContactIds(List linkContactIds) { + + this.linkContactIds = linkContactIds; + return this; + } + + public CompaniesLinkUnlinkIdPatchRequest addLinkContactIdsItem(Long linkContactIdsItem) { + if (this.linkContactIds == null) { + this.linkContactIds = new ArrayList<>(); + } + this.linkContactIds.add(linkContactIdsItem); + return this; + } + + /** + * Contact ids for contacts to be linked with company + * @return linkContactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkContactIds() { + return linkContactIds; + } + + + @JsonProperty(JSON_PROPERTY_LINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkContactIds(List linkContactIds) { + this.linkContactIds = linkContactIds; + } + + + public CompaniesLinkUnlinkIdPatchRequest unlinkContactIds(List unlinkContactIds) { + + this.unlinkContactIds = unlinkContactIds; + return this; + } + + public CompaniesLinkUnlinkIdPatchRequest addUnlinkContactIdsItem(Long unlinkContactIdsItem) { + if (this.unlinkContactIds == null) { + this.unlinkContactIds = new ArrayList<>(); + } + this.unlinkContactIds.add(unlinkContactIdsItem); + return this; + } + + /** + * Contact ids for contacts to be unlinked from company + * @return unlinkContactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkContactIds() { + return unlinkContactIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkContactIds(List unlinkContactIds) { + this.unlinkContactIds = unlinkContactIds; + } + + + public CompaniesLinkUnlinkIdPatchRequest linkDealsIds(List linkDealsIds) { + + this.linkDealsIds = linkDealsIds; + return this; + } + + public CompaniesLinkUnlinkIdPatchRequest addLinkDealsIdsItem(String linkDealsIdsItem) { + if (this.linkDealsIds == null) { + this.linkDealsIds = new ArrayList<>(); + } + this.linkDealsIds.add(linkDealsIdsItem); + return this; + } + + /** + * Deal ids for deals to be linked with company + * @return linkDealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkDealsIds() { + return linkDealsIds; + } + + + @JsonProperty(JSON_PROPERTY_LINK_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkDealsIds(List linkDealsIds) { + this.linkDealsIds = linkDealsIds; + } + + + public CompaniesLinkUnlinkIdPatchRequest unlinkDealsIds(List unlinkDealsIds) { + + this.unlinkDealsIds = unlinkDealsIds; + return this; + } + + public CompaniesLinkUnlinkIdPatchRequest addUnlinkDealsIdsItem(String unlinkDealsIdsItem) { + if (this.unlinkDealsIds == null) { + this.unlinkDealsIds = new ArrayList<>(); + } + this.unlinkDealsIds.add(unlinkDealsIdsItem); + return this; + } + + /** + * Deal ids for deals to be unlinked from company + * @return unlinkDealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkDealsIds() { + return unlinkDealsIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkDealsIds(List unlinkDealsIds) { + this.unlinkDealsIds = unlinkDealsIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompaniesLinkUnlinkIdPatchRequest companiesLinkUnlinkIdPatchRequest = (CompaniesLinkUnlinkIdPatchRequest) o; + return Objects.equals(this.linkContactIds, companiesLinkUnlinkIdPatchRequest.linkContactIds) && + Objects.equals(this.unlinkContactIds, companiesLinkUnlinkIdPatchRequest.unlinkContactIds) && + Objects.equals(this.linkDealsIds, companiesLinkUnlinkIdPatchRequest.linkDealsIds) && + Objects.equals(this.unlinkDealsIds, companiesLinkUnlinkIdPatchRequest.unlinkDealsIds); + } + + @Override + public int hashCode() { + return Objects.hash(linkContactIds, unlinkContactIds, linkDealsIds, unlinkDealsIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompaniesLinkUnlinkIdPatchRequest {\n"); + sb.append(" linkContactIds: ").append(toIndentedString(linkContactIds)).append("\n"); + sb.append(" unlinkContactIds: ").append(toIndentedString(unlinkContactIds)).append("\n"); + sb.append(" linkDealsIds: ").append(toIndentedString(linkDealsIds)).append("\n"); + sb.append(" unlinkDealsIds: ").append(toIndentedString(unlinkDealsIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `linkContactIds` to the URL query string + if (getLinkContactIds() != null) { + for (int i = 0; i < getLinkContactIds().size(); i++) { + try { + joiner.add(String.format("%slinkContactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkContactIds` to the URL query string + if (getUnlinkContactIds() != null) { + for (int i = 0; i < getUnlinkContactIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkContactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `linkDealsIds` to the URL query string + if (getLinkDealsIds() != null) { + for (int i = 0; i < getLinkDealsIds().size(); i++) { + try { + joiner.add(String.format("%slinkDealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkDealsIds` to the URL query string + if (getUnlinkDealsIds() != null) { + for (int i = 0; i < getUnlinkDealsIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkDealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesList.java new file mode 100644 index 0000000..6761127 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesList.java @@ -0,0 +1,163 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.Company; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of companies + */ +@JsonPropertyOrder({ + CompaniesList.JSON_PROPERTY_ITEMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesList { + public static final String JSON_PROPERTY_ITEMS = "items"; + private List items; + + public CompaniesList() { + } + + public CompaniesList items(List items) { + + this.items = items; + return this; + } + + public CompaniesList addItemsItem(Company itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * List of compaies + * @return items + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getItems() { + return items; + } + + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompaniesList companiesList = (CompaniesList) o; + return Objects.equals(this.items, companiesList.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompaniesList {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sitems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPost200Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPost200Response.java new file mode 100644 index 0000000..0abcf92 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPost200Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Created company id + */ +@JsonPropertyOrder({ + CompaniesPost200Response.JSON_PROPERTY_ID +}) +@JsonTypeName("_companies_post_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesPost200Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CompaniesPost200Response() { + } + + public CompaniesPost200Response id(String id) { + + this.id = id; + return this; + } + + /** + * Unique company id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompaniesPost200Response companiesPost200Response = (CompaniesPost200Response) o; + return Objects.equals(this.id, companiesPost200Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompaniesPost200Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPostRequest.java new file mode 100644 index 0000000..99a4887 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompaniesPostRequest.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CompaniesPostRequest + */ +@JsonPropertyOrder({ + CompaniesPostRequest.JSON_PROPERTY_NAME, + CompaniesPostRequest.JSON_PROPERTY_ATTRIBUTES, + CompaniesPostRequest.JSON_PROPERTY_COUNTRY_CODE +}) +@JsonTypeName("_companies_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompaniesPostRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; + private Long countryCode; + + public CompaniesPostRequest() { + } + + public CompaniesPostRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of company + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CompaniesPostRequest attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Attributes for company creation + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + + public CompaniesPostRequest countryCode(Long countryCode) { + + this.countryCode = countryCode; + return this; + } + + /** + * Country code if phone_number is passed in attributes. + * @return countryCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCountryCode() { + return countryCode; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryCode(Long countryCode) { + this.countryCode = countryCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompaniesPostRequest companiesPostRequest = (CompaniesPostRequest) o; + return Objects.equals(this.name, companiesPostRequest.name) && + Objects.equals(this.attributes, companiesPostRequest.attributes) && + Objects.equals(this.countryCode, companiesPostRequest.countryCode); + } + + @Override + public int hashCode() { + return Objects.hash(name, attributes, countryCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompaniesPostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `countryCode` to the URL query string + if (getCountryCode() != null) { + try { + joiner.add(String.format("%scountryCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCountryCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Company.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Company.java new file mode 100644 index 0000000..ebfcc7d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Company.java @@ -0,0 +1,304 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Company Details + */ +@JsonPropertyOrder({ + Company.JSON_PROPERTY_ID, + Company.JSON_PROPERTY_ATTRIBUTES, + Company.JSON_PROPERTY_LINKED_CONTACTS_IDS, + Company.JSON_PROPERTY_LINKED_DEALS_IDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Company { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_LINKED_CONTACTS_IDS = "linkedContactsIds"; + private List linkedContactsIds; + + public static final String JSON_PROPERTY_LINKED_DEALS_IDS = "linkedDealsIds"; + private List linkedDealsIds; + + public Company() { + } + + public Company id(String id) { + + this.id = id; + return this; + } + + /** + * Unique comoany id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public Company attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Company attributes with values + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + + public Company linkedContactsIds(List linkedContactsIds) { + + this.linkedContactsIds = linkedContactsIds; + return this; + } + + public Company addLinkedContactsIdsItem(Integer linkedContactsIdsItem) { + if (this.linkedContactsIds == null) { + this.linkedContactsIds = new ArrayList<>(); + } + this.linkedContactsIds.add(linkedContactsIdsItem); + return this; + } + + /** + * Contact ids for contacts linked to this company + * @return linkedContactsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKED_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkedContactsIds() { + return linkedContactsIds; + } + + + @JsonProperty(JSON_PROPERTY_LINKED_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkedContactsIds(List linkedContactsIds) { + this.linkedContactsIds = linkedContactsIds; + } + + + public Company linkedDealsIds(List linkedDealsIds) { + + this.linkedDealsIds = linkedDealsIds; + return this; + } + + public Company addLinkedDealsIdsItem(String linkedDealsIdsItem) { + if (this.linkedDealsIds == null) { + this.linkedDealsIds = new ArrayList<>(); + } + this.linkedDealsIds.add(linkedDealsIdsItem); + return this; + } + + /** + * Deals ids for companies linked to this company + * @return linkedDealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKED_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkedDealsIds() { + return linkedDealsIds; + } + + + @JsonProperty(JSON_PROPERTY_LINKED_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkedDealsIds(List linkedDealsIds) { + this.linkedDealsIds = linkedDealsIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Company company = (Company) o; + return Objects.equals(this.id, company.id) && + Objects.equals(this.attributes, company.attributes) && + Objects.equals(this.linkedContactsIds, company.linkedContactsIds) && + Objects.equals(this.linkedDealsIds, company.linkedDealsIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, attributes, linkedContactsIds, linkedDealsIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Company {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" linkedContactsIds: ").append(toIndentedString(linkedContactsIds)).append("\n"); + sb.append(" linkedDealsIds: ").append(toIndentedString(linkedDealsIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `linkedContactsIds` to the URL query string + if (getLinkedContactsIds() != null) { + for (int i = 0; i < getLinkedContactsIds().size(); i++) { + try { + joiner.add(String.format("%slinkedContactsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkedContactsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `linkedDealsIds` to the URL query string + if (getLinkedDealsIds() != null) { + for (int i = 0; i < getLinkedDealsIds().size(); i++) { + try { + joiner.add(String.format("%slinkedDealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkedDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompanyAttributesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompanyAttributesInner.java new file mode 100644 index 0000000..fc4bbf8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CompanyAttributesInner.java @@ -0,0 +1,335 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of attributes + */ +@JsonPropertyOrder({ + CompanyAttributesInner.JSON_PROPERTY_INTERNAL_NAME, + CompanyAttributesInner.JSON_PROPERTY_LABEL, + CompanyAttributesInner.JSON_PROPERTY_ATTRIBUTE_TYPE_NAME, + CompanyAttributesInner.JSON_PROPERTY_ATTRIBUTE_OPTIONS, + CompanyAttributesInner.JSON_PROPERTY_IS_REQUIRED +}) +@JsonTypeName("CompanyAttributes_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompanyAttributesInner { + public static final String JSON_PROPERTY_INTERNAL_NAME = "internalName"; + private String internalName; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_ATTRIBUTE_TYPE_NAME = "attributeTypeName"; + private String attributeTypeName; + + public static final String JSON_PROPERTY_ATTRIBUTE_OPTIONS = "attributeOptions"; + private List attributeOptions; + + public static final String JSON_PROPERTY_IS_REQUIRED = "isRequired"; + private Boolean isRequired; + + public CompanyAttributesInner() { + } + + public CompanyAttributesInner internalName(String internalName) { + + this.internalName = internalName; + return this; + } + + /** + * Get internalName + * @return internalName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERNAL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInternalName() { + return internalName; + } + + + @JsonProperty(JSON_PROPERTY_INTERNAL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalName(String internalName) { + this.internalName = internalName; + } + + + public CompanyAttributesInner label(String label) { + + this.label = label; + return this; + } + + /** + * Get label + * @return label + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLabel() { + return label; + } + + + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLabel(String label) { + this.label = label; + } + + + public CompanyAttributesInner attributeTypeName(String attributeTypeName) { + + this.attributeTypeName = attributeTypeName; + return this; + } + + /** + * Get attributeTypeName + * @return attributeTypeName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_TYPE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttributeTypeName() { + return attributeTypeName; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_TYPE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeTypeName(String attributeTypeName) { + this.attributeTypeName = attributeTypeName; + } + + + public CompanyAttributesInner attributeOptions(List attributeOptions) { + + this.attributeOptions = attributeOptions; + return this; + } + + public CompanyAttributesInner addAttributeOptionsItem(Object attributeOptionsItem) { + if (this.attributeOptions == null) { + this.attributeOptions = new ArrayList<>(); + } + this.attributeOptions.add(attributeOptionsItem); + return this; + } + + /** + * Get attributeOptions + * @return attributeOptions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttributeOptions() { + return attributeOptions; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeOptions(List attributeOptions) { + this.attributeOptions = attributeOptions; + } + + + public CompanyAttributesInner isRequired(Boolean isRequired) { + + this.isRequired = isRequired; + return this; + } + + /** + * Get isRequired + * @return isRequired + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsRequired() { + return isRequired; + } + + + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRequired(Boolean isRequired) { + this.isRequired = isRequired; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompanyAttributesInner companyAttributesInner = (CompanyAttributesInner) o; + return Objects.equals(this.internalName, companyAttributesInner.internalName) && + Objects.equals(this.label, companyAttributesInner.label) && + Objects.equals(this.attributeTypeName, companyAttributesInner.attributeTypeName) && + Objects.equals(this.attributeOptions, companyAttributesInner.attributeOptions) && + Objects.equals(this.isRequired, companyAttributesInner.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash(internalName, label, attributeTypeName, attributeOptions, isRequired); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompanyAttributesInner {\n"); + sb.append(" internalName: ").append(toIndentedString(internalName)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" attributeTypeName: ").append(toIndentedString(attributeTypeName)).append("\n"); + sb.append(" attributeOptions: ").append(toIndentedString(attributeOptions)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `internalName` to the URL query string + if (getInternalName() != null) { + try { + joiner.add(String.format("%sinternalName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInternalName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `label` to the URL query string + if (getLabel() != null) { + try { + joiner.add(String.format("%slabel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLabel()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributeTypeName` to the URL query string + if (getAttributeTypeName() != null) { + try { + joiner.add(String.format("%sattributeTypeName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributeTypeName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributeOptions` to the URL query string + if (getAttributeOptions() != null) { + for (int i = 0; i < getAttributeOptions().size(); i++) { + try { + joiner.add(String.format("%sattributeOptions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getAttributeOptions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `isRequired` to the URL query string + if (getIsRequired() != null) { + try { + joiner.add(String.format("%sisRequired%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsRequired()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ComponentItems.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ComponentItems.java new file mode 100644 index 0000000..a7f7049 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ComponentItems.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ComponentItems + */ +@JsonPropertyOrder({ + ComponentItems.JSON_PROPERTY_TYPE, + ComponentItems.JSON_PROPERTY_TEXT +}) +@JsonTypeName("componentItems") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ComponentItems { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public ComponentItems() { + } + + public ComponentItems type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + + public ComponentItems text(String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(String text) { + this.text = text; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComponentItems componentItems = (ComponentItems) o; + return Objects.equals(this.type, componentItems.type) && + Objects.equals(this.text, componentItems.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComponentItems {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsAgentOnlinePingPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsAgentOnlinePingPostRequest.java new file mode 100644 index 0000000..5ced39c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsAgentOnlinePingPostRequest.java @@ -0,0 +1,325 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ConversationsAgentOnlinePingPostRequest + */ +@JsonPropertyOrder({ + ConversationsAgentOnlinePingPostRequest.JSON_PROPERTY_AGENT_ID, + ConversationsAgentOnlinePingPostRequest.JSON_PROPERTY_RECEIVED_FROM, + ConversationsAgentOnlinePingPostRequest.JSON_PROPERTY_AGENT_EMAIL, + ConversationsAgentOnlinePingPostRequest.JSON_PROPERTY_AGENT_NAME +}) +@JsonTypeName("_conversations_agentOnlinePing_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsAgentOnlinePingPostRequest { + public static final String JSON_PROPERTY_AGENT_ID = "agentId"; + private JsonNullable agentId = JsonNullable.of(null); + + public static final String JSON_PROPERTY_RECEIVED_FROM = "receivedFrom"; + private JsonNullable receivedFrom = JsonNullable.of(null); + + public static final String JSON_PROPERTY_AGENT_EMAIL = "agentEmail"; + private JsonNullable agentEmail = JsonNullable.of(null); + + public static final String JSON_PROPERTY_AGENT_NAME = "agentName"; + private JsonNullable agentName = JsonNullable.of(null); + + public ConversationsAgentOnlinePingPostRequest() { + } + + public ConversationsAgentOnlinePingPostRequest agentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + + return this; + } + + /** + * agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + * @return agentId + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentId() { + return agentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentId_JsonNullable() { + return agentId; + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + public void setAgentId_JsonNullable(JsonNullable agentId) { + this.agentId = agentId; + } + + public void setAgentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + } + + + public ConversationsAgentOnlinePingPostRequest receivedFrom(Object receivedFrom) { + this.receivedFrom = JsonNullable.of(receivedFrom); + + return this; + } + + /** + * mark your messages to distinguish messages created by you from the others. + * @return receivedFrom + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getReceivedFrom() { + return receivedFrom.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getReceivedFrom_JsonNullable() { + return receivedFrom; + } + + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + public void setReceivedFrom_JsonNullable(JsonNullable receivedFrom) { + this.receivedFrom = receivedFrom; + } + + public void setReceivedFrom(Object receivedFrom) { + this.receivedFrom = JsonNullable.of(receivedFrom); + } + + + public ConversationsAgentOnlinePingPostRequest agentEmail(Object agentEmail) { + this.agentEmail = JsonNullable.of(agentEmail); + + return this; + } + + /** + * agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. + * @return agentEmail + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentEmail() { + return agentEmail.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentEmail_JsonNullable() { + return agentEmail; + } + + @JsonProperty(JSON_PROPERTY_AGENT_EMAIL) + public void setAgentEmail_JsonNullable(JsonNullable agentEmail) { + this.agentEmail = agentEmail; + } + + public void setAgentEmail(Object agentEmail) { + this.agentEmail = JsonNullable.of(agentEmail); + } + + + public ConversationsAgentOnlinePingPostRequest agentName(Object agentName) { + this.agentName = JsonNullable.of(agentName); + + return this; + } + + /** + * agent name + * @return agentName + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentName() { + return agentName.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentName_JsonNullable() { + return agentName; + } + + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + public void setAgentName_JsonNullable(JsonNullable agentName) { + this.agentName = agentName; + } + + public void setAgentName(Object agentName) { + this.agentName = JsonNullable.of(agentName); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsAgentOnlinePingPostRequest conversationsAgentOnlinePingPostRequest = (ConversationsAgentOnlinePingPostRequest) o; + return equalsNullable(this.agentId, conversationsAgentOnlinePingPostRequest.agentId) && + equalsNullable(this.receivedFrom, conversationsAgentOnlinePingPostRequest.receivedFrom) && + equalsNullable(this.agentEmail, conversationsAgentOnlinePingPostRequest.agentEmail) && + equalsNullable(this.agentName, conversationsAgentOnlinePingPostRequest.agentName); + } + + 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(hashCodeNullable(agentId), hashCodeNullable(receivedFrom), hashCodeNullable(agentEmail), hashCodeNullable(agentName)); + } + + 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 ConversationsAgentOnlinePingPostRequest {\n"); + sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n"); + sb.append(" receivedFrom: ").append(toIndentedString(receivedFrom)).append("\n"); + sb.append(" agentEmail: ").append(toIndentedString(agentEmail)).append("\n"); + sb.append(" agentName: ").append(toIndentedString(agentName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `agentId` to the URL query string + if (getAgentId() != null) { + try { + joiner.add(String.format("%sagentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `receivedFrom` to the URL query string + if (getReceivedFrom() != null) { + try { + joiner.add(String.format("%sreceivedFrom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReceivedFrom()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentEmail` to the URL query string + if (getAgentEmail() != null) { + try { + joiner.add(String.format("%sagentEmail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentName` to the URL query string + if (getAgentName() != null) { + try { + joiner.add(String.format("%sagentName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessage.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessage.java new file mode 100644 index 0000000..a925794 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessage.java @@ -0,0 +1,561 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.ConversationsMessageFile; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * a Conversations message + */ +@JsonPropertyOrder({ + ConversationsMessage.JSON_PROPERTY_ID, + ConversationsMessage.JSON_PROPERTY_TYPE, + ConversationsMessage.JSON_PROPERTY_TEXT, + ConversationsMessage.JSON_PROPERTY_VISITOR_ID, + ConversationsMessage.JSON_PROPERTY_AGENT_ID, + ConversationsMessage.JSON_PROPERTY_AGENT_NAME, + ConversationsMessage.JSON_PROPERTY_CREATED_AT, + ConversationsMessage.JSON_PROPERTY_IS_PUSHED, + ConversationsMessage.JSON_PROPERTY_RECEIVED_FROM, + ConversationsMessage.JSON_PROPERTY_FILE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsMessage { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** + * `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. + */ + public enum TypeEnum { + AGENT("agent"), + + VISITOR("visitor"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_VISITOR_ID = "visitorId"; + private String visitorId; + + public static final String JSON_PROPERTY_AGENT_ID = "agentId"; + private String agentId; + + public static final String JSON_PROPERTY_AGENT_NAME = "agentName"; + private String agentName; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private Long createdAt; + + public static final String JSON_PROPERTY_IS_PUSHED = "isPushed"; + private Boolean isPushed; + + public static final String JSON_PROPERTY_RECEIVED_FROM = "receivedFrom"; + private String receivedFrom; + + public static final String JSON_PROPERTY_FILE = "file"; + private ConversationsMessageFile _file; + + public ConversationsMessage() { + } + + public ConversationsMessage id(String id) { + + this.id = id; + return this; + } + + /** + * Message ID. It can be used for further manipulations with the message. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public ConversationsMessage type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public ConversationsMessage text(String text) { + + this.text = text; + return this; + } + + /** + * Message text or name of the attached file + * @return text + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(String text) { + this.text = text; + } + + + public ConversationsMessage visitorId(String visitorId) { + + this.visitorId = visitorId; + return this; + } + + /** + * visitor’s ID + * @return visitorId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVisitorId() { + return visitorId; + } + + + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVisitorId(String visitorId) { + this.visitorId = visitorId; + } + + + public ConversationsMessage agentId(String agentId) { + + this.agentId = agentId; + return this; + } + + /** + * ID of the agent on whose behalf the message was sent (only in messages sent by an agent). + * @return agentId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAgentId() { + return agentId; + } + + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAgentId(String agentId) { + this.agentId = agentId; + } + + + public ConversationsMessage agentName(String agentName) { + + this.agentName = agentName; + return this; + } + + /** + * Agent’s name as displayed to the visitor. Only in the messages sent by an agent. + * @return agentName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAgentName() { + return agentName; + } + + + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAgentName(String agentName) { + this.agentName = agentName; + } + + + public ConversationsMessage createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp in milliseconds. + * minimum: 0 + * @return createdAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + + public ConversationsMessage isPushed(Boolean isPushed) { + + this.isPushed = isPushed; + return this; + } + + /** + * `true` for pushed messages + * @return isPushed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PUSHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsPushed() { + return isPushed; + } + + + @JsonProperty(JSON_PROPERTY_IS_PUSHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPushed(Boolean isPushed) { + this.isPushed = isPushed; + } + + + public ConversationsMessage receivedFrom(String receivedFrom) { + + this.receivedFrom = receivedFrom; + return this; + } + + /** + * In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. + * @return receivedFrom + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReceivedFrom() { + return receivedFrom; + } + + + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReceivedFrom(String receivedFrom) { + this.receivedFrom = receivedFrom; + } + + + public ConversationsMessage _file(ConversationsMessageFile _file) { + + this._file = _file; + return this; + } + + /** + * Get _file + * @return _file + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ConversationsMessageFile getFile() { + return _file; + } + + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ConversationsMessageFile _file) { + this._file = _file; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsMessage conversationsMessage = (ConversationsMessage) o; + return Objects.equals(this.id, conversationsMessage.id) && + Objects.equals(this.type, conversationsMessage.type) && + Objects.equals(this.text, conversationsMessage.text) && + Objects.equals(this.visitorId, conversationsMessage.visitorId) && + Objects.equals(this.agentId, conversationsMessage.agentId) && + Objects.equals(this.agentName, conversationsMessage.agentName) && + Objects.equals(this.createdAt, conversationsMessage.createdAt) && + Objects.equals(this.isPushed, conversationsMessage.isPushed) && + Objects.equals(this.receivedFrom, conversationsMessage.receivedFrom) && + Objects.equals(this._file, conversationsMessage._file); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, text, visitorId, agentId, agentName, createdAt, isPushed, receivedFrom, _file); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConversationsMessage {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" visitorId: ").append(toIndentedString(visitorId)).append("\n"); + sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n"); + sb.append(" agentName: ").append(toIndentedString(agentName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" isPushed: ").append(toIndentedString(isPushed)).append("\n"); + sb.append(" receivedFrom: ").append(toIndentedString(receivedFrom)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `visitorId` to the URL query string + if (getVisitorId() != null) { + try { + joiner.add(String.format("%svisitorId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVisitorId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentId` to the URL query string + if (getAgentId() != null) { + try { + joiner.add(String.format("%sagentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentName` to the URL query string + if (getAgentName() != null) { + try { + joiner.add(String.format("%sagentName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isPushed` to the URL query string + if (getIsPushed() != null) { + try { + joiner.add(String.format("%sisPushed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsPushed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `receivedFrom` to the URL query string + if (getReceivedFrom() != null) { + try { + joiner.add(String.format("%sreceivedFrom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReceivedFrom()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `file` to the URL query string + if (getFile() != null) { + joiner.add(getFile().toUrlQueryString(prefix + "file" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFile.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFile.java new file mode 100644 index 0000000..b3080ff --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFile.java @@ -0,0 +1,317 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.ConversationsMessageFileImageInfo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ConversationsMessageFile + */ +@JsonPropertyOrder({ + ConversationsMessageFile.JSON_PROPERTY_FILENAME, + ConversationsMessageFile.JSON_PROPERTY_SIZE, + ConversationsMessageFile.JSON_PROPERTY_IS_IMAGE, + ConversationsMessageFile.JSON_PROPERTY_URL, + ConversationsMessageFile.JSON_PROPERTY_IMAGE_INFO +}) +@JsonTypeName("ConversationsMessage_file") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsMessageFile { + public static final String JSON_PROPERTY_FILENAME = "filename"; + private String filename; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_IS_IMAGE = "isImage"; + private Boolean isImage; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_IMAGE_INFO = "imageInfo"; + private ConversationsMessageFileImageInfo imageInfo; + + public ConversationsMessageFile() { + } + + public ConversationsMessageFile filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * Name of the file + * @return filename + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFilename() { + return filename; + } + + + @JsonProperty(JSON_PROPERTY_FILENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilename(String filename) { + this.filename = filename; + } + + + public ConversationsMessageFile size(Long size) { + + this.size = size; + return this; + } + + /** + * Size in bytes + * minimum: 0 + * @return size + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(Long size) { + this.size = size; + } + + + public ConversationsMessageFile isImage(Boolean isImage) { + + this.isImage = isImage; + return this; + } + + /** + * Whether the file is an image + * @return isImage + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsImage() { + return isImage; + } + + + @JsonProperty(JSON_PROPERTY_IS_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsImage(Boolean isImage) { + this.isImage = isImage; + } + + + public ConversationsMessageFile url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the file + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public ConversationsMessageFile imageInfo(ConversationsMessageFileImageInfo imageInfo) { + + this.imageInfo = imageInfo; + return this; + } + + /** + * Get imageInfo + * @return imageInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ConversationsMessageFileImageInfo getImageInfo() { + return imageInfo; + } + + + @JsonProperty(JSON_PROPERTY_IMAGE_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageInfo(ConversationsMessageFileImageInfo imageInfo) { + this.imageInfo = imageInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsMessageFile conversationsMessageFile = (ConversationsMessageFile) o; + return Objects.equals(this.filename, conversationsMessageFile.filename) && + Objects.equals(this.size, conversationsMessageFile.size) && + Objects.equals(this.isImage, conversationsMessageFile.isImage) && + Objects.equals(this.url, conversationsMessageFile.url) && + Objects.equals(this.imageInfo, conversationsMessageFile.imageInfo); + } + + @Override + public int hashCode() { + return Objects.hash(filename, size, isImage, url, imageInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConversationsMessageFile {\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" isImage: ").append(toIndentedString(isImage)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" imageInfo: ").append(toIndentedString(imageInfo)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `filename` to the URL query string + if (getFilename() != null) { + try { + joiner.add(String.format("%sfilename%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFilename()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `size` to the URL query string + if (getSize() != null) { + try { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isImage` to the URL query string + if (getIsImage() != null) { + try { + joiner.add(String.format("%sisImage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsImage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `imageInfo` to the URL query string + if (getImageInfo() != null) { + joiner.add(getImageInfo().toUrlQueryString(prefix + "imageInfo" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFileImageInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFileImageInfo.java new file mode 100644 index 0000000..e6eef80 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessageFileImageInfo.java @@ -0,0 +1,238 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * image info is passed in case the file is an image + */ +@JsonPropertyOrder({ + ConversationsMessageFileImageInfo.JSON_PROPERTY_WIDTH, + ConversationsMessageFileImageInfo.JSON_PROPERTY_HEIGHT, + ConversationsMessageFileImageInfo.JSON_PROPERTY_PREVIEW_URL +}) +@JsonTypeName("ConversationsMessage_file_imageInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsMessageFileImageInfo { + public static final String JSON_PROPERTY_WIDTH = "width"; + private Long width; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Long height; + + public static final String JSON_PROPERTY_PREVIEW_URL = "previewUrl"; + private String previewUrl; + + public ConversationsMessageFileImageInfo() { + } + + public ConversationsMessageFileImageInfo width(Long width) { + + this.width = width; + return this; + } + + /** + * Width of the image + * minimum: 0 + * @return width + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getWidth() { + return width; + } + + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(Long width) { + this.width = width; + } + + + public ConversationsMessageFileImageInfo height(Long height) { + + this.height = height; + return this; + } + + /** + * height of the image + * minimum: 0 + * @return height + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getHeight() { + return height; + } + + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(Long height) { + this.height = height; + } + + + public ConversationsMessageFileImageInfo previewUrl(String previewUrl) { + + this.previewUrl = previewUrl; + return this; + } + + /** + * URL of the preview + * @return previewUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewUrl() { + return previewUrl; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewUrl(String previewUrl) { + this.previewUrl = previewUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsMessageFileImageInfo conversationsMessageFileImageInfo = (ConversationsMessageFileImageInfo) o; + return Objects.equals(this.width, conversationsMessageFileImageInfo.width) && + Objects.equals(this.height, conversationsMessageFileImageInfo.height) && + Objects.equals(this.previewUrl, conversationsMessageFileImageInfo.previewUrl); + } + + @Override + public int hashCode() { + return Objects.hash(width, height, previewUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConversationsMessageFileImageInfo {\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" previewUrl: ").append(toIndentedString(previewUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `width` to the URL query string + if (getWidth() != null) { + try { + joiner.add(String.format("%swidth%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWidth()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `height` to the URL query string + if (getHeight() != null) { + try { + joiner.add(String.format("%sheight%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeight()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewUrl` to the URL query string + if (getPreviewUrl() != null) { + try { + joiner.add(String.format("%spreviewUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesIdPutRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesIdPutRequest.java new file mode 100644 index 0000000..f05eedb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesIdPutRequest.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ConversationsMessagesIdPutRequest + */ +@JsonPropertyOrder({ + ConversationsMessagesIdPutRequest.JSON_PROPERTY_TEXT +}) +@JsonTypeName("_conversations_messages__id__put_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsMessagesIdPutRequest { + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public ConversationsMessagesIdPutRequest() { + } + + public ConversationsMessagesIdPutRequest text(String text) { + + this.text = text; + return this; + } + + /** + * edited message text + * @return text + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(String text) { + this.text = text; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsMessagesIdPutRequest conversationsMessagesIdPutRequest = (ConversationsMessagesIdPutRequest) o; + return Objects.equals(this.text, conversationsMessagesIdPutRequest.text); + } + + @Override + public int hashCode() { + return Objects.hash(text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConversationsMessagesIdPutRequest {\n"); + sb.append(" text: ").append(toIndentedString(text)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesPostRequest.java new file mode 100644 index 0000000..9683a64 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsMessagesPostRequest.java @@ -0,0 +1,409 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ConversationsMessagesPostRequest + */ +@JsonPropertyOrder({ + ConversationsMessagesPostRequest.JSON_PROPERTY_VISITOR_ID, + ConversationsMessagesPostRequest.JSON_PROPERTY_TEXT, + ConversationsMessagesPostRequest.JSON_PROPERTY_AGENT_ID, + ConversationsMessagesPostRequest.JSON_PROPERTY_RECEIVED_FROM, + ConversationsMessagesPostRequest.JSON_PROPERTY_AGENT_EMAIL, + ConversationsMessagesPostRequest.JSON_PROPERTY_AGENT_NAME +}) +@JsonTypeName("_conversations_messages_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsMessagesPostRequest { + public static final String JSON_PROPERTY_VISITOR_ID = "visitorId"; + private Object visitorId = null; + + public static final String JSON_PROPERTY_TEXT = "text"; + private Object text = null; + + public static final String JSON_PROPERTY_AGENT_ID = "agentId"; + private JsonNullable agentId = JsonNullable.of(null); + + public static final String JSON_PROPERTY_RECEIVED_FROM = "receivedFrom"; + private JsonNullable receivedFrom = JsonNullable.of(null); + + public static final String JSON_PROPERTY_AGENT_EMAIL = "agentEmail"; + private JsonNullable agentEmail = JsonNullable.of(null); + + public static final String JSON_PROPERTY_AGENT_NAME = "agentName"; + private JsonNullable agentName = JsonNullable.of(null); + + public ConversationsMessagesPostRequest() { + } + + public ConversationsMessagesPostRequest visitorId(Object visitorId) { + + this.visitorId = visitorId; + return this; + } + + /** + * visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> + * @return visitorId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getVisitorId() { + return visitorId; + } + + + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVisitorId(Object visitorId) { + this.visitorId = visitorId; + } + + + public ConversationsMessagesPostRequest text(Object text) { + + this.text = text; + return this; + } + + /** + * message text + * @return text + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(Object text) { + this.text = text; + } + + + public ConversationsMessagesPostRequest agentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + + return this; + } + + /** + * agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + * @return agentId + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentId() { + return agentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentId_JsonNullable() { + return agentId; + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + public void setAgentId_JsonNullable(JsonNullable agentId) { + this.agentId = agentId; + } + + public void setAgentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + } + + + public ConversationsMessagesPostRequest receivedFrom(Object receivedFrom) { + this.receivedFrom = JsonNullable.of(receivedFrom); + + return this; + } + + /** + * mark your messages to distinguish messages created by you from the others. + * @return receivedFrom + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getReceivedFrom() { + return receivedFrom.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getReceivedFrom_JsonNullable() { + return receivedFrom; + } + + @JsonProperty(JSON_PROPERTY_RECEIVED_FROM) + public void setReceivedFrom_JsonNullable(JsonNullable receivedFrom) { + this.receivedFrom = receivedFrom; + } + + public void setReceivedFrom(Object receivedFrom) { + this.receivedFrom = JsonNullable.of(receivedFrom); + } + + + public ConversationsMessagesPostRequest agentEmail(Object agentEmail) { + this.agentEmail = JsonNullable.of(agentEmail); + + return this; + } + + /** + * agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. + * @return agentEmail + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentEmail() { + return agentEmail.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentEmail_JsonNullable() { + return agentEmail; + } + + @JsonProperty(JSON_PROPERTY_AGENT_EMAIL) + public void setAgentEmail_JsonNullable(JsonNullable agentEmail) { + this.agentEmail = agentEmail; + } + + public void setAgentEmail(Object agentEmail) { + this.agentEmail = JsonNullable.of(agentEmail); + } + + + public ConversationsMessagesPostRequest agentName(Object agentName) { + this.agentName = JsonNullable.of(agentName); + + return this; + } + + /** + * agent name + * @return agentName + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentName() { + return agentName.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentName_JsonNullable() { + return agentName; + } + + @JsonProperty(JSON_PROPERTY_AGENT_NAME) + public void setAgentName_JsonNullable(JsonNullable agentName) { + this.agentName = agentName; + } + + public void setAgentName(Object agentName) { + this.agentName = JsonNullable.of(agentName); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsMessagesPostRequest conversationsMessagesPostRequest = (ConversationsMessagesPostRequest) o; + return Objects.equals(this.visitorId, conversationsMessagesPostRequest.visitorId) && + Objects.equals(this.text, conversationsMessagesPostRequest.text) && + equalsNullable(this.agentId, conversationsMessagesPostRequest.agentId) && + equalsNullable(this.receivedFrom, conversationsMessagesPostRequest.receivedFrom) && + equalsNullable(this.agentEmail, conversationsMessagesPostRequest.agentEmail) && + equalsNullable(this.agentName, conversationsMessagesPostRequest.agentName); + } + + 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(visitorId, text, hashCodeNullable(agentId), hashCodeNullable(receivedFrom), hashCodeNullable(agentEmail), hashCodeNullable(agentName)); + } + + 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 ConversationsMessagesPostRequest {\n"); + sb.append(" visitorId: ").append(toIndentedString(visitorId)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n"); + sb.append(" receivedFrom: ").append(toIndentedString(receivedFrom)).append("\n"); + sb.append(" agentEmail: ").append(toIndentedString(agentEmail)).append("\n"); + sb.append(" agentName: ").append(toIndentedString(agentName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `visitorId` to the URL query string + if (getVisitorId() != null) { + try { + joiner.add(String.format("%svisitorId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVisitorId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentId` to the URL query string + if (getAgentId() != null) { + try { + joiner.add(String.format("%sagentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `receivedFrom` to the URL query string + if (getReceivedFrom() != null) { + try { + joiner.add(String.format("%sreceivedFrom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReceivedFrom()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentEmail` to the URL query string + if (getAgentEmail() != null) { + try { + joiner.add(String.format("%sagentEmail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentName` to the URL query string + if (getAgentName() != null) { + try { + joiner.add(String.format("%sagentName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsPushedMessagesPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsPushedMessagesPostRequest.java new file mode 100644 index 0000000..c66cb8c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ConversationsPushedMessagesPostRequest.java @@ -0,0 +1,309 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ConversationsPushedMessagesPostRequest + */ +@JsonPropertyOrder({ + ConversationsPushedMessagesPostRequest.JSON_PROPERTY_VISITOR_ID, + ConversationsPushedMessagesPostRequest.JSON_PROPERTY_TEXT, + ConversationsPushedMessagesPostRequest.JSON_PROPERTY_AGENT_ID, + ConversationsPushedMessagesPostRequest.JSON_PROPERTY_GROUP_ID +}) +@JsonTypeName("_conversations_pushedMessages_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConversationsPushedMessagesPostRequest { + public static final String JSON_PROPERTY_VISITOR_ID = "visitorId"; + private Object visitorId = null; + + public static final String JSON_PROPERTY_TEXT = "text"; + private Object text = null; + + public static final String JSON_PROPERTY_AGENT_ID = "agentId"; + private JsonNullable agentId = JsonNullable.of(null); + + public static final String JSON_PROPERTY_GROUP_ID = "groupId"; + private JsonNullable groupId = JsonNullable.of(null); + + public ConversationsPushedMessagesPostRequest() { + } + + public ConversationsPushedMessagesPostRequest visitorId(Object visitorId) { + + this.visitorId = visitorId; + return this; + } + + /** + * visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a> + * @return visitorId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getVisitorId() { + return visitorId; + } + + + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVisitorId(Object visitorId) { + this.visitorId = visitorId; + } + + + public ConversationsPushedMessagesPostRequest text(Object text) { + + this.text = text; + return this; + } + + /** + * message text + * @return text + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(Object text) { + this.text = text; + } + + + public ConversationsPushedMessagesPostRequest agentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + + return this; + } + + /** + * agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. + * @return agentId + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAgentId() { + return agentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAgentId_JsonNullable() { + return agentId; + } + + @JsonProperty(JSON_PROPERTY_AGENT_ID) + public void setAgentId_JsonNullable(JsonNullable agentId) { + this.agentId = agentId; + } + + public void setAgentId(Object agentId) { + this.agentId = JsonNullable.of(agentId); + } + + + public ConversationsPushedMessagesPostRequest groupId(Object groupId) { + this.groupId = JsonNullable.of(groupId); + + return this; + } + + /** + * group ID. It can be found on group’s page. + * @return groupId + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getGroupId() { + return groupId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getGroupId_JsonNullable() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + public void setGroupId_JsonNullable(JsonNullable groupId) { + this.groupId = groupId; + } + + public void setGroupId(Object groupId) { + this.groupId = JsonNullable.of(groupId); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConversationsPushedMessagesPostRequest conversationsPushedMessagesPostRequest = (ConversationsPushedMessagesPostRequest) o; + return Objects.equals(this.visitorId, conversationsPushedMessagesPostRequest.visitorId) && + Objects.equals(this.text, conversationsPushedMessagesPostRequest.text) && + equalsNullable(this.agentId, conversationsPushedMessagesPostRequest.agentId) && + equalsNullable(this.groupId, conversationsPushedMessagesPostRequest.groupId); + } + + 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(visitorId, text, hashCodeNullable(agentId), hashCodeNullable(groupId)); + } + + 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 ConversationsPushedMessagesPostRequest {\n"); + sb.append(" visitorId: ").append(toIndentedString(visitorId)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `visitorId` to the URL query string + if (getVisitorId() != null) { + try { + joiner.add(String.format("%svisitorId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVisitorId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `agentId` to the URL query string + if (getAgentId() != null) { + try { + joiner.add(String.format("%sagentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAgentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `groupId` to the URL query string + if (getGroupId() != null) { + try { + joiner.add(String.format("%sgroupId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponse.java new file mode 100644 index 0000000..63d28fa --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponse.java @@ -0,0 +1,253 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CorporateGroupDetailsResponseGroup; +import software.xdev.brevo.model.CorporateGroupDetailsResponseSubAccountsInner; +import software.xdev.brevo.model.CorporateGroupDetailsResponseUsersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupDetailsResponse + */ +@JsonPropertyOrder({ + CorporateGroupDetailsResponse.JSON_PROPERTY_GROUP, + CorporateGroupDetailsResponse.JSON_PROPERTY_SUB_ACCOUNTS, + CorporateGroupDetailsResponse.JSON_PROPERTY_USERS +}) +@JsonTypeName("corporateGroupDetailsResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupDetailsResponse { + public static final String JSON_PROPERTY_GROUP = "group"; + private CorporateGroupDetailsResponseGroup group; + + public static final String JSON_PROPERTY_SUB_ACCOUNTS = "sub-accounts"; + private List subAccounts; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users; + + public CorporateGroupDetailsResponse() { + } + + public CorporateGroupDetailsResponse group(CorporateGroupDetailsResponseGroup group) { + + this.group = group; + return this; + } + + /** + * Get group + * @return group + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CorporateGroupDetailsResponseGroup getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(CorporateGroupDetailsResponseGroup group) { + this.group = group; + } + + + public CorporateGroupDetailsResponse subAccounts(List subAccounts) { + + this.subAccounts = subAccounts; + return this; + } + + public CorporateGroupDetailsResponse addSubAccountsItem(CorporateGroupDetailsResponseSubAccountsInner subAccountsItem) { + if (this.subAccounts == null) { + this.subAccounts = new ArrayList<>(); + } + this.subAccounts.add(subAccountsItem); + return this; + } + + /** + * Get subAccounts + * @return subAccounts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSubAccounts() { + return subAccounts; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubAccounts(List subAccounts) { + this.subAccounts = subAccounts; + } + + + public CorporateGroupDetailsResponse users(List users) { + + this.users = users; + return this; + } + + public CorporateGroupDetailsResponse addUsersItem(CorporateGroupDetailsResponseUsersInner usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupDetailsResponse corporateGroupDetailsResponse = (CorporateGroupDetailsResponse) o; + return Objects.equals(this.group, corporateGroupDetailsResponse.group) && + Objects.equals(this.subAccounts, corporateGroupDetailsResponse.subAccounts) && + Objects.equals(this.users, corporateGroupDetailsResponse.users); + } + + @Override + public int hashCode() { + return Objects.hash(group, subAccounts, users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupDetailsResponse {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" subAccounts: ").append(toIndentedString(subAccounts)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `group` to the URL query string + if (getGroup() != null) { + joiner.add(getGroup().toUrlQueryString(prefix + "group" + suffix)); + } + + // add `sub-accounts` to the URL query string + if (getSubAccounts() != null) { + for (int i = 0; i < getSubAccounts().size(); i++) { + if (getSubAccounts().get(i) != null) { + joiner.add(getSubAccounts().get(i).toUrlQueryString(String.format("%ssub-accounts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `users` to the URL query string + if (getUsers() != null) { + for (int i = 0; i < getUsers().size(); i++) { + if (getUsers().get(i) != null) { + joiner.add(getUsers().get(i).toUrlQueryString(String.format("%susers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseGroup.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseGroup.java new file mode 100644 index 0000000..8115378 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseGroup.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupDetailsResponseGroup + */ +@JsonPropertyOrder({ + CorporateGroupDetailsResponseGroup.JSON_PROPERTY_ID, + CorporateGroupDetailsResponseGroup.JSON_PROPERTY_GROUP_NAME, + CorporateGroupDetailsResponseGroup.JSON_PROPERTY_CREATED_AT +}) +@JsonTypeName("corporateGroupDetailsResponse_group") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupDetailsResponseGroup { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_GROUP_NAME = "groupName"; + private String groupName; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public CorporateGroupDetailsResponseGroup() { + } + + public CorporateGroupDetailsResponseGroup id(String id) { + + this.id = id; + return this; + } + + /** + * Group id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public CorporateGroupDetailsResponseGroup groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * Name of the group + * @return groupName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupName() { + return groupName; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + + public CorporateGroupDetailsResponseGroup createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Group creation date + * @return createdAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupDetailsResponseGroup corporateGroupDetailsResponseGroup = (CorporateGroupDetailsResponseGroup) o; + return Objects.equals(this.id, corporateGroupDetailsResponseGroup.id) && + Objects.equals(this.groupName, corporateGroupDetailsResponseGroup.groupName) && + Objects.equals(this.createdAt, corporateGroupDetailsResponseGroup.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, groupName, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupDetailsResponseGroup {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `groupName` to the URL query string + if (getGroupName() != null) { + try { + joiner.add(String.format("%sgroupName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseSubAccountsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseSubAccountsInner.java new file mode 100644 index 0000000..4e3ed75 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseSubAccountsInner.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupDetailsResponseSubAccountsInner + */ +@JsonPropertyOrder({ + CorporateGroupDetailsResponseSubAccountsInner.JSON_PROPERTY_ID, + CorporateGroupDetailsResponseSubAccountsInner.JSON_PROPERTY_COMPANY_NAME, + CorporateGroupDetailsResponseSubAccountsInner.JSON_PROPERTY_CREATED_AT +}) +@JsonTypeName("corporateGroupDetailsResponse_sub_accounts_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupDetailsResponseSubAccountsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public CorporateGroupDetailsResponseSubAccountsInner() { + } + + public CorporateGroupDetailsResponseSubAccountsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the sub-account organzation + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + + public CorporateGroupDetailsResponseSubAccountsInner companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the sub-account organzation + * @return companyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public CorporateGroupDetailsResponseSubAccountsInner createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation date of the sub-account organzation + * @return createdAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupDetailsResponseSubAccountsInner corporateGroupDetailsResponseSubAccountsInner = (CorporateGroupDetailsResponseSubAccountsInner) o; + return Objects.equals(this.id, corporateGroupDetailsResponseSubAccountsInner.id) && + Objects.equals(this.companyName, corporateGroupDetailsResponseSubAccountsInner.companyName) && + Objects.equals(this.createdAt, corporateGroupDetailsResponseSubAccountsInner.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, companyName, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupDetailsResponseSubAccountsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseUsersInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseUsersInner.java new file mode 100644 index 0000000..cc9730a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupDetailsResponseUsersInner.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupDetailsResponseUsersInner + */ +@JsonPropertyOrder({ + CorporateGroupDetailsResponseUsersInner.JSON_PROPERTY_EMAIL, + CorporateGroupDetailsResponseUsersInner.JSON_PROPERTY_LAST_NAME, + CorporateGroupDetailsResponseUsersInner.JSON_PROPERTY_FIRST_NAME +}) +@JsonTypeName("corporateGroupDetailsResponse_users_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupDetailsResponseUsersInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public CorporateGroupDetailsResponseUsersInner() { + } + + public CorporateGroupDetailsResponseUsersInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public CorporateGroupDetailsResponseUsersInner lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last name of the user + * @return lastName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public CorporateGroupDetailsResponseUsersInner firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First name of the user + * @return firstName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupDetailsResponseUsersInner corporateGroupDetailsResponseUsersInner = (CorporateGroupDetailsResponseUsersInner) o; + return Objects.equals(this.email, corporateGroupDetailsResponseUsersInner.email) && + Objects.equals(this.lastName, corporateGroupDetailsResponseUsersInner.lastName) && + Objects.equals(this.firstName, corporateGroupDetailsResponseUsersInner.firstName); + } + + @Override + public int hashCode() { + return Objects.hash(email, lastName, firstName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupDetailsResponseUsersInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupIdPutRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupIdPutRequest.java new file mode 100644 index 0000000..4b7be58 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupIdPutRequest.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupIdPutRequest + */ +@JsonPropertyOrder({ + CorporateGroupIdPutRequest.JSON_PROPERTY_GROUP_NAME, + CorporateGroupIdPutRequest.JSON_PROPERTY_SUB_ACCOUNT_IDS +}) +@JsonTypeName("_corporate_group__id__put_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupIdPutRequest { + public static final String JSON_PROPERTY_GROUP_NAME = "groupName"; + private String groupName; + + public static final String JSON_PROPERTY_SUB_ACCOUNT_IDS = "subAccountIds"; + private List subAccountIds; + + public CorporateGroupIdPutRequest() { + } + + public CorporateGroupIdPutRequest groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * The name of the group of sub-accounts + * @return groupName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupName() { + return groupName; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + + public CorporateGroupIdPutRequest subAccountIds(List subAccountIds) { + + this.subAccountIds = subAccountIds; + return this; + } + + public CorporateGroupIdPutRequest addSubAccountIdsItem(Long subAccountIdsItem) { + if (this.subAccountIds == null) { + this.subAccountIds = new ArrayList<>(); + } + this.subAccountIds.add(subAccountIdsItem); + return this; + } + + /** + * Pass the list of sub-account Ids to be included in the group + * @return subAccountIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSubAccountIds() { + return subAccountIds; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubAccountIds(List subAccountIds) { + this.subAccountIds = subAccountIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupIdPutRequest corporateGroupIdPutRequest = (CorporateGroupIdPutRequest) o; + return Objects.equals(this.groupName, corporateGroupIdPutRequest.groupName) && + Objects.equals(this.subAccountIds, corporateGroupIdPutRequest.subAccountIds); + } + + @Override + public int hashCode() { + return Objects.hash(groupName, subAccountIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupIdPutRequest {\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" subAccountIds: ").append(toIndentedString(subAccountIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `groupName` to the URL query string + if (getGroupName() != null) { + try { + joiner.add(String.format("%sgroupName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subAccountIds` to the URL query string + if (getSubAccountIds() != null) { + for (int i = 0; i < getSubAccountIds().size(); i++) { + try { + joiner.add(String.format("%ssubAccountIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSubAccountIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPost201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPost201Response.java new file mode 100644 index 0000000..37229fd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPost201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupPost201Response + */ +@JsonPropertyOrder({ + CorporateGroupPost201Response.JSON_PROPERTY_ID +}) +@JsonTypeName("_corporate_group_post_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupPost201Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CorporateGroupPost201Response() { + } + + public CorporateGroupPost201Response id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupPost201Response corporateGroupPost201Response = (CorporateGroupPost201Response) o; + return Objects.equals(this.id, corporateGroupPost201Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupPost201Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPostRequest.java new file mode 100644 index 0000000..1961b36 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupPostRequest.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupPostRequest + */ +@JsonPropertyOrder({ + CorporateGroupPostRequest.JSON_PROPERTY_GROUP_NAME, + CorporateGroupPostRequest.JSON_PROPERTY_SUB_ACCOUNT_IDS +}) +@JsonTypeName("_corporate_group_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupPostRequest { + public static final String JSON_PROPERTY_GROUP_NAME = "groupName"; + private String groupName; + + public static final String JSON_PROPERTY_SUB_ACCOUNT_IDS = "subAccountIds"; + private List subAccountIds; + + public CorporateGroupPostRequest() { + } + + public CorporateGroupPostRequest groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * The name of the group of sub-accounts + * @return groupName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGroupName() { + return groupName; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + + public CorporateGroupPostRequest subAccountIds(List subAccountIds) { + + this.subAccountIds = subAccountIds; + return this; + } + + public CorporateGroupPostRequest addSubAccountIdsItem(Long subAccountIdsItem) { + if (this.subAccountIds == null) { + this.subAccountIds = new ArrayList<>(); + } + this.subAccountIds.add(subAccountIdsItem); + return this; + } + + /** + * Pass the list of sub-account Ids to be included in the group + * @return subAccountIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSubAccountIds() { + return subAccountIds; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubAccountIds(List subAccountIds) { + this.subAccountIds = subAccountIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupPostRequest corporateGroupPostRequest = (CorporateGroupPostRequest) o; + return Objects.equals(this.groupName, corporateGroupPostRequest.groupName) && + Objects.equals(this.subAccountIds, corporateGroupPostRequest.subAccountIds); + } + + @Override + public int hashCode() { + return Objects.hash(groupName, subAccountIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupPostRequest {\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" subAccountIds: ").append(toIndentedString(subAccountIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `groupName` to the URL query string + if (getGroupName() != null) { + try { + joiner.add(String.format("%sgroupName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subAccountIds` to the URL query string + if (getSubAccountIds() != null) { + for (int i = 0; i < getSubAccountIds().size(); i++) { + try { + joiner.add(String.format("%ssubAccountIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSubAccountIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.java new file mode 100644 index 0000000..29a681b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateGroupUnlinkGroupIdSubAccountsPutRequest.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateGroupUnlinkGroupIdSubAccountsPutRequest + */ +@JsonPropertyOrder({ + CorporateGroupUnlinkGroupIdSubAccountsPutRequest.JSON_PROPERTY_SUB_ACCOUNT_IDS +}) +@JsonTypeName("_corporate_group_unlink__groupId__subAccounts_put_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateGroupUnlinkGroupIdSubAccountsPutRequest { + public static final String JSON_PROPERTY_SUB_ACCOUNT_IDS = "subAccountIds"; + private List subAccountIds = new ArrayList<>(); + + public CorporateGroupUnlinkGroupIdSubAccountsPutRequest() { + } + + public CorporateGroupUnlinkGroupIdSubAccountsPutRequest subAccountIds(List subAccountIds) { + + this.subAccountIds = subAccountIds; + return this; + } + + public CorporateGroupUnlinkGroupIdSubAccountsPutRequest addSubAccountIdsItem(Long subAccountIdsItem) { + if (this.subAccountIds == null) { + this.subAccountIds = new ArrayList<>(); + } + this.subAccountIds.add(subAccountIdsItem); + return this; + } + + /** + * List of sub-account ids + * @return subAccountIds + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSubAccountIds() { + return subAccountIds; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNT_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubAccountIds(List subAccountIds) { + this.subAccountIds = subAccountIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateGroupUnlinkGroupIdSubAccountsPutRequest corporateGroupUnlinkGroupIdSubAccountsPutRequest = (CorporateGroupUnlinkGroupIdSubAccountsPutRequest) o; + return Objects.equals(this.subAccountIds, corporateGroupUnlinkGroupIdSubAccountsPutRequest.subAccountIds); + } + + @Override + public int hashCode() { + return Objects.hash(subAccountIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateGroupUnlinkGroupIdSubAccountsPutRequest {\n"); + sb.append(" subAccountIds: ").append(toIndentedString(subAccountIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `subAccountIds` to the URL query string + if (getSubAccountIds() != null) { + for (int i = 0; i < getSubAccountIds().size(); i++) { + try { + joiner.add(String.format("%ssubAccountIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSubAccountIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountKeyPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountKeyPostRequest.java new file mode 100644 index 0000000..29959a5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountKeyPostRequest.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateSubAccountKeyPostRequest + */ +@JsonPropertyOrder({ + CorporateSubAccountKeyPostRequest.JSON_PROPERTY_ID, + CorporateSubAccountKeyPostRequest.JSON_PROPERTY_NAME +}) +@JsonTypeName("_corporate_subAccount_key_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateSubAccountKeyPostRequest { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public CorporateSubAccountKeyPostRequest() { + } + + public CorporateSubAccountKeyPostRequest id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the sub-account organization + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public CorporateSubAccountKeyPostRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the API key + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateSubAccountKeyPostRequest corporateSubAccountKeyPostRequest = (CorporateSubAccountKeyPostRequest) o; + return Objects.equals(this.id, corporateSubAccountKeyPostRequest.id) && + Objects.equals(this.name, corporateSubAccountKeyPostRequest.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateSubAccountKeyPostRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountSsoTokenPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountSsoTokenPostRequest.java new file mode 100644 index 0000000..d003d3a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateSubAccountSsoTokenPostRequest.java @@ -0,0 +1,325 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateSubAccountSsoTokenPostRequest + */ +@JsonPropertyOrder({ + CorporateSubAccountSsoTokenPostRequest.JSON_PROPERTY_ID, + CorporateSubAccountSsoTokenPostRequest.JSON_PROPERTY_EMAIL, + CorporateSubAccountSsoTokenPostRequest.JSON_PROPERTY_TARGET, + CorporateSubAccountSsoTokenPostRequest.JSON_PROPERTY_URL +}) +@JsonTypeName("_corporate_subAccount_ssoToken_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateSubAccountSsoTokenPostRequest { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + /** + * **Set target after login success** * **automation** - Redirect to Automation after login * **email_campaign** - Redirect to Email Campaign after login * **contacts** - Redirect to Contacts after login * **landing_pages** - Redirect to Landing Pages after login * **email_transactional** - Redirect to Email Transactional after login * **senders** - Redirect to Senders after login * **sms_campaign** - Redirect to Sms Campaign after login * **sms_transactional** - Redirect to Sms Transactional after login + */ + public enum TargetEnum { + AUTOMATION("automation"), + + EMAIL_CAMPAIGN("email_campaign"), + + CONTACTS("contacts"), + + LANDING_PAGES("landing_pages"), + + EMAIL_TRANSACTIONAL("email_transactional"), + + SENDERS("senders"), + + SMS_CAMPAIGN("sms_campaign"), + + SMS_TRANSACTIONAL("sms_transactional"); + + private String value; + + TargetEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TargetEnum fromValue(String value) { + for (TargetEnum b : TargetEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TARGET = "target"; + private TargetEnum target; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public CorporateSubAccountSsoTokenPostRequest() { + } + + public CorporateSubAccountSsoTokenPostRequest id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the sub-account organization + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public CorporateSubAccountSsoTokenPostRequest email(String email) { + + this.email = email; + return this; + } + + /** + * User email of sub-account organization + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public CorporateSubAccountSsoTokenPostRequest target(TargetEnum target) { + + this.target = target; + return this; + } + + /** + * **Set target after login success** * **automation** - Redirect to Automation after login * **email_campaign** - Redirect to Email Campaign after login * **contacts** - Redirect to Contacts after login * **landing_pages** - Redirect to Landing Pages after login * **email_transactional** - Redirect to Email Transactional after login * **senders** - Redirect to Senders after login * **sms_campaign** - Redirect to Sms Campaign after login * **sms_transactional** - Redirect to Sms Transactional after login + * @return target + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TargetEnum getTarget() { + return target; + } + + + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTarget(TargetEnum target) { + this.target = target; + } + + + public CorporateSubAccountSsoTokenPostRequest url(String url) { + + this.url = url; + return this; + } + + /** + * Set the full target URL after login success. The user will land directly on this target URL after login + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateSubAccountSsoTokenPostRequest corporateSubAccountSsoTokenPostRequest = (CorporateSubAccountSsoTokenPostRequest) o; + return Objects.equals(this.id, corporateSubAccountSsoTokenPostRequest.id) && + Objects.equals(this.email, corporateSubAccountSsoTokenPostRequest.email) && + Objects.equals(this.target, corporateSubAccountSsoTokenPostRequest.target) && + Objects.equals(this.url, corporateSubAccountSsoTokenPostRequest.url); + } + + @Override + public int hashCode() { + return Objects.hash(id, email, target, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateSubAccountSsoTokenPostRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `target` to the URL query string + if (getTarget() != null) { + try { + joiner.add(String.format("%starget%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTarget()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateUserInvitationActionEmailPut200Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateUserInvitationActionEmailPut200Response.java new file mode 100644 index 0000000..45f81ca --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CorporateUserInvitationActionEmailPut200Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CorporateUserInvitationActionEmailPut200Response + */ +@JsonPropertyOrder({ + CorporateUserInvitationActionEmailPut200Response.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("_corporate_user_invitation__action___email__put_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CorporateUserInvitationActionEmailPut200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public CorporateUserInvitationActionEmailPut200Response() { + } + + public CorporateUserInvitationActionEmailPut200Response message(String message) { + + this.message = message; + return this; + } + + /** + * Action success message + * @return message + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CorporateUserInvitationActionEmailPut200Response corporateUserInvitationActionEmailPut200Response = (CorporateUserInvitationActionEmailPut200Response) o; + return Objects.equals(this.message, corporateUserInvitationActionEmailPut200Response.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CorporateUserInvitationActionEmailPut200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateApiKeyResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateApiKeyResponse.java new file mode 100644 index 0000000..c647dcd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateApiKeyResponse.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateApiKeyResponse + */ +@JsonPropertyOrder({ + CreateApiKeyResponse.JSON_PROPERTY_STATUS, + CreateApiKeyResponse.JSON_PROPERTY_KEY +}) +@JsonTypeName("createApiKeyResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateApiKeyResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public CreateApiKeyResponse() { + } + + public CreateApiKeyResponse status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the API operation. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public CreateApiKeyResponse key(String key) { + + this.key = key; + return this; + } + + /** + * API key + * @return key + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setKey(String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateApiKeyResponse createApiKeyResponse = (CreateApiKeyResponse) o; + return Objects.equals(this.status, createApiKeyResponse.status) && + Objects.equals(this.key, createApiKeyResponse.key); + } + + @Override + public int hashCode() { + return Objects.hash(status, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateApiKeyResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `key` to the URL query string + if (getKey() != null) { + try { + joiner.add(String.format("%skey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKey()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttribute.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttribute.java new file mode 100644 index 0000000..0a65024 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttribute.java @@ -0,0 +1,333 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CreateAttributeEnumerationInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateAttribute + */ +@JsonPropertyOrder({ + CreateAttribute.JSON_PROPERTY_VALUE, + CreateAttribute.JSON_PROPERTY_IS_RECURRING, + CreateAttribute.JSON_PROPERTY_ENUMERATION, + CreateAttribute.JSON_PROPERTY_TYPE +}) +@JsonTypeName("createAttribute") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAttribute { + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public static final String JSON_PROPERTY_IS_RECURRING = "isRecurring"; + private Boolean isRecurring; + + public static final String JSON_PROPERTY_ENUMERATION = "enumeration"; + private List enumeration; + + /** + * Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **boolean** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute + */ + public enum TypeEnum { + TEXT("text"), + + DATE("date"), + + FLOAT("float"), + + BOOLEAN("boolean"), + + ID("id"), + + CATEGORY("category"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public CreateAttribute() { + } + + public CreateAttribute value(String value) { + + this.value = value; + return this; + } + + /** + * Value of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** + * @return value + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + + public CreateAttribute isRecurring(Boolean isRecurring) { + + this.isRecurring = isRecurring; + return this; + } + + /** + * Type of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** + * @return isRecurring + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsRecurring() { + return isRecurring; + } + + + @JsonProperty(JSON_PROPERTY_IS_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRecurring(Boolean isRecurring) { + this.isRecurring = isRecurring; + } + + + public CreateAttribute enumeration(List enumeration) { + + this.enumeration = enumeration; + return this; + } + + public CreateAttribute addEnumerationItem(CreateAttributeEnumerationInner enumerationItem) { + if (this.enumeration == null) { + this.enumeration = new ArrayList<>(); + } + this.enumeration.add(enumerationItem); + return this; + } + + /** + * List of values and labels that the attribute can take. **Use only if the attribute's category is \"category\"**. For example: **[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]** + * @return enumeration + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEnumeration() { + return enumeration; + } + + + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumeration(List enumeration) { + this.enumeration = enumeration; + } + + + public CreateAttribute type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **boolean** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAttribute createAttribute = (CreateAttribute) o; + return Objects.equals(this.value, createAttribute.value) && + Objects.equals(this.isRecurring, createAttribute.isRecurring) && + Objects.equals(this.enumeration, createAttribute.enumeration) && + Objects.equals(this.type, createAttribute.type); + } + + @Override + public int hashCode() { + return Objects.hash(value, isRecurring, enumeration, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAttribute {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isRecurring: ").append(toIndentedString(isRecurring)).append("\n"); + sb.append(" enumeration: ").append(toIndentedString(enumeration)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isRecurring` to the URL query string + if (getIsRecurring() != null) { + try { + joiner.add(String.format("%sisRecurring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsRecurring()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `enumeration` to the URL query string + if (getEnumeration() != null) { + for (int i = 0; i < getEnumeration().size(); i++) { + if (getEnumeration().get(i) != null) { + joiner.add(getEnumeration().get(i).toUrlQueryString(String.format("%senumeration%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttributeEnumerationInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttributeEnumerationInner.java new file mode 100644 index 0000000..1c77d8c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateAttributeEnumerationInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateAttributeEnumerationInner + */ +@JsonPropertyOrder({ + CreateAttributeEnumerationInner.JSON_PROPERTY_VALUE, + CreateAttributeEnumerationInner.JSON_PROPERTY_LABEL +}) +@JsonTypeName("createAttribute_enumeration_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAttributeEnumerationInner { + public static final String JSON_PROPERTY_VALUE = "value"; + private Integer value; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public CreateAttributeEnumerationInner() { + } + + public CreateAttributeEnumerationInner value(Integer value) { + + this.value = value; + return this; + } + + /** + * Id of the value + * @return value + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(Integer value) { + this.value = value; + } + + + public CreateAttributeEnumerationInner label(String label) { + + this.label = label; + return this; + } + + /** + * Label of the value + * @return label + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLabel() { + return label; + } + + + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLabel(String label) { + this.label = label; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAttributeEnumerationInner createAttributeEnumerationInner = (CreateAttributeEnumerationInner) o; + return Objects.equals(this.value, createAttributeEnumerationInner.value) && + Objects.equals(this.label, createAttributeEnumerationInner.label); + } + + @Override + public int hashCode() { + return Objects.hash(value, label); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAttributeEnumerationInner {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `label` to the URL query string + if (getLabel() != null) { + try { + joiner.add(String.format("%slabel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLabel()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCategoryModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCategoryModel.java new file mode 100644 index 0000000..b0e1056 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCategoryModel.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateCategoryModel + */ +@JsonPropertyOrder({ + CreateCategoryModel.JSON_PROPERTY_ID +}) +@JsonTypeName("createCategoryModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCategoryModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateCategoryModel() { + } + + public CreateCategoryModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the category when a new category is created + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCategoryModel createCategoryModel = (CreateCategoryModel) o; + return Objects.equals(this.id, createCategoryModel.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCategoryModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateChild.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateChild.java new file mode 100644 index 0000000..353480a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateChild.java @@ -0,0 +1,405 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateChild + */ +@JsonPropertyOrder({ + CreateChild.JSON_PROPERTY_EMAIL, + CreateChild.JSON_PROPERTY_FIRST_NAME, + CreateChild.JSON_PROPERTY_LAST_NAME, + CreateChild.JSON_PROPERTY_COMPANY_NAME, + CreateChild.JSON_PROPERTY_PASSWORD, + CreateChild.JSON_PROPERTY_LANGUAGE +}) +@JsonTypeName("createChild") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateChild { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + /** + * Language of the child account + */ + public enum LanguageEnum { + FR("fr"), + + ES("es"), + + PT("pt"), + + IT("it"), + + DE("de"), + + EN("en"); + + private String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LanguageEnum fromValue(String value) { + for (LanguageEnum b : LanguageEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private LanguageEnum language; + + public CreateChild() { + } + + public CreateChild email(String email) { + + this.email = email; + return this; + } + + /** + * Email address to create the child account + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateChild firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First name to use to create the child account + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public CreateChild lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last name to use to create the child account + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public CreateChild companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Company name to use to create the child account + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public CreateChild password(String password) { + + this.password = password; + return this; + } + + /** + * Password for the child account to login + * @return password + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + + public CreateChild language(LanguageEnum language) { + + this.language = language; + return this; + } + + /** + * Language of the child account + * @return language + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LanguageEnum getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(LanguageEnum language) { + this.language = language; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateChild createChild = (CreateChild) o; + return Objects.equals(this.email, createChild.email) && + Objects.equals(this.firstName, createChild.firstName) && + Objects.equals(this.lastName, createChild.lastName) && + Objects.equals(this.companyName, createChild.companyName) && + Objects.equals(this.password, createChild.password) && + Objects.equals(this.language, createChild.language); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, password, language); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateChild {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" language: ").append(toIndentedString(language)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateContact.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateContact.java new file mode 100644 index 0000000..5803438 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateContact.java @@ -0,0 +1,487 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateContact + */ +@JsonPropertyOrder({ + CreateContact.JSON_PROPERTY_EMAIL, + CreateContact.JSON_PROPERTY_EXT_ID, + CreateContact.JSON_PROPERTY_ATTRIBUTES, + CreateContact.JSON_PROPERTY_EMAIL_BLACKLISTED, + CreateContact.JSON_PROPERTY_SMS_BLACKLISTED, + CreateContact.JSON_PROPERTY_LIST_IDS, + CreateContact.JSON_PROPERTY_UPDATE_ENABLED, + CreateContact.JSON_PROPERTY_SMTP_BLACKLIST_SENDER +}) +@JsonTypeName("createContact") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateContact { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_EXT_ID = "ext_id"; + private String extId; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map attributes = new HashMap<>(); + + public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted"; + private Boolean emailBlacklisted; + + public static final String JSON_PROPERTY_SMS_BLACKLISTED = "smsBlacklisted"; + private Boolean smsBlacklisted; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_UPDATE_ENABLED = "updateEnabled"; + private Boolean updateEnabled = false; + + public static final String JSON_PROPERTY_SMTP_BLACKLIST_SENDER = "smtpBlacklistSender"; + private List smtpBlacklistSender; + + public CreateContact() { + } + + public CreateContact email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. **Mandatory if \"SMS\" field is not passed in \"attributes\" parameter**. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"}** or **{\"SMS\":\"0091xxxxxxxxxx\"}** + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateContact extId(String extId) { + + this.extId = extId; + return this; + } + + /** + * Pass your own Id to create a contact. + * @return extId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExtId() { + return extId; + } + + + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtId(String extId) { + this.extId = extId; + } + + + public CreateContact attributes(Map attributes) { + + this.attributes = attributes; + return this; + } + + public CreateContact putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account.**. For eg: **{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}** + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + + public CreateContact emailBlacklisted(Boolean emailBlacklisted) { + + this.emailBlacklisted = emailBlacklisted; + return this; + } + + /** + * Set this field to blacklist the contact for emails (emailBlacklisted = true) + * @return emailBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmailBlacklisted() { + return emailBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailBlacklisted(Boolean emailBlacklisted) { + this.emailBlacklisted = emailBlacklisted; + } + + + public CreateContact smsBlacklisted(Boolean smsBlacklisted) { + + this.smsBlacklisted = smsBlacklisted; + return this; + } + + /** + * Set this field to blacklist the contact for SMS (smsBlacklisted = true) + * @return smsBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsBlacklisted() { + return smsBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsBlacklisted(Boolean smsBlacklisted) { + this.smsBlacklisted = smsBlacklisted; + } + + + public CreateContact listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public CreateContact addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Ids of the lists to add the contact to + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public CreateContact updateEnabled(Boolean updateEnabled) { + + this.updateEnabled = updateEnabled; + return this; + } + + /** + * Facilitate to update the existing contact in the same request (updateEnabled = true) + * @return updateEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateEnabled() { + return updateEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateEnabled(Boolean updateEnabled) { + this.updateEnabled = updateEnabled; + } + + + public CreateContact smtpBlacklistSender(List smtpBlacklistSender) { + + this.smtpBlacklistSender = smtpBlacklistSender; + return this; + } + + public CreateContact addSmtpBlacklistSenderItem(String smtpBlacklistSenderItem) { + if (this.smtpBlacklistSender == null) { + this.smtpBlacklistSender = new ArrayList<>(); + } + this.smtpBlacklistSender.add(smtpBlacklistSenderItem); + return this; + } + + /** + * transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) + * @return smtpBlacklistSender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSmtpBlacklistSender() { + return smtpBlacklistSender; + } + + + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmtpBlacklistSender(List smtpBlacklistSender) { + this.smtpBlacklistSender = smtpBlacklistSender; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateContact createContact = (CreateContact) o; + return Objects.equals(this.email, createContact.email) && + Objects.equals(this.extId, createContact.extId) && + Objects.equals(this.attributes, createContact.attributes) && + Objects.equals(this.emailBlacklisted, createContact.emailBlacklisted) && + Objects.equals(this.smsBlacklisted, createContact.smsBlacklisted) && + Objects.equals(this.listIds, createContact.listIds) && + Objects.equals(this.updateEnabled, createContact.updateEnabled) && + Objects.equals(this.smtpBlacklistSender, createContact.smtpBlacklistSender); + } + + @Override + public int hashCode() { + return Objects.hash(email, extId, attributes, emailBlacklisted, smsBlacklisted, listIds, updateEnabled, smtpBlacklistSender); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateContact {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" extId: ").append(toIndentedString(extId)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" emailBlacklisted: ").append(toIndentedString(emailBlacklisted)).append("\n"); + sb.append(" smsBlacklisted: ").append(toIndentedString(smsBlacklisted)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" updateEnabled: ").append(toIndentedString(updateEnabled)).append("\n"); + sb.append(" smtpBlacklistSender: ").append(toIndentedString(smtpBlacklistSender)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ext_id` to the URL query string + if (getExtId() != null) { + try { + joiner.add(String.format("%sext_id%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExtId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (String _key : getAttributes().keySet()) { + try { + joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `emailBlacklisted` to the URL query string + if (getEmailBlacklisted() != null) { + try { + joiner.add(String.format("%semailBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklisted` to the URL query string + if (getSmsBlacklisted() != null) { + try { + joiner.add(String.format("%ssmsBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `updateEnabled` to the URL query string + if (getUpdateEnabled() != null) { + try { + joiner.add(String.format("%supdateEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smtpBlacklistSender` to the URL query string + if (getSmtpBlacklistSender() != null) { + for (int i = 0; i < getSmtpBlacklistSender().size(); i++) { + try { + joiner.add(String.format("%ssmtpBlacklistSender%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSmtpBlacklistSender().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollection201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollection201Response.java new file mode 100644 index 0000000..1fa8125 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollection201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateCouponCollection201Response + */ +@JsonPropertyOrder({ + CreateCouponCollection201Response.JSON_PROPERTY_ID +}) +@JsonTypeName("createCouponCollection_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCouponCollection201Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CreateCouponCollection201Response() { + } + + public CreateCouponCollection201Response id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the created collection + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCouponCollection201Response createCouponCollection201Response = (CreateCouponCollection201Response) o; + return Objects.equals(this.id, createCouponCollection201Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCouponCollection201Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollectionRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollectionRequest.java new file mode 100644 index 0000000..3765f63 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponCollectionRequest.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateCouponCollectionRequest + */ +@JsonPropertyOrder({ + CreateCouponCollectionRequest.JSON_PROPERTY_NAME, + CreateCouponCollectionRequest.JSON_PROPERTY_DEFAULT_COUPON +}) +@JsonTypeName("createCouponCollection_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCouponCollectionRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DEFAULT_COUPON = "defaultCoupon"; + private String defaultCoupon; + + public CreateCouponCollectionRequest() { + } + + public CreateCouponCollectionRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the collection with no white spaces between words + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateCouponCollectionRequest defaultCoupon(String defaultCoupon) { + + this.defaultCoupon = defaultCoupon; + return this; + } + + /** + * A default coupon to be used in case there are no coupons left + * @return defaultCoupon + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDefaultCoupon() { + return defaultCoupon; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultCoupon(String defaultCoupon) { + this.defaultCoupon = defaultCoupon; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCouponCollectionRequest createCouponCollectionRequest = (CreateCouponCollectionRequest) o; + return Objects.equals(this.name, createCouponCollectionRequest.name) && + Objects.equals(this.defaultCoupon, createCouponCollectionRequest.defaultCoupon); + } + + @Override + public int hashCode() { + return Objects.hash(name, defaultCoupon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCouponCollectionRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" defaultCoupon: ").append(toIndentedString(defaultCoupon)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `defaultCoupon` to the URL query string + if (getDefaultCoupon() != null) { + try { + joiner.add(String.format("%sdefaultCoupon%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultCoupon()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponsRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponsRequest.java new file mode 100644 index 0000000..2981e92 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateCouponsRequest.java @@ -0,0 +1,212 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.LinkedHashSet; +import java.util.Set; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateCouponsRequest + */ +@JsonPropertyOrder({ + CreateCouponsRequest.JSON_PROPERTY_COLLECTION_ID, + CreateCouponsRequest.JSON_PROPERTY_COUPONS +}) +@JsonTypeName("createCoupons_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateCouponsRequest { + public static final String JSON_PROPERTY_COLLECTION_ID = "collectionId"; + private String collectionId; + + public static final String JSON_PROPERTY_COUPONS = "coupons"; + private Set coupons = new LinkedHashSet<>(); + + public CreateCouponsRequest() { + } + + public CreateCouponsRequest collectionId(String collectionId) { + + this.collectionId = collectionId; + return this; + } + + /** + * The id of the coupon collection for which the coupons will be created + * @return collectionId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COLLECTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCollectionId() { + return collectionId; + } + + + @JsonProperty(JSON_PROPERTY_COLLECTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + + public CreateCouponsRequest coupons(Set coupons) { + + this.coupons = coupons; + return this; + } + + public CreateCouponsRequest addCouponsItem(String couponsItem) { + if (this.coupons == null) { + this.coupons = new LinkedHashSet<>(); + } + this.coupons.add(couponsItem); + return this; + } + + /** + * Get coupons + * @return coupons + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Set getCoupons() { + return coupons; + } + + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCoupons(Set coupons) { + this.coupons = coupons; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCouponsRequest createCouponsRequest = (CreateCouponsRequest) o; + return Objects.equals(this.collectionId, createCouponsRequest.collectionId) && + Objects.equals(this.coupons, createCouponsRequest.coupons); + } + + @Override + public int hashCode() { + return Objects.hash(collectionId, coupons); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCouponsRequest {\n"); + sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); + sb.append(" coupons: ").append(toIndentedString(coupons)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `collectionId` to the URL query string + if (getCollectionId() != null) { + try { + joiner.add(String.format("%scollectionId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCollectionId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `coupons` to the URL query string + if (getCoupons() != null) { + int i = 0; + for (String _item : getCoupons()) { + try { + joiner.add(String.format("%scoupons%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDoiContact.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDoiContact.java new file mode 100644 index 0000000..8dbf98c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDoiContact.java @@ -0,0 +1,403 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateDoiContact + */ +@JsonPropertyOrder({ + CreateDoiContact.JSON_PROPERTY_EMAIL, + CreateDoiContact.JSON_PROPERTY_ATTRIBUTES, + CreateDoiContact.JSON_PROPERTY_INCLUDE_LIST_IDS, + CreateDoiContact.JSON_PROPERTY_EXCLUDE_LIST_IDS, + CreateDoiContact.JSON_PROPERTY_TEMPLATE_ID, + CreateDoiContact.JSON_PROPERTY_REDIRECTION_URL +}) +@JsonTypeName("createDoiContact") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDoiContact { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map attributes = new HashMap<>(); + + public static final String JSON_PROPERTY_INCLUDE_LIST_IDS = "includeListIds"; + private List includeListIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXCLUDE_LIST_IDS = "excludeListIds"; + private List excludeListIds; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public static final String JSON_PROPERTY_REDIRECTION_URL = "redirectionUrl"; + private String redirectionUrl; + + public CreateDoiContact() { + } + + public CreateDoiContact email(String email) { + + this.email = email; + return this; + } + + /** + * Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateDoiContact attributes(Map attributes) { + + this.attributes = attributes; + return this; + } + + public CreateDoiContact putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Pass the set of attributes and their values. **These attributes must be present in your Brevo account**. For eg. **{'FNAME':'Elly', 'LNAME':'Roger'}** + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + + public CreateDoiContact includeListIds(List includeListIds) { + + this.includeListIds = includeListIds; + return this; + } + + public CreateDoiContact addIncludeListIdsItem(Long includeListIdsItem) { + if (this.includeListIds == null) { + this.includeListIds = new ArrayList<>(); + } + this.includeListIds.add(includeListIdsItem); + return this; + } + + /** + * Lists under user account where contact should be added + * @return includeListIds + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INCLUDE_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getIncludeListIds() { + return includeListIds; + } + + + @JsonProperty(JSON_PROPERTY_INCLUDE_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIncludeListIds(List includeListIds) { + this.includeListIds = includeListIds; + } + + + public CreateDoiContact excludeListIds(List excludeListIds) { + + this.excludeListIds = excludeListIds; + return this; + } + + public CreateDoiContact addExcludeListIdsItem(Long excludeListIdsItem) { + if (this.excludeListIds == null) { + this.excludeListIds = new ArrayList<>(); + } + this.excludeListIds.add(excludeListIdsItem); + return this; + } + + /** + * Lists under user account where contact should not be added + * @return excludeListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDE_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExcludeListIds() { + return excludeListIds; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUDE_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExcludeListIds(List excludeListIds) { + this.excludeListIds = excludeListIds; + } + + + public CreateDoiContact templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the Double opt-in (DOI) template + * @return templateId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + + public CreateDoiContact redirectionUrl(String redirectionUrl) { + + this.redirectionUrl = redirectionUrl; + return this; + } + + /** + * URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag **{{ params.DOIurl }}**. + * @return redirectionUrl + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REDIRECTION_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRedirectionUrl() { + return redirectionUrl; + } + + + @JsonProperty(JSON_PROPERTY_REDIRECTION_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRedirectionUrl(String redirectionUrl) { + this.redirectionUrl = redirectionUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDoiContact createDoiContact = (CreateDoiContact) o; + return Objects.equals(this.email, createDoiContact.email) && + Objects.equals(this.attributes, createDoiContact.attributes) && + Objects.equals(this.includeListIds, createDoiContact.includeListIds) && + Objects.equals(this.excludeListIds, createDoiContact.excludeListIds) && + Objects.equals(this.templateId, createDoiContact.templateId) && + Objects.equals(this.redirectionUrl, createDoiContact.redirectionUrl); + } + + @Override + public int hashCode() { + return Objects.hash(email, attributes, includeListIds, excludeListIds, templateId, redirectionUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDoiContact {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" includeListIds: ").append(toIndentedString(includeListIds)).append("\n"); + sb.append(" excludeListIds: ").append(toIndentedString(excludeListIds)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" redirectionUrl: ").append(toIndentedString(redirectionUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (String _key : getAttributes().keySet()) { + try { + joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `includeListIds` to the URL query string + if (getIncludeListIds() != null) { + for (int i = 0; i < getIncludeListIds().size(); i++) { + try { + joiner.add(String.format("%sincludeListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIncludeListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `excludeListIds` to the URL query string + if (getExcludeListIds() != null) { + for (int i = 0; i < getExcludeListIds().size(); i++) { + try { + joiner.add(String.format("%sexcludeListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExcludeListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `redirectionUrl` to the URL query string + if (getRedirectionUrl() != null) { + try { + joiner.add(String.format("%sredirectionUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRedirectionUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomain.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomain.java new file mode 100644 index 0000000..40a33a5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomain.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateDomain + */ +@JsonPropertyOrder({ + CreateDomain.JSON_PROPERTY_NAME +}) +@JsonTypeName("createDomain") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomain { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public CreateDomain() { + } + + public CreateDomain name(String name) { + + this.name = name; + return this; + } + + /** + * Domain name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomain createDomain = (CreateDomain) o; + return Objects.equals(this.name, createDomain.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomain {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModel.java new file mode 100644 index 0000000..049d11f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModel.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateDomainModelDnsRecords; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateDomainModel + */ +@JsonPropertyOrder({ + CreateDomainModel.JSON_PROPERTY_ID, + CreateDomainModel.JSON_PROPERTY_DOMAIN_NAME, + CreateDomainModel.JSON_PROPERTY_MESSAGE, + CreateDomainModel.JSON_PROPERTY_DNS_RECORDS +}) +@JsonTypeName("createDomainModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomainModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_DOMAIN_NAME = "domain_name"; + private String domainName; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_DNS_RECORDS = "dns_records"; + private CreateDomainModelDnsRecords dnsRecords; + + public CreateDomainModel() { + } + + public CreateDomainModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the Domain created + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public CreateDomainModel domainName(String domainName) { + + this.domainName = domainName; + return this; + } + + /** + * Domain + * @return domainName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomainName() { + return domainName; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + + public CreateDomainModel message(String message) { + + this.message = message; + return this; + } + + /** + * Success message + * @return message + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public CreateDomainModel dnsRecords(CreateDomainModelDnsRecords dnsRecords) { + + this.dnsRecords = dnsRecords; + return this; + } + + /** + * Get dnsRecords + * @return dnsRecords + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DNS_RECORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateDomainModelDnsRecords getDnsRecords() { + return dnsRecords; + } + + + @JsonProperty(JSON_PROPERTY_DNS_RECORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDnsRecords(CreateDomainModelDnsRecords dnsRecords) { + this.dnsRecords = dnsRecords; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomainModel createDomainModel = (CreateDomainModel) o; + return Objects.equals(this.id, createDomainModel.id) && + Objects.equals(this.domainName, createDomainModel.domainName) && + Objects.equals(this.message, createDomainModel.message) && + Objects.equals(this.dnsRecords, createDomainModel.dnsRecords); + } + + @Override + public int hashCode() { + return Objects.hash(id, domainName, message, dnsRecords); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomainModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" dnsRecords: ").append(toIndentedString(dnsRecords)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain_name` to the URL query string + if (getDomainName() != null) { + try { + joiner.add(String.format("%sdomain_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomainName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `dns_records` to the URL query string + if (getDnsRecords() != null) { + joiner.add(getDnsRecords().toUrlQueryString(prefix + "dns_records" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecords.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecords.java new file mode 100644 index 0000000..5f1d39a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecords.java @@ -0,0 +1,222 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateDomainModelDnsRecordsDkimRecord; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateDomainModelDnsRecords + */ +@JsonPropertyOrder({ + CreateDomainModelDnsRecords.JSON_PROPERTY_DKIM_RECORD, + CreateDomainModelDnsRecords.JSON_PROPERTY_BREVO_CODE, + CreateDomainModelDnsRecords.JSON_PROPERTY_DMARC_RECORD +}) +@JsonTypeName("createDomainModel_dns_records") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomainModelDnsRecords { + public static final String JSON_PROPERTY_DKIM_RECORD = "dkim_record"; + private CreateDomainModelDnsRecordsDkimRecord dkimRecord; + + public static final String JSON_PROPERTY_BREVO_CODE = "brevo_code"; + private CreateDomainModelDnsRecordsDkimRecord brevoCode; + + public static final String JSON_PROPERTY_DMARC_RECORD = "dmarc_record"; + private CreateDomainModelDnsRecordsDkimRecord dmarcRecord; + + public CreateDomainModelDnsRecords() { + } + + public CreateDomainModelDnsRecords dkimRecord(CreateDomainModelDnsRecordsDkimRecord dkimRecord) { + + this.dkimRecord = dkimRecord; + return this; + } + + /** + * Get dkimRecord + * @return dkimRecord + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DKIM_RECORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateDomainModelDnsRecordsDkimRecord getDkimRecord() { + return dkimRecord; + } + + + @JsonProperty(JSON_PROPERTY_DKIM_RECORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDkimRecord(CreateDomainModelDnsRecordsDkimRecord dkimRecord) { + this.dkimRecord = dkimRecord; + } + + + public CreateDomainModelDnsRecords brevoCode(CreateDomainModelDnsRecordsDkimRecord brevoCode) { + + this.brevoCode = brevoCode; + return this; + } + + /** + * Get brevoCode + * @return brevoCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BREVO_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateDomainModelDnsRecordsDkimRecord getBrevoCode() { + return brevoCode; + } + + + @JsonProperty(JSON_PROPERTY_BREVO_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrevoCode(CreateDomainModelDnsRecordsDkimRecord brevoCode) { + this.brevoCode = brevoCode; + } + + + public CreateDomainModelDnsRecords dmarcRecord(CreateDomainModelDnsRecordsDkimRecord dmarcRecord) { + + this.dmarcRecord = dmarcRecord; + return this; + } + + /** + * Get dmarcRecord + * @return dmarcRecord + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DMARC_RECORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateDomainModelDnsRecordsDkimRecord getDmarcRecord() { + return dmarcRecord; + } + + + @JsonProperty(JSON_PROPERTY_DMARC_RECORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDmarcRecord(CreateDomainModelDnsRecordsDkimRecord dmarcRecord) { + this.dmarcRecord = dmarcRecord; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomainModelDnsRecords createDomainModelDnsRecords = (CreateDomainModelDnsRecords) o; + return Objects.equals(this.dkimRecord, createDomainModelDnsRecords.dkimRecord) && + Objects.equals(this.brevoCode, createDomainModelDnsRecords.brevoCode) && + Objects.equals(this.dmarcRecord, createDomainModelDnsRecords.dmarcRecord); + } + + @Override + public int hashCode() { + return Objects.hash(dkimRecord, brevoCode, dmarcRecord); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomainModelDnsRecords {\n"); + sb.append(" dkimRecord: ").append(toIndentedString(dkimRecord)).append("\n"); + sb.append(" brevoCode: ").append(toIndentedString(brevoCode)).append("\n"); + sb.append(" dmarcRecord: ").append(toIndentedString(dmarcRecord)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `dkim_record` to the URL query string + if (getDkimRecord() != null) { + joiner.add(getDkimRecord().toUrlQueryString(prefix + "dkim_record" + suffix)); + } + + // add `brevo_code` to the URL query string + if (getBrevoCode() != null) { + joiner.add(getBrevoCode().toUrlQueryString(prefix + "brevo_code" + suffix)); + } + + // add `dmarc_record` to the URL query string + if (getDmarcRecord() != null) { + joiner.add(getDmarcRecord().toUrlQueryString(prefix + "dmarc_record" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecordsDkimRecord.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecordsDkimRecord.java new file mode 100644 index 0000000..3f95e41 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModelDnsRecordsDkimRecord.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateDomainModelDnsRecordsDkimRecord + */ +@JsonPropertyOrder({ + CreateDomainModelDnsRecordsDkimRecord.JSON_PROPERTY_TYPE, + CreateDomainModelDnsRecordsDkimRecord.JSON_PROPERTY_VALUE, + CreateDomainModelDnsRecordsDkimRecord.JSON_PROPERTY_HOST_NAME, + CreateDomainModelDnsRecordsDkimRecord.JSON_PROPERTY_STATUS +}) +@JsonTypeName("createDomainModel_dns_records_dkim_record") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomainModelDnsRecordsDkimRecord { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public static final String JSON_PROPERTY_HOST_NAME = "host_name"; + private String hostName; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Boolean status; + + public CreateDomainModelDnsRecordsDkimRecord() { + } + + public CreateDomainModelDnsRecordsDkimRecord type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + + public CreateDomainModelDnsRecordsDkimRecord value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + + public CreateDomainModelDnsRecordsDkimRecord hostName(String hostName) { + + this.hostName = hostName; + return this; + } + + /** + * Get hostName + * @return hostName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHostName() { + return hostName; + } + + + @JsonProperty(JSON_PROPERTY_HOST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostName(String hostName) { + this.hostName = hostName; + } + + + public CreateDomainModelDnsRecordsDkimRecord status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Boolean status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomainModelDnsRecordsDkimRecord createDomainModelDnsRecordsDkimRecord = (CreateDomainModelDnsRecordsDkimRecord) o; + return Objects.equals(this.type, createDomainModelDnsRecordsDkimRecord.type) && + Objects.equals(this.value, createDomainModelDnsRecordsDkimRecord.value) && + Objects.equals(this.hostName, createDomainModelDnsRecordsDkimRecord.hostName) && + Objects.equals(this.status, createDomainModelDnsRecordsDkimRecord.status); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, hostName, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomainModelDnsRecordsDkimRecord {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" hostName: ").append(toIndentedString(hostName)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `host_name` to the URL query string + if (getHostName() != null) { + try { + joiner.add(String.format("%shost_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHostName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaign.java new file mode 100644 index 0000000..30ffe78 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaign.java @@ -0,0 +1,1459 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import software.xdev.brevo.model.CreateEmailCampaignRecipients; +import software.xdev.brevo.model.CreateEmailCampaignSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateEmailCampaign + */ +@JsonPropertyOrder({ + CreateEmailCampaign.JSON_PROPERTY_TAG, + CreateEmailCampaign.JSON_PROPERTY_SENDER, + CreateEmailCampaign.JSON_PROPERTY_NAME, + CreateEmailCampaign.JSON_PROPERTY_HTML_CONTENT, + CreateEmailCampaign.JSON_PROPERTY_HTML_URL, + CreateEmailCampaign.JSON_PROPERTY_TEMPLATE_ID, + CreateEmailCampaign.JSON_PROPERTY_SCHEDULED_AT, + CreateEmailCampaign.JSON_PROPERTY_SUBJECT, + CreateEmailCampaign.JSON_PROPERTY_PREVIEW_TEXT, + CreateEmailCampaign.JSON_PROPERTY_REPLY_TO, + CreateEmailCampaign.JSON_PROPERTY_TO_FIELD, + CreateEmailCampaign.JSON_PROPERTY_RECIPIENTS, + CreateEmailCampaign.JSON_PROPERTY_ATTACHMENT_URL, + CreateEmailCampaign.JSON_PROPERTY_INLINE_IMAGE_ACTIVATION, + CreateEmailCampaign.JSON_PROPERTY_MIRROR_ACTIVE, + CreateEmailCampaign.JSON_PROPERTY_FOOTER, + CreateEmailCampaign.JSON_PROPERTY_HEADER, + CreateEmailCampaign.JSON_PROPERTY_UTM_CAMPAIGN, + CreateEmailCampaign.JSON_PROPERTY_PARAMS, + CreateEmailCampaign.JSON_PROPERTY_SEND_AT_BEST_TIME, + CreateEmailCampaign.JSON_PROPERTY_AB_TESTING, + CreateEmailCampaign.JSON_PROPERTY_SUBJECT_A, + CreateEmailCampaign.JSON_PROPERTY_SUBJECT_B, + CreateEmailCampaign.JSON_PROPERTY_SPLIT_RULE, + CreateEmailCampaign.JSON_PROPERTY_WINNER_CRITERIA, + CreateEmailCampaign.JSON_PROPERTY_WINNER_DELAY, + CreateEmailCampaign.JSON_PROPERTY_IP_WARMUP_ENABLE, + CreateEmailCampaign.JSON_PROPERTY_INITIAL_QUOTA, + CreateEmailCampaign.JSON_PROPERTY_INCREASE_RATE, + CreateEmailCampaign.JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID, + CreateEmailCampaign.JSON_PROPERTY_UPDATE_FORM_ID +}) +@JsonTypeName("createEmailCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateEmailCampaign { + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private CreateEmailCampaignSender sender; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_HTML_URL = "htmlUrl"; + private String htmlUrl; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private CreateEmailCampaignRecipients recipients; + + public static final String JSON_PROPERTY_ATTACHMENT_URL = "attachmentUrl"; + private String attachmentUrl; + + public static final String JSON_PROPERTY_INLINE_IMAGE_ACTIVATION = "inlineImageActivation"; + private Boolean inlineImageActivation = false; + + public static final String JSON_PROPERTY_MIRROR_ACTIVE = "mirrorActive"; + private Boolean mirrorActive; + + public static final String JSON_PROPERTY_FOOTER = "footer"; + private String footer; + + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_UTM_CAMPAIGN = "utmCampaign"; + private String utmCampaign; + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Map params = new HashMap<>(); + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime = false; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting = false; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Long splitRule; + + /** + * Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + */ + public enum WinnerCriteriaEnum { + OPEN("open"), + + CLICK("click"); + + private String value; + + WinnerCriteriaEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WinnerCriteriaEnum fromValue(String value) { + for (WinnerCriteriaEnum b : WinnerCriteriaEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private WinnerCriteriaEnum winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Long winnerDelay; + + public static final String JSON_PROPERTY_IP_WARMUP_ENABLE = "ipWarmupEnable"; + private Boolean ipWarmupEnable = false; + + public static final String JSON_PROPERTY_INITIAL_QUOTA = "initialQuota"; + private Long initialQuota; + + public static final String JSON_PROPERTY_INCREASE_RATE = "increaseRate"; + private Long increaseRate; + + public static final String JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID = "unsubscriptionPageId"; + private String unsubscriptionPageId; + + public static final String JSON_PROPERTY_UPDATE_FORM_ID = "updateFormId"; + private String updateFormId; + + public CreateEmailCampaign() { + } + + public CreateEmailCampaign tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the campaign + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public CreateEmailCampaign sender(CreateEmailCampaignSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CreateEmailCampaignSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(CreateEmailCampaignSender sender) { + this.sender = sender; + } + + + public CreateEmailCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateEmailCampaign htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * Mandatory if htmlUrl and templateId are empty. Body of the message (HTML). + * @return htmlContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public CreateEmailCampaign htmlUrl(String htmlUrl) { + + this.htmlUrl = htmlUrl; + return this; + } + + /** + * **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com** + * @return htmlUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlUrl() { + return htmlUrl; + } + + + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlUrl(String htmlUrl) { + this.htmlUrl = htmlUrl; + } + + + public CreateEmailCampaign templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. + * @return templateId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + + public CreateEmailCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00** + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public CreateEmailCampaign subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true. + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateEmailCampaign previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public CreateEmailCampaign replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email on which the campaign recipients will be able to reply to + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public CreateEmailCampaign toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public CreateEmailCampaign recipients(CreateEmailCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateEmailCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(CreateEmailCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public CreateEmailCampaign attachmentUrl(String attachmentUrl) { + + this.attachmentUrl = attachmentUrl; + return this; + } + + /** + * Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * @return attachmentUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttachmentUrl() { + return attachmentUrl; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachmentUrl(String attachmentUrl) { + this.attachmentUrl = attachmentUrl; + } + + + public CreateEmailCampaign inlineImageActivation(Boolean inlineImageActivation) { + + this.inlineImageActivation = inlineImageActivation; + return this; + } + + /** + * Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_ + * @return inlineImageActivation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInlineImageActivation() { + return inlineImageActivation; + } + + + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInlineImageActivation(Boolean inlineImageActivation) { + this.inlineImageActivation = inlineImageActivation; + } + + + public CreateEmailCampaign mirrorActive(Boolean mirrorActive) { + + this.mirrorActive = mirrorActive; + return this; + } + + /** + * Use true to enable the mirror link + * @return mirrorActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMirrorActive() { + return mirrorActive; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMirrorActive(Boolean mirrorActive) { + this.mirrorActive = mirrorActive; + } + + + public CreateEmailCampaign footer(String footer) { + + this.footer = footer; + return this; + } + + /** + * Footer of the email campaign + * @return footer + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFooter() { + return footer; + } + + + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFooter(String footer) { + this.footer = footer; + } + + + public CreateEmailCampaign header(String header) { + + this.header = header; + return this; + } + + /** + * Header of the email campaign + * @return header + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeader() { + return header; + } + + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(String header) { + this.header = header; + } + + + public CreateEmailCampaign utmCampaign(String utmCampaign) { + + this.utmCampaign = utmCampaign; + return this; + } + + /** + * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + * @return utmCampaign + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTM_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUtmCampaign() { + return utmCampaign; + } + + + @JsonProperty(JSON_PROPERTY_UTM_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtmCampaign(String utmCampaign) { + this.utmCampaign = utmCampaign; + } + + + public CreateEmailCampaign params(Map params) { + + this.params = params; + return this; + } + + public CreateEmailCampaign putParamsItem(String key, Object paramsItem) { + if (this.params == null) { + this.params = new HashMap<>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Map params) { + this.params = params; + } + + + public CreateEmailCampaign sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * Set this to true if you want to send your campaign at best time. + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + + public CreateEmailCampaign abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public CreateEmailCampaign subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public CreateEmailCampaign subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public CreateEmailCampaign splitRule(Long splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + * minimum: 1 + * maximum: 50 + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Long splitRule) { + this.splitRule = splitRule; + } + + + public CreateEmailCampaign winnerCriteria(WinnerCriteriaEnum winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WinnerCriteriaEnum getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(WinnerCriteriaEnum winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public CreateEmailCampaign winnerDelay(Long winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed + * minimum: 1 + * maximum: 168 + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Long winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public CreateEmailCampaign ipWarmupEnable(Boolean ipWarmupEnable) { + + this.ipWarmupEnable = ipWarmupEnable; + return this; + } + + /** + * **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. + * @return ipWarmupEnable + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP_WARMUP_ENABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIpWarmupEnable() { + return ipWarmupEnable; + } + + + @JsonProperty(JSON_PROPERTY_IP_WARMUP_ENABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpWarmupEnable(Boolean ipWarmupEnable) { + this.ipWarmupEnable = ipWarmupEnable; + } + + + public CreateEmailCampaign initialQuota(Long initialQuota) { + + this.initialQuota = initialQuota; + return this; + } + + /** + * **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + * @return initialQuota + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INITIAL_QUOTA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInitialQuota() { + return initialQuota; + } + + + @JsonProperty(JSON_PROPERTY_INITIAL_QUOTA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInitialQuota(Long initialQuota) { + this.initialQuota = initialQuota; + } + + + public CreateEmailCampaign increaseRate(Long increaseRate) { + + this.increaseRate = increaseRate; + return this; + } + + /** + * **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + * minimum: 0 + * maximum: 100 + * @return increaseRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCREASE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getIncreaseRate() { + return increaseRate; + } + + + @JsonProperty(JSON_PROPERTY_INCREASE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncreaseRate(Long increaseRate) { + this.increaseRate = increaseRate; + } + + + public CreateEmailCampaign unsubscriptionPageId(String unsubscriptionPageId) { + + this.unsubscriptionPageId = unsubscriptionPageId; + return this; + } + + /** + * Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. + * @return unsubscriptionPageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUnsubscriptionPageId() { + return unsubscriptionPageId; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscriptionPageId(String unsubscriptionPageId) { + this.unsubscriptionPageId = unsubscriptionPageId; + } + + + public CreateEmailCampaign updateFormId(String updateFormId) { + + this.updateFormId = updateFormId; + return this; + } + + /** + * **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. + * @return updateFormId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_FORM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUpdateFormId() { + return updateFormId; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_FORM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateFormId(String updateFormId) { + this.updateFormId = updateFormId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmailCampaign createEmailCampaign = (CreateEmailCampaign) o; + return Objects.equals(this.tag, createEmailCampaign.tag) && + Objects.equals(this.sender, createEmailCampaign.sender) && + Objects.equals(this.name, createEmailCampaign.name) && + Objects.equals(this.htmlContent, createEmailCampaign.htmlContent) && + Objects.equals(this.htmlUrl, createEmailCampaign.htmlUrl) && + Objects.equals(this.templateId, createEmailCampaign.templateId) && + Objects.equals(this.scheduledAt, createEmailCampaign.scheduledAt) && + Objects.equals(this.subject, createEmailCampaign.subject) && + Objects.equals(this.previewText, createEmailCampaign.previewText) && + Objects.equals(this.replyTo, createEmailCampaign.replyTo) && + Objects.equals(this.toField, createEmailCampaign.toField) && + Objects.equals(this.recipients, createEmailCampaign.recipients) && + Objects.equals(this.attachmentUrl, createEmailCampaign.attachmentUrl) && + Objects.equals(this.inlineImageActivation, createEmailCampaign.inlineImageActivation) && + Objects.equals(this.mirrorActive, createEmailCampaign.mirrorActive) && + Objects.equals(this.footer, createEmailCampaign.footer) && + Objects.equals(this.header, createEmailCampaign.header) && + Objects.equals(this.utmCampaign, createEmailCampaign.utmCampaign) && + Objects.equals(this.params, createEmailCampaign.params) && + Objects.equals(this.sendAtBestTime, createEmailCampaign.sendAtBestTime) && + Objects.equals(this.abTesting, createEmailCampaign.abTesting) && + Objects.equals(this.subjectA, createEmailCampaign.subjectA) && + Objects.equals(this.subjectB, createEmailCampaign.subjectB) && + Objects.equals(this.splitRule, createEmailCampaign.splitRule) && + Objects.equals(this.winnerCriteria, createEmailCampaign.winnerCriteria) && + Objects.equals(this.winnerDelay, createEmailCampaign.winnerDelay) && + Objects.equals(this.ipWarmupEnable, createEmailCampaign.ipWarmupEnable) && + Objects.equals(this.initialQuota, createEmailCampaign.initialQuota) && + Objects.equals(this.increaseRate, createEmailCampaign.increaseRate) && + Objects.equals(this.unsubscriptionPageId, createEmailCampaign.unsubscriptionPageId) && + Objects.equals(this.updateFormId, createEmailCampaign.updateFormId); + } + + @Override + public int hashCode() { + return Objects.hash(tag, sender, name, htmlContent, htmlUrl, templateId, scheduledAt, subject, previewText, replyTo, toField, recipients, attachmentUrl, inlineImageActivation, mirrorActive, footer, header, utmCampaign, params, sendAtBestTime, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, ipWarmupEnable, initialQuota, increaseRate, unsubscriptionPageId, updateFormId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEmailCampaign {\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" attachmentUrl: ").append(toIndentedString(attachmentUrl)).append("\n"); + sb.append(" inlineImageActivation: ").append(toIndentedString(inlineImageActivation)).append("\n"); + sb.append(" mirrorActive: ").append(toIndentedString(mirrorActive)).append("\n"); + sb.append(" footer: ").append(toIndentedString(footer)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" utmCampaign: ").append(toIndentedString(utmCampaign)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" ipWarmupEnable: ").append(toIndentedString(ipWarmupEnable)).append("\n"); + sb.append(" initialQuota: ").append(toIndentedString(initialQuota)).append("\n"); + sb.append(" increaseRate: ").append(toIndentedString(increaseRate)).append("\n"); + sb.append(" unsubscriptionPageId: ").append(toIndentedString(unsubscriptionPageId)).append("\n"); + sb.append(" updateFormId: ").append(toIndentedString(updateFormId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlUrl` to the URL query string + if (getHtmlUrl() != null) { + try { + joiner.add(String.format("%shtmlUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `attachmentUrl` to the URL query string + if (getAttachmentUrl() != null) { + try { + joiner.add(String.format("%sattachmentUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttachmentUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inlineImageActivation` to the URL query string + if (getInlineImageActivation() != null) { + try { + joiner.add(String.format("%sinlineImageActivation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInlineImageActivation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mirrorActive` to the URL query string + if (getMirrorActive() != null) { + try { + joiner.add(String.format("%smirrorActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `footer` to the URL query string + if (getFooter() != null) { + try { + joiner.add(String.format("%sfooter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header` to the URL query string + if (getHeader() != null) { + try { + joiner.add(String.format("%sheader%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `utmCampaign` to the URL query string + if (getUtmCampaign() != null) { + try { + joiner.add(String.format("%sutmCampaign%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUtmCampaign()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `params` to the URL query string + if (getParams() != null) { + for (String _key : getParams().keySet()) { + try { + joiner.add(String.format("%sparams%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getParams().get(_key), URLEncoder.encode(String.valueOf(getParams().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ipWarmupEnable` to the URL query string + if (getIpWarmupEnable() != null) { + try { + joiner.add(String.format("%sipWarmupEnable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIpWarmupEnable()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `initialQuota` to the URL query string + if (getInitialQuota() != null) { + try { + joiner.add(String.format("%sinitialQuota%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInitialQuota()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `increaseRate` to the URL query string + if (getIncreaseRate() != null) { + try { + joiner.add(String.format("%sincreaseRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIncreaseRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscriptionPageId` to the URL query string + if (getUnsubscriptionPageId() != null) { + try { + joiner.add(String.format("%sunsubscriptionPageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscriptionPageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updateFormId` to the URL query string + if (getUpdateFormId() != null) { + try { + joiner.add(String.format("%supdateFormId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateFormId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignRecipients.java new file mode 100644 index 0000000..0c0212a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignRecipients.java @@ -0,0 +1,275 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Segment ids and List ids to include/exclude from campaign + */ +@JsonPropertyOrder({ + CreateEmailCampaignRecipients.JSON_PROPERTY_EXCLUSION_LIST_IDS, + CreateEmailCampaignRecipients.JSON_PROPERTY_LIST_IDS, + CreateEmailCampaignRecipients.JSON_PROPERTY_SEGMENT_IDS +}) +@JsonTypeName("createEmailCampaign_recipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateEmailCampaignRecipients { + public static final String JSON_PROPERTY_EXCLUSION_LIST_IDS = "exclusionListIds"; + private List exclusionListIds; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_SEGMENT_IDS = "segmentIds"; + private List segmentIds; + + public CreateEmailCampaignRecipients() { + } + + public CreateEmailCampaignRecipients exclusionListIds(List exclusionListIds) { + + this.exclusionListIds = exclusionListIds; + return this; + } + + public CreateEmailCampaignRecipients addExclusionListIdsItem(Long exclusionListIdsItem) { + if (this.exclusionListIds == null) { + this.exclusionListIds = new ArrayList<>(); + } + this.exclusionListIds.add(exclusionListIdsItem); + return this; + } + + /** + * List ids to exclude from the campaign + * @return exclusionListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExclusionListIds() { + return exclusionListIds; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExclusionListIds(List exclusionListIds) { + this.exclusionListIds = exclusionListIds; + } + + + public CreateEmailCampaignRecipients listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public CreateEmailCampaignRecipients addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public CreateEmailCampaignRecipients segmentIds(List segmentIds) { + + this.segmentIds = segmentIds; + return this; + } + + public CreateEmailCampaignRecipients addSegmentIdsItem(Long segmentIdsItem) { + if (this.segmentIds == null) { + this.segmentIds = new ArrayList<>(); + } + this.segmentIds.add(segmentIdsItem); + return this; + } + + /** + * **Mandatory if listIds are not used**. Segment ids to send the campaign to. + * @return segmentIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSegmentIds() { + return segmentIds; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentIds(List segmentIds) { + this.segmentIds = segmentIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmailCampaignRecipients createEmailCampaignRecipients = (CreateEmailCampaignRecipients) o; + return Objects.equals(this.exclusionListIds, createEmailCampaignRecipients.exclusionListIds) && + Objects.equals(this.listIds, createEmailCampaignRecipients.listIds) && + Objects.equals(this.segmentIds, createEmailCampaignRecipients.segmentIds); + } + + @Override + public int hashCode() { + return Objects.hash(exclusionListIds, listIds, segmentIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEmailCampaignRecipients {\n"); + sb.append(" exclusionListIds: ").append(toIndentedString(exclusionListIds)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" segmentIds: ").append(toIndentedString(segmentIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `exclusionListIds` to the URL query string + if (getExclusionListIds() != null) { + for (int i = 0; i < getExclusionListIds().size(); i++) { + try { + joiner.add(String.format("%sexclusionListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExclusionListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `segmentIds` to the URL query string + if (getSegmentIds() != null) { + for (int i = 0; i < getSegmentIds().size(); i++) { + try { + joiner.add(String.format("%ssegmentIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSegmentIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignSender.java new file mode 100644 index 0000000..41683ac --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateEmailCampaignSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{\"name\":\"xyz\", \"email\":\"example@abc.com\"}** **{\"name\":\"xyz\", \"id\":123}** + */ +@JsonPropertyOrder({ + CreateEmailCampaignSender.JSON_PROPERTY_NAME, + CreateEmailCampaignSender.JSON_PROPERTY_EMAIL, + CreateEmailCampaignSender.JSON_PROPERTY_ID +}) +@JsonTypeName("createEmailCampaign_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateEmailCampaignSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateEmailCampaignSender() { + } + + public CreateEmailCampaignSender name(String name) { + + this.name = name; + return this; + } + + /** + * Sender Name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CreateEmailCampaignSender email(String email) { + + this.email = email; + return this; + } + + /** + * Sender email + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateEmailCampaignSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Select the sender for the campaign on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmailCampaignSender createEmailCampaignSender = (CreateEmailCampaignSender) o; + return Objects.equals(this.name, createEmailCampaignSender.name) && + Objects.equals(this.email, createEmailCampaignSender.email) && + Objects.equals(this.id, createEmailCampaignSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEmailCampaignSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed.java new file mode 100644 index 0000000..02ee8a2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed.java @@ -0,0 +1,539 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExternalFeedByUUIDHeadersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateExternalFeed + */ +@JsonPropertyOrder({ + CreateExternalFeed.JSON_PROPERTY_NAME, + CreateExternalFeed.JSON_PROPERTY_URL, + CreateExternalFeed.JSON_PROPERTY_AUTH_TYPE, + CreateExternalFeed.JSON_PROPERTY_USERNAME, + CreateExternalFeed.JSON_PROPERTY_PASSWORD, + CreateExternalFeed.JSON_PROPERTY_TOKEN, + CreateExternalFeed.JSON_PROPERTY_HEADERS, + CreateExternalFeed.JSON_PROPERTY_MAX_RETRIES, + CreateExternalFeed.JSON_PROPERTY_CACHE +}) +@JsonTypeName("createExternalFeed") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateExternalFeed { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + */ + public enum AuthTypeEnum { + BASIC("basic"), + + TOKEN("token"), + + NOAUTH("noAuth"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_AUTH_TYPE = "authType"; + private AuthTypeEnum authType = AuthTypeEnum.NOAUTH; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers; + + public static final String JSON_PROPERTY_MAX_RETRIES = "maxRetries"; + private Integer maxRetries = 5; + + public static final String JSON_PROPERTY_CACHE = "cache"; + private Boolean cache = false; + + public CreateExternalFeed() { + } + + public CreateExternalFeed name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the feed + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateExternalFeed url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the feed + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateExternalFeed authType(AuthTypeEnum authType) { + + this.authType = authType; + return this; + } + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + * @return authType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AuthTypeEnum getAuthType() { + return authType; + } + + + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthType(AuthTypeEnum authType) { + this.authType = authType; + } + + + public CreateExternalFeed username(String username) { + + this.username = username; + return this; + } + + /** + * Username for authType `basic` + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + + public CreateExternalFeed password(String password) { + + this.password = password; + return this; + } + + /** + * Password for authType `basic` + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + + public CreateExternalFeed token(String token) { + + this.token = token; + return this; + } + + /** + * Token for authType `token` + * @return token + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(String token) { + this.token = token; + } + + + public CreateExternalFeed headers(List headers) { + + this.headers = headers; + return this; + } + + public CreateExternalFeed addHeadersItem(GetExternalFeedByUUIDHeadersInner headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Custom headers for the feed + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + + public CreateExternalFeed maxRetries(Integer maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Maximum number of retries on the feed url + * minimum: 0 + * maximum: 5 + * @return maxRetries + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxRetries() { + return maxRetries; + } + + + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + + public CreateExternalFeed cache(Boolean cache) { + + this.cache = cache; + return this; + } + + /** + * Toggle caching of feed url response + * @return cache + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCache() { + return cache; + } + + + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCache(Boolean cache) { + this.cache = cache; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateExternalFeed createExternalFeed = (CreateExternalFeed) o; + return Objects.equals(this.name, createExternalFeed.name) && + Objects.equals(this.url, createExternalFeed.url) && + Objects.equals(this.authType, createExternalFeed.authType) && + Objects.equals(this.username, createExternalFeed.username) && + Objects.equals(this.password, createExternalFeed.password) && + Objects.equals(this.token, createExternalFeed.token) && + Objects.equals(this.headers, createExternalFeed.headers) && + Objects.equals(this.maxRetries, createExternalFeed.maxRetries) && + Objects.equals(this.cache, createExternalFeed.cache); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, authType, username, password, token, headers, maxRetries, cache); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateExternalFeed {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" cache: ").append(toIndentedString(cache)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authType` to the URL query string + if (getAuthType() != null) { + try { + joiner.add(String.format("%sauthType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `username` to the URL query string + if (getUsername() != null) { + try { + joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `token` to the URL query string + if (getToken() != null) { + try { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToken()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + if (getHeaders().get(i) != null) { + joiner.add(getHeaders().get(i).toUrlQueryString(String.format("%sheaders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `maxRetries` to the URL query string + if (getMaxRetries() != null) { + try { + joiner.add(String.format("%smaxRetries%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMaxRetries()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `cache` to the URL query string + if (getCache() != null) { + try { + joiner.add(String.format("%scache%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCache()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed201Response.java new file mode 100644 index 0000000..0643cbc --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateExternalFeed201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateExternalFeed201Response + */ +@JsonPropertyOrder({ + CreateExternalFeed201Response.JSON_PROPERTY_ID +}) +@JsonTypeName("createExternalFeed_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateExternalFeed201Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CreateExternalFeed201Response() { + } + + public CreateExternalFeed201Response id(String id) { + + this.id = id; + return this; + } + + /** + * ID of the object created + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateExternalFeed201Response createExternalFeed201Response = (CreateExternalFeed201Response) o; + return Objects.equals(this.id, createExternalFeed201Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateExternalFeed201Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateList.java new file mode 100644 index 0000000..dbae9ad --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateList.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateList + */ +@JsonPropertyOrder({ + CreateList.JSON_PROPERTY_NAME, + CreateList.JSON_PROPERTY_FOLDER_ID +}) +@JsonTypeName("createList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateList { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_FOLDER_ID = "folderId"; + private Long folderId; + + public CreateList() { + } + + public CreateList name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the list + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateList folderId(Long folderId) { + + this.folderId = folderId; + return this; + } + + /** + * Id of the parent folder in which this list is to be created + * @return folderId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getFolderId() { + return folderId; + } + + + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateList createList = (CreateList) o; + return Objects.equals(this.name, createList.name) && + Objects.equals(this.folderId, createList.folderId); + } + + @Override + public int hashCode() { + return Objects.hash(name, folderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateList {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" folderId: ").append(toIndentedString(folderId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `folderId` to the URL query string + if (getFolderId() != null) { + try { + joiner.add(String.format("%sfolderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFolderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateModel.java new file mode 100644 index 0000000..0ccad65 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateModel.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateModel + */ +@JsonPropertyOrder({ + CreateModel.JSON_PROPERTY_ID +}) +@JsonTypeName("createModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateModel() { + } + + public CreateModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the object created + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateModel createModel = (CreateModel) o; + return Objects.equals(this.id, createModel.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateProductModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateProductModel.java new file mode 100644 index 0000000..530f98e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateProductModel.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateProductModel + */ +@JsonPropertyOrder({ + CreateProductModel.JSON_PROPERTY_ID +}) +@JsonTypeName("createProductModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateProductModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateProductModel() { + } + + public CreateProductModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the Product when a new product is created + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProductModel createProductModel = (CreateProductModel) o; + return Objects.equals(this.id, createProductModel.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProductModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateReseller.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateReseller.java new file mode 100644 index 0000000..1e8fc4a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateReseller.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateReseller + */ +@JsonPropertyOrder({ + CreateReseller.JSON_PROPERTY_AUTH_KEY, + CreateReseller.JSON_PROPERTY_ID +}) +@JsonTypeName("createReseller") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateReseller { + public static final String JSON_PROPERTY_AUTH_KEY = "authKey"; + private String authKey; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateReseller() { + } + + public CreateReseller authKey(String authKey) { + + this.authKey = authKey; + return this; + } + + /** + * AuthKey of Reseller child created + * @return authKey + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AUTH_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getAuthKey() { + return authKey; + } + + + @JsonProperty(JSON_PROPERTY_AUTH_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthKey(String authKey) { + this.authKey = authKey; + } + + + public CreateReseller id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of Reseller child created + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateReseller createReseller = (CreateReseller) o; + return Objects.equals(this.authKey, createReseller.authKey) && + Objects.equals(this.id, createReseller.id); + } + + @Override + public int hashCode() { + return Objects.hash(authKey, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateReseller {\n"); + sb.append(" authKey: ").append(toIndentedString(authKey)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `authKey` to the URL query string + if (getAuthKey() != null) { + try { + joiner.add(String.format("%sauthKey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthKey()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSender.java new file mode 100644 index 0000000..36cc094 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSender.java @@ -0,0 +1,248 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CreateSenderIpsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSender + */ +@JsonPropertyOrder({ + CreateSender.JSON_PROPERTY_NAME, + CreateSender.JSON_PROPERTY_EMAIL, + CreateSender.JSON_PROPERTY_IPS +}) +@JsonTypeName("createSender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips; + + public CreateSender() { + } + + public CreateSender name(String name) { + + this.name = name; + return this; + } + + /** + * From Name to use for the sender + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateSender email(String email) { + + this.email = email; + return this; + } + + /** + * From email to use for the sender. A verification email will be sent to this address. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateSender ips(List ips) { + + this.ips = ips; + return this; + } + + public CreateSender addIpsItem(CreateSenderIpsInner ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * **Mandatory in case of dedicated IP**. IPs to associate to the sender + * @return ips + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIps(List ips) { + this.ips = ips; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSender createSender = (CreateSender) o; + return Objects.equals(this.name, createSender.name) && + Objects.equals(this.email, createSender.email) && + Objects.equals(this.ips, createSender.ips); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, ips); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" ips: ").append(toIndentedString(ips)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + if (getIps().get(i) != null) { + joiner.add(getIps().get(i).toUrlQueryString(String.format("%sips%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderIpsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderIpsInner.java new file mode 100644 index 0000000..d0373a7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderIpsInner.java @@ -0,0 +1,238 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSenderIpsInner + */ +@JsonPropertyOrder({ + CreateSenderIpsInner.JSON_PROPERTY_IP, + CreateSenderIpsInner.JSON_PROPERTY_DOMAIN, + CreateSenderIpsInner.JSON_PROPERTY_WEIGHT +}) +@JsonTypeName("createSender_ips_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSenderIpsInner { + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_WEIGHT = "weight"; + private Long weight; + + public CreateSenderIpsInner() { + } + + public CreateSenderIpsInner ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated IP available in your account + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + + public CreateSenderIpsInner domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Domain of the IP + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public CreateSenderIpsInner weight(Long weight) { + + this.weight = weight; + return this; + } + + /** + * Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. + * minimum: 1 + * maximum: 100 + * @return weight + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getWeight() { + return weight; + } + + + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWeight(Long weight) { + this.weight = weight; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSenderIpsInner createSenderIpsInner = (CreateSenderIpsInner) o; + return Objects.equals(this.ip, createSenderIpsInner.ip) && + Objects.equals(this.domain, createSenderIpsInner.domain) && + Objects.equals(this.weight, createSenderIpsInner.weight); + } + + @Override + public int hashCode() { + return Objects.hash(ip, domain, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSenderIpsInner {\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `weight` to the URL query string + if (getWeight() != null) { + try { + joiner.add(String.format("%sweight%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWeight()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderModel.java new file mode 100644 index 0000000..28aa62f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSenderModel.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSenderModel + */ +@JsonPropertyOrder({ + CreateSenderModel.JSON_PROPERTY_ID, + CreateSenderModel.JSON_PROPERTY_SPF_ERROR, + CreateSenderModel.JSON_PROPERTY_DKIM_ERROR +}) +@JsonTypeName("createSenderModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSenderModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_SPF_ERROR = "spfError"; + private Boolean spfError; + + public static final String JSON_PROPERTY_DKIM_ERROR = "dkimError"; + private Boolean dkimError; + + public CreateSenderModel() { + } + + public CreateSenderModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the Sender created + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public CreateSenderModel spfError(Boolean spfError) { + + this.spfError = spfError; + return this; + } + + /** + * Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) + * @return spfError + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPF_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSpfError() { + return spfError; + } + + + @JsonProperty(JSON_PROPERTY_SPF_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpfError(Boolean spfError) { + this.spfError = spfError; + } + + + public CreateSenderModel dkimError(Boolean dkimError) { + + this.dkimError = dkimError; + return this; + } + + /** + * Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) + * @return dkimError + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DKIM_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDkimError() { + return dkimError; + } + + + @JsonProperty(JSON_PROPERTY_DKIM_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDkimError(Boolean dkimError) { + this.dkimError = dkimError; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSenderModel createSenderModel = (CreateSenderModel) o; + return Objects.equals(this.id, createSenderModel.id) && + Objects.equals(this.spfError, createSenderModel.spfError) && + Objects.equals(this.dkimError, createSenderModel.dkimError); + } + + @Override + public int hashCode() { + return Objects.hash(id, spfError, dkimError); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSenderModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spfError: ").append(toIndentedString(spfError)).append("\n"); + sb.append(" dkimError: ").append(toIndentedString(dkimError)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `spfError` to the URL query string + if (getSpfError() != null) { + try { + joiner.add(String.format("%sspfError%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpfError()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `dkimError` to the URL query string + if (getDkimError() != null) { + try { + joiner.add(String.format("%sdkimError%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDkimError()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaign.java new file mode 100644 index 0000000..21cf9d4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaign.java @@ -0,0 +1,442 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateSmsCampaignRecipients; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSmsCampaign + */ +@JsonPropertyOrder({ + CreateSmsCampaign.JSON_PROPERTY_NAME, + CreateSmsCampaign.JSON_PROPERTY_SENDER, + CreateSmsCampaign.JSON_PROPERTY_CONTENT, + CreateSmsCampaign.JSON_PROPERTY_RECIPIENTS, + CreateSmsCampaign.JSON_PROPERTY_SCHEDULED_AT, + CreateSmsCampaign.JSON_PROPERTY_UNICODE_ENABLED, + CreateSmsCampaign.JSON_PROPERTY_ORGANISATION_PREFIX, + CreateSmsCampaign.JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION +}) +@JsonTypeName("createSmsCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSmsCampaign { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private CreateSmsCampaignRecipients recipients; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_UNICODE_ENABLED = "unicodeEnabled"; + private Boolean unicodeEnabled = false; + + public static final String JSON_PROPERTY_ORGANISATION_PREFIX = "organisationPrefix"; + private String organisationPrefix; + + public static final String JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION = "unsubscribeInstruction"; + private String unsubscribeInstruction; + + public CreateSmsCampaign() { + } + + public CreateSmsCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateSmsCampaign sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public CreateSmsCampaign content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS + * @return content + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; + } + + + public CreateSmsCampaign recipients(CreateSmsCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateSmsCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(CreateSmsCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public CreateSmsCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public CreateSmsCampaign unicodeEnabled(Boolean unicodeEnabled) { + + this.unicodeEnabled = unicodeEnabled; + return this; + } + + /** + * Format of the message. It indicates whether the content should be treated as unicode or not. + * @return unicodeEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUnicodeEnabled() { + return unicodeEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnicodeEnabled(Boolean unicodeEnabled) { + this.unicodeEnabled = unicodeEnabled; + } + + + public CreateSmsCampaign organisationPrefix(String organisationPrefix) { + + this.organisationPrefix = organisationPrefix; + return this; + } + + /** + * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + * @return organisationPrefix + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOrganisationPrefix() { + return organisationPrefix; + } + + + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrganisationPrefix(String organisationPrefix) { + this.organisationPrefix = organisationPrefix; + } + + + public CreateSmsCampaign unsubscribeInstruction(String unsubscribeInstruction) { + + this.unsubscribeInstruction = unsubscribeInstruction; + return this; + } + + /** + * Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** + * @return unsubscribeInstruction + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUnsubscribeInstruction() { + return unsubscribeInstruction; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscribeInstruction(String unsubscribeInstruction) { + this.unsubscribeInstruction = unsubscribeInstruction; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSmsCampaign createSmsCampaign = (CreateSmsCampaign) o; + return Objects.equals(this.name, createSmsCampaign.name) && + Objects.equals(this.sender, createSmsCampaign.sender) && + Objects.equals(this.content, createSmsCampaign.content) && + Objects.equals(this.recipients, createSmsCampaign.recipients) && + Objects.equals(this.scheduledAt, createSmsCampaign.scheduledAt) && + Objects.equals(this.unicodeEnabled, createSmsCampaign.unicodeEnabled) && + Objects.equals(this.organisationPrefix, createSmsCampaign.organisationPrefix) && + Objects.equals(this.unsubscribeInstruction, createSmsCampaign.unsubscribeInstruction); + } + + @Override + public int hashCode() { + return Objects.hash(name, sender, content, recipients, scheduledAt, unicodeEnabled, organisationPrefix, unsubscribeInstruction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSmsCampaign {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" unicodeEnabled: ").append(toIndentedString(unicodeEnabled)).append("\n"); + sb.append(" organisationPrefix: ").append(toIndentedString(organisationPrefix)).append("\n"); + sb.append(" unsubscribeInstruction: ").append(toIndentedString(unsubscribeInstruction)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unicodeEnabled` to the URL query string + if (getUnicodeEnabled() != null) { + try { + joiner.add(String.format("%sunicodeEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnicodeEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `organisationPrefix` to the URL query string + if (getOrganisationPrefix() != null) { + try { + joiner.add(String.format("%sorganisationPrefix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrganisationPrefix()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribeInstruction` to the URL query string + if (getUnsubscribeInstruction() != null) { + try { + joiner.add(String.format("%sunsubscribeInstruction%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribeInstruction()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaignRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaignRecipients.java new file mode 100644 index 0000000..fd006ba --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmsCampaignRecipients.java @@ -0,0 +1,221 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSmsCampaignRecipients + */ +@JsonPropertyOrder({ + CreateSmsCampaignRecipients.JSON_PROPERTY_LIST_IDS, + CreateSmsCampaignRecipients.JSON_PROPERTY_EXCLUSION_LIST_IDS +}) +@JsonTypeName("createSmsCampaign_recipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSmsCampaignRecipients { + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXCLUSION_LIST_IDS = "exclusionListIds"; + private List exclusionListIds; + + public CreateSmsCampaignRecipients() { + } + + public CreateSmsCampaignRecipients listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public CreateSmsCampaignRecipients addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** + * @return listIds + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public CreateSmsCampaignRecipients exclusionListIds(List exclusionListIds) { + + this.exclusionListIds = exclusionListIds; + return this; + } + + public CreateSmsCampaignRecipients addExclusionListIdsItem(Long exclusionListIdsItem) { + if (this.exclusionListIds == null) { + this.exclusionListIds = new ArrayList<>(); + } + this.exclusionListIds.add(exclusionListIdsItem); + return this; + } + + /** + * List ids which have to be excluded from a campaign + * @return exclusionListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExclusionListIds() { + return exclusionListIds; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExclusionListIds(List exclusionListIds) { + this.exclusionListIds = exclusionListIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSmsCampaignRecipients createSmsCampaignRecipients = (CreateSmsCampaignRecipients) o; + return Objects.equals(this.listIds, createSmsCampaignRecipients.listIds) && + Objects.equals(this.exclusionListIds, createSmsCampaignRecipients.exclusionListIds); + } + + @Override + public int hashCode() { + return Objects.hash(listIds, exclusionListIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSmsCampaignRecipients {\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" exclusionListIds: ").append(toIndentedString(exclusionListIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `exclusionListIds` to the URL query string + if (getExclusionListIds() != null) { + for (int i = 0; i < getExclusionListIds().size(); i++) { + try { + joiner.add(String.format("%sexclusionListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExclusionListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpEmail.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpEmail.java new file mode 100644 index 0000000..206f932 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpEmail.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSmtpEmail + */ +@JsonPropertyOrder({ + CreateSmtpEmail.JSON_PROPERTY_MESSAGE_ID, + CreateSmtpEmail.JSON_PROPERTY_MESSAGE_IDS +}) +@JsonTypeName("createSmtpEmail") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSmtpEmail { + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + public static final String JSON_PROPERTY_MESSAGE_IDS = "messageIds"; + private List messageIds; + + public CreateSmtpEmail() { + } + + public CreateSmtpEmail messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message ID of the transactional email sent + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public CreateSmtpEmail messageIds(List messageIds) { + + this.messageIds = messageIds; + return this; + } + + public CreateSmtpEmail addMessageIdsItem(String messageIdsItem) { + if (this.messageIds == null) { + this.messageIds = new ArrayList<>(); + } + this.messageIds.add(messageIdsItem); + return this; + } + + /** + * Get messageIds + * @return messageIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMessageIds() { + return messageIds; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageIds(List messageIds) { + this.messageIds = messageIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSmtpEmail createSmtpEmail = (CreateSmtpEmail) o; + return Objects.equals(this.messageId, createSmtpEmail.messageId) && + Objects.equals(this.messageIds, createSmtpEmail.messageIds); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSmtpEmail {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageIds: ").append(toIndentedString(messageIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageIds` to the URL query string + if (getMessageIds() != null) { + for (int i = 0; i < getMessageIds().size(); i++) { + try { + joiner.add(String.format("%smessageIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getMessageIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplate.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplate.java new file mode 100644 index 0000000..5dcaf66 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplate.java @@ -0,0 +1,526 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateSmtpTemplateSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSmtpTemplate + */ +@JsonPropertyOrder({ + CreateSmtpTemplate.JSON_PROPERTY_TAG, + CreateSmtpTemplate.JSON_PROPERTY_SENDER, + CreateSmtpTemplate.JSON_PROPERTY_TEMPLATE_NAME, + CreateSmtpTemplate.JSON_PROPERTY_HTML_CONTENT, + CreateSmtpTemplate.JSON_PROPERTY_HTML_URL, + CreateSmtpTemplate.JSON_PROPERTY_SUBJECT, + CreateSmtpTemplate.JSON_PROPERTY_REPLY_TO, + CreateSmtpTemplate.JSON_PROPERTY_TO_FIELD, + CreateSmtpTemplate.JSON_PROPERTY_ATTACHMENT_URL, + CreateSmtpTemplate.JSON_PROPERTY_IS_ACTIVE +}) +@JsonTypeName("createSmtpTemplate") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSmtpTemplate { + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private CreateSmtpTemplateSender sender; + + public static final String JSON_PROPERTY_TEMPLATE_NAME = "templateName"; + private String templateName; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_HTML_URL = "htmlUrl"; + private String htmlUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_ATTACHMENT_URL = "attachmentUrl"; + private String attachmentUrl; + + public static final String JSON_PROPERTY_IS_ACTIVE = "isActive"; + private Boolean isActive; + + public CreateSmtpTemplate() { + } + + public CreateSmtpTemplate tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the template + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public CreateSmtpTemplate sender(CreateSmtpTemplateSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CreateSmtpTemplateSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(CreateSmtpTemplateSender sender) { + this.sender = sender; + } + + + public CreateSmtpTemplate templateName(String templateName) { + + this.templateName = templateName; + return this; + } + + /** + * Name of the template + * @return templateName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTemplateName() { + return templateName; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + + public CreateSmtpTemplate htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * Body of the message (HTML version). The field must have more than 10 characters. **REQUIRED if htmlUrl is empty** + * @return htmlContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public CreateSmtpTemplate htmlUrl(String htmlUrl) { + + this.htmlUrl = htmlUrl; + return this; + } + + /** + * Url which contents the body of the email message. REQUIRED if htmlContent is empty + * @return htmlUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlUrl() { + return htmlUrl; + } + + + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlUrl(String htmlUrl) { + this.htmlUrl = htmlUrl; + } + + + public CreateSmtpTemplate subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the template + * @return subject + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateSmtpTemplate replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email on which campaign recipients will be able to reply to + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public CreateSmtpTemplate toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public CreateSmtpTemplate attachmentUrl(String attachmentUrl) { + + this.attachmentUrl = attachmentUrl; + return this; + } + + /** + * Absolute url of the attachment (**no local file**). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' + * @return attachmentUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttachmentUrl() { + return attachmentUrl; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachmentUrl(String attachmentUrl) { + this.attachmentUrl = attachmentUrl; + } + + + public CreateSmtpTemplate isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Status of template. isActive = true means template is active and isActive = false means template is inactive + * @return isActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSmtpTemplate createSmtpTemplate = (CreateSmtpTemplate) o; + return Objects.equals(this.tag, createSmtpTemplate.tag) && + Objects.equals(this.sender, createSmtpTemplate.sender) && + Objects.equals(this.templateName, createSmtpTemplate.templateName) && + Objects.equals(this.htmlContent, createSmtpTemplate.htmlContent) && + Objects.equals(this.htmlUrl, createSmtpTemplate.htmlUrl) && + Objects.equals(this.subject, createSmtpTemplate.subject) && + Objects.equals(this.replyTo, createSmtpTemplate.replyTo) && + Objects.equals(this.toField, createSmtpTemplate.toField) && + Objects.equals(this.attachmentUrl, createSmtpTemplate.attachmentUrl) && + Objects.equals(this.isActive, createSmtpTemplate.isActive); + } + + @Override + public int hashCode() { + return Objects.hash(tag, sender, templateName, htmlContent, htmlUrl, subject, replyTo, toField, attachmentUrl, isActive); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSmtpTemplate {\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" attachmentUrl: ").append(toIndentedString(attachmentUrl)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `templateName` to the URL query string + if (getTemplateName() != null) { + try { + joiner.add(String.format("%stemplateName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlUrl` to the URL query string + if (getHtmlUrl() != null) { + try { + joiner.add(String.format("%shtmlUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attachmentUrl` to the URL query string + if (getAttachmentUrl() != null) { + try { + joiner.add(String.format("%sattachmentUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttachmentUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isActive` to the URL query string + if (getIsActive() != null) { + try { + joiner.add(String.format("%sisActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplateSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplateSender.java new file mode 100644 index 0000000..cb9ea0e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSmtpTemplateSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{\"name\":\"xyz\", \"email\":\"example@abc.com\"}** **{\"name\":\"xyz\", \"id\":123}** + */ +@JsonPropertyOrder({ + CreateSmtpTemplateSender.JSON_PROPERTY_NAME, + CreateSmtpTemplateSender.JSON_PROPERTY_EMAIL, + CreateSmtpTemplateSender.JSON_PROPERTY_ID +}) +@JsonTypeName("createSmtpTemplate_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSmtpTemplateSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateSmtpTemplateSender() { + } + + public CreateSmtpTemplateSender name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the sender. **If not passed, will be set to default** + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CreateSmtpTemplateSender email(String email) { + + this.email = email; + return this; + } + + /** + * Email of the sender + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateSmtpTemplateSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSmtpTemplateSender createSmtpTemplateSender = (CreateSmtpTemplateSender) o; + return Objects.equals(this.name, createSmtpTemplateSender.name) && + Objects.equals(this.email, createSmtpTemplateSender.email) && + Objects.equals(this.id, createSmtpTemplateSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSmtpTemplateSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccount.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccount.java new file mode 100644 index 0000000..fa13070 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccount.java @@ -0,0 +1,321 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSubAccount + */ +@JsonPropertyOrder({ + CreateSubAccount.JSON_PROPERTY_COMPANY_NAME, + CreateSubAccount.JSON_PROPERTY_EMAIL, + CreateSubAccount.JSON_PROPERTY_LANGUAGE, + CreateSubAccount.JSON_PROPERTY_TIMEZONE +}) +@JsonTypeName("createSubAccount") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSubAccount { + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + /** + * Set the language of the sub-account + */ + public enum LanguageEnum { + EN("en"), + + FR("fr"), + + IT("it"), + + ES("es"), + + PT("pt"), + + DE("de"); + + private String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LanguageEnum fromValue(String value) { + for (LanguageEnum b : LanguageEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private LanguageEnum language; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public CreateSubAccount() { + } + + public CreateSubAccount companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Set the name of the sub-account company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public CreateSubAccount email(String email) { + + this.email = email; + return this; + } + + /** + * Email address for the organization + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public CreateSubAccount language(LanguageEnum language) { + + this.language = language; + return this; + } + + /** + * Set the language of the sub-account + * @return language + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LanguageEnum getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(LanguageEnum language) { + this.language = language; + } + + + public CreateSubAccount timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Set the timezone of the sub-account + * @return timezone + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTimezone() { + return timezone; + } + + + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubAccount createSubAccount = (CreateSubAccount) o; + return Objects.equals(this.companyName, createSubAccount.companyName) && + Objects.equals(this.email, createSubAccount.email) && + Objects.equals(this.language, createSubAccount.language) && + Objects.equals(this.timezone, createSubAccount.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(companyName, email, language, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubAccount {\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `timezone` to the URL query string + if (getTimezone() != null) { + try { + joiner.add(String.format("%stimezone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTimezone()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccountResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccountResponse.java new file mode 100644 index 0000000..5b76be3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateSubAccountResponse.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateSubAccountResponse + */ +@JsonPropertyOrder({ + CreateSubAccountResponse.JSON_PROPERTY_ID +}) +@JsonTypeName("createSubAccountResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateSubAccountResponse { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateSubAccountResponse() { + } + + public CreateSubAccountResponse id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the sub-account created + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubAccountResponse createSubAccountResponse = (CreateSubAccountResponse) o; + return Objects.equals(this.id, createSubAccountResponse.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubAccountResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategory.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategory.java new file mode 100644 index 0000000..7079027 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategory.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CreateUpdateCategories; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateBatchCategory + */ +@JsonPropertyOrder({ + CreateUpdateBatchCategory.JSON_PROPERTY_CATEGORIES, + CreateUpdateBatchCategory.JSON_PROPERTY_UPDATE_ENABLED +}) +@JsonTypeName("createUpdateBatchCategory") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateBatchCategory { + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories = new ArrayList<>(); + + public static final String JSON_PROPERTY_UPDATE_ENABLED = "updateEnabled"; + private Boolean updateEnabled; + + public CreateUpdateBatchCategory() { + } + + public CreateUpdateBatchCategory categories(List categories) { + + this.categories = categories; + return this; + } + + public CreateUpdateBatchCategory addCategoriesItem(CreateUpdateCategories categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * array of categories objects + * @return categories + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public CreateUpdateBatchCategory updateEnabled(Boolean updateEnabled) { + + this.updateEnabled = updateEnabled; + return this; + } + + /** + * Facilitate to update the existing categories in the same request (updateEnabled = true) + * @return updateEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateEnabled() { + return updateEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateEnabled(Boolean updateEnabled) { + this.updateEnabled = updateEnabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateBatchCategory createUpdateBatchCategory = (CreateUpdateBatchCategory) o; + return Objects.equals(this.categories, createUpdateBatchCategory.categories) && + Objects.equals(this.updateEnabled, createUpdateBatchCategory.updateEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(categories, updateEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateBatchCategory {\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" updateEnabled: ").append(toIndentedString(updateEnabled)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + if (getCategories().get(i) != null) { + joiner.add(getCategories().get(i).toUrlQueryString(String.format("%scategories%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `updateEnabled` to the URL query string + if (getUpdateEnabled() != null) { + try { + joiner.add(String.format("%supdateEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategoryModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategoryModel.java new file mode 100644 index 0000000..7d4b89c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchCategoryModel.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateBatchCategoryModel + */ +@JsonPropertyOrder({ + CreateUpdateBatchCategoryModel.JSON_PROPERTY_CREATED_COUNT, + CreateUpdateBatchCategoryModel.JSON_PROPERTY_UPDATED_COUNT +}) +@JsonTypeName("createUpdateBatchCategoryModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateBatchCategoryModel { + public static final String JSON_PROPERTY_CREATED_COUNT = "createdCount"; + private Long createdCount; + + public static final String JSON_PROPERTY_UPDATED_COUNT = "updatedCount"; + private Long updatedCount; + + public CreateUpdateBatchCategoryModel() { + } + + public CreateUpdateBatchCategoryModel createdCount(Long createdCount) { + + this.createdCount = createdCount; + return this; + } + + /** + * Number of the new created categories + * @return createdCount + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedCount() { + return createdCount; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedCount(Long createdCount) { + this.createdCount = createdCount; + } + + + public CreateUpdateBatchCategoryModel updatedCount(Long updatedCount) { + + this.updatedCount = updatedCount; + return this; + } + + /** + * Number of the existing categories updated + * @return updatedCount + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedCount() { + return updatedCount; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedCount(Long updatedCount) { + this.updatedCount = updatedCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateBatchCategoryModel createUpdateBatchCategoryModel = (CreateUpdateBatchCategoryModel) o; + return Objects.equals(this.createdCount, createUpdateBatchCategoryModel.createdCount) && + Objects.equals(this.updatedCount, createUpdateBatchCategoryModel.updatedCount); + } + + @Override + public int hashCode() { + return Objects.hash(createdCount, updatedCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateBatchCategoryModel {\n"); + sb.append(" createdCount: ").append(toIndentedString(createdCount)).append("\n"); + sb.append(" updatedCount: ").append(toIndentedString(updatedCount)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `createdCount` to the URL query string + if (getCreatedCount() != null) { + try { + joiner.add(String.format("%screatedCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updatedCount` to the URL query string + if (getUpdatedCount() != null) { + try { + joiner.add(String.format("%supdatedCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdatedCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProducts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProducts.java new file mode 100644 index 0000000..f6b6427 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProducts.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CreateUpdateProducts; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateBatchProducts + */ +@JsonPropertyOrder({ + CreateUpdateBatchProducts.JSON_PROPERTY_PRODUCTS, + CreateUpdateBatchProducts.JSON_PROPERTY_UPDATE_ENABLED +}) +@JsonTypeName("createUpdateBatchProducts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateBatchProducts { + public static final String JSON_PROPERTY_PRODUCTS = "products"; + private List products = new ArrayList<>(); + + public static final String JSON_PROPERTY_UPDATE_ENABLED = "updateEnabled"; + private Boolean updateEnabled; + + public CreateUpdateBatchProducts() { + } + + public CreateUpdateBatchProducts products(List products) { + + this.products = products; + return this; + } + + public CreateUpdateBatchProducts addProductsItem(CreateUpdateProducts productsItem) { + if (this.products == null) { + this.products = new ArrayList<>(); + } + this.products.add(productsItem); + return this; + } + + /** + * array of products objects + * @return products + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getProducts() { + return products; + } + + + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProducts(List products) { + this.products = products; + } + + + public CreateUpdateBatchProducts updateEnabled(Boolean updateEnabled) { + + this.updateEnabled = updateEnabled; + return this; + } + + /** + * Facilitate to update the existing categories in the same request (updateEnabled = true) + * @return updateEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateEnabled() { + return updateEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateEnabled(Boolean updateEnabled) { + this.updateEnabled = updateEnabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateBatchProducts createUpdateBatchProducts = (CreateUpdateBatchProducts) o; + return Objects.equals(this.products, createUpdateBatchProducts.products) && + Objects.equals(this.updateEnabled, createUpdateBatchProducts.updateEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(products, updateEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateBatchProducts {\n"); + sb.append(" products: ").append(toIndentedString(products)).append("\n"); + sb.append(" updateEnabled: ").append(toIndentedString(updateEnabled)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `products` to the URL query string + if (getProducts() != null) { + for (int i = 0; i < getProducts().size(); i++) { + if (getProducts().get(i) != null) { + joiner.add(getProducts().get(i).toUrlQueryString(String.format("%sproducts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `updateEnabled` to the URL query string + if (getUpdateEnabled() != null) { + try { + joiner.add(String.format("%supdateEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProductsModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProductsModel.java new file mode 100644 index 0000000..311778b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateBatchProductsModel.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateBatchProductsModel + */ +@JsonPropertyOrder({ + CreateUpdateBatchProductsModel.JSON_PROPERTY_CREATED_COUNT, + CreateUpdateBatchProductsModel.JSON_PROPERTY_UPDATED_COUNT +}) +@JsonTypeName("createUpdateBatchProductsModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateBatchProductsModel { + public static final String JSON_PROPERTY_CREATED_COUNT = "createdCount"; + private Long createdCount; + + public static final String JSON_PROPERTY_UPDATED_COUNT = "updatedCount"; + private Long updatedCount; + + public CreateUpdateBatchProductsModel() { + } + + public CreateUpdateBatchProductsModel createdCount(Long createdCount) { + + this.createdCount = createdCount; + return this; + } + + /** + * Number of the new created products + * @return createdCount + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedCount() { + return createdCount; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedCount(Long createdCount) { + this.createdCount = createdCount; + } + + + public CreateUpdateBatchProductsModel updatedCount(Long updatedCount) { + + this.updatedCount = updatedCount; + return this; + } + + /** + * Number of the existing products updated + * @return updatedCount + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedCount() { + return updatedCount; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedCount(Long updatedCount) { + this.updatedCount = updatedCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateBatchProductsModel createUpdateBatchProductsModel = (CreateUpdateBatchProductsModel) o; + return Objects.equals(this.createdCount, createUpdateBatchProductsModel.createdCount) && + Objects.equals(this.updatedCount, createUpdateBatchProductsModel.updatedCount); + } + + @Override + public int hashCode() { + return Objects.hash(createdCount, updatedCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateBatchProductsModel {\n"); + sb.append(" createdCount: ").append(toIndentedString(createdCount)).append("\n"); + sb.append(" updatedCount: ").append(toIndentedString(updatedCount)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `createdCount` to the URL query string + if (getCreatedCount() != null) { + try { + joiner.add(String.format("%screatedCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updatedCount` to the URL query string + if (getUpdatedCount() != null) { + try { + joiner.add(String.format("%supdatedCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdatedCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategories.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategories.java new file mode 100644 index 0000000..82402de --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategories.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateCategories + */ +@JsonPropertyOrder({ + CreateUpdateCategories.JSON_PROPERTY_ID, + CreateUpdateCategories.JSON_PROPERTY_NAME, + CreateUpdateCategories.JSON_PROPERTY_URL, + CreateUpdateCategories.JSON_PROPERTY_DELETED_AT +}) +@JsonTypeName("createUpdateCategories") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateCategories { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_DELETED_AT = "deletedAt"; + private String deletedAt; + + public CreateUpdateCategories() { + } + + public CreateUpdateCategories id(String id) { + + this.id = id; + return this; + } + + /** + * Unique Category ID as saved in the shop + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public CreateUpdateCategories name(String name) { + + this.name = name; + return this; + } + + /** + * **Mandatory in case of creation**. Name of the Category, as displayed in the shop + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CreateUpdateCategories url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the category + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateUpdateCategories deletedAt(String deletedAt) { + + this.deletedAt = deletedAt; + return this; + } + + /** + * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database + * @return deletedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateCategories createUpdateCategories = (CreateUpdateCategories) o; + return Objects.equals(this.id, createUpdateCategories.id) && + Objects.equals(this.name, createUpdateCategories.name) && + Objects.equals(this.url, createUpdateCategories.url) && + Objects.equals(this.deletedAt, createUpdateCategories.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateCategories {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `deletedAt` to the URL query string + if (getDeletedAt() != null) { + try { + joiner.add(String.format("%sdeletedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeletedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategory.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategory.java new file mode 100644 index 0000000..6d5c307 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateCategory.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateCategory + */ +@JsonPropertyOrder({ + CreateUpdateCategory.JSON_PROPERTY_ID, + CreateUpdateCategory.JSON_PROPERTY_NAME, + CreateUpdateCategory.JSON_PROPERTY_URL, + CreateUpdateCategory.JSON_PROPERTY_UPDATE_ENABLED, + CreateUpdateCategory.JSON_PROPERTY_DELETED_AT +}) +@JsonTypeName("createUpdateCategory") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateCategory { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_UPDATE_ENABLED = "updateEnabled"; + private Boolean updateEnabled = false; + + public static final String JSON_PROPERTY_DELETED_AT = "deletedAt"; + private String deletedAt; + + public CreateUpdateCategory() { + } + + public CreateUpdateCategory id(String id) { + + this.id = id; + return this; + } + + /** + * Unique Category ID as saved in the shop + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public CreateUpdateCategory name(String name) { + + this.name = name; + return this; + } + + /** + * **Mandatory in case of creation**. Name of the Category, as displayed in the shop + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CreateUpdateCategory url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the category + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateUpdateCategory updateEnabled(Boolean updateEnabled) { + + this.updateEnabled = updateEnabled; + return this; + } + + /** + * Facilitate to update the existing category in the same request (updateEnabled = true) + * @return updateEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateEnabled() { + return updateEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateEnabled(Boolean updateEnabled) { + this.updateEnabled = updateEnabled; + } + + + public CreateUpdateCategory deletedAt(String deletedAt) { + + this.deletedAt = deletedAt; + return this; + } + + /** + * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database + * @return deletedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateCategory createUpdateCategory = (CreateUpdateCategory) o; + return Objects.equals(this.id, createUpdateCategory.id) && + Objects.equals(this.name, createUpdateCategory.name) && + Objects.equals(this.url, createUpdateCategory.url) && + Objects.equals(this.updateEnabled, createUpdateCategory.updateEnabled) && + Objects.equals(this.deletedAt, createUpdateCategory.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, updateEnabled, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateCategory {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" updateEnabled: ").append(toIndentedString(updateEnabled)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updateEnabled` to the URL query string + if (getUpdateEnabled() != null) { + try { + joiner.add(String.format("%supdateEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `deletedAt` to the URL query string + if (getDeletedAt() != null) { + try { + joiner.add(String.format("%sdeletedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeletedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateContactModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateContactModel.java new file mode 100644 index 0000000..ad04b67 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateContactModel.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateContactModel + */ +@JsonPropertyOrder({ + CreateUpdateContactModel.JSON_PROPERTY_ID +}) +@JsonTypeName("createUpdateContactModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateContactModel { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public CreateUpdateContactModel() { + } + + public CreateUpdateContactModel id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the contact when a new contact is created + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateContactModel createUpdateContactModel = (CreateUpdateContactModel) o; + return Objects.equals(this.id, createUpdateContactModel.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateContactModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateFolder.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateFolder.java new file mode 100644 index 0000000..9526e43 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateFolder.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateFolder + */ +@JsonPropertyOrder({ + CreateUpdateFolder.JSON_PROPERTY_NAME +}) +@JsonTypeName("createUpdateFolder") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateFolder { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public CreateUpdateFolder() { + } + + public CreateUpdateFolder name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the folder + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateFolder createUpdateFolder = (CreateUpdateFolder) o; + return Objects.equals(this.name, createUpdateFolder.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateFolder {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProduct.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProduct.java new file mode 100644 index 0000000..0fcb227 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProduct.java @@ -0,0 +1,598 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import software.xdev.brevo.model.GetContactInfoIdentifierParameter; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateProduct + */ +@JsonPropertyOrder({ + CreateUpdateProduct.JSON_PROPERTY_ID, + CreateUpdateProduct.JSON_PROPERTY_NAME, + CreateUpdateProduct.JSON_PROPERTY_URL, + CreateUpdateProduct.JSON_PROPERTY_IMAGE_URL, + CreateUpdateProduct.JSON_PROPERTY_SKU, + CreateUpdateProduct.JSON_PROPERTY_PRICE, + CreateUpdateProduct.JSON_PROPERTY_CATEGORIES, + CreateUpdateProduct.JSON_PROPERTY_PARENT_ID, + CreateUpdateProduct.JSON_PROPERTY_META_INFO, + CreateUpdateProduct.JSON_PROPERTY_UPDATE_ENABLED, + CreateUpdateProduct.JSON_PROPERTY_DELETED_AT +}) +@JsonTypeName("createUpdateProduct") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateProduct { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + private String imageUrl; + + public static final String JSON_PROPERTY_SKU = "sku"; + private String sku; + + public static final String JSON_PROPERTY_PRICE = "price"; + private Float price; + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories; + + public static final String JSON_PROPERTY_PARENT_ID = "parentId"; + private String parentId; + + public static final String JSON_PROPERTY_META_INFO = "metaInfo"; + private Map metaInfo = new HashMap<>(); + + public static final String JSON_PROPERTY_UPDATE_ENABLED = "updateEnabled"; + private Boolean updateEnabled = false; + + public static final String JSON_PROPERTY_DELETED_AT = "deletedAt"; + private String deletedAt; + + public CreateUpdateProduct() { + } + + public CreateUpdateProduct id(String id) { + + this.id = id; + return this; + } + + /** + * Product ID for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public CreateUpdateProduct name(String name) { + + this.name = name; + return this; + } + + /** + * Mandatory in case of creation**. Name of the product for which you requested the details + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateUpdateProduct url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the product + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateUpdateProduct imageUrl(String imageUrl) { + + this.imageUrl = imageUrl; + return this; + } + + /** + * Absolute URL to the cover image of the product + * @return imageUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getImageUrl() { + return imageUrl; + } + + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + + public CreateUpdateProduct sku(String sku) { + + this.sku = sku; + return this; + } + + /** + * Product identifier from the shop + * @return sku + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSku() { + return sku; + } + + + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSku(String sku) { + this.sku = sku; + } + + + public CreateUpdateProduct price(Float price) { + + this.price = price; + return this; + } + + /** + * Price of the product + * @return price + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getPrice() { + return price; + } + + + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrice(Float price) { + this.price = price; + } + + + public CreateUpdateProduct categories(List categories) { + + this.categories = categories; + return this; + } + + public CreateUpdateProduct addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Category ID-s of the product + * @return categories + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public CreateUpdateProduct parentId(String parentId) { + + this.parentId = parentId; + return this; + } + + /** + * Parent product id of the product + * @return parentId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getParentId() { + return parentId; + } + + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentId(String parentId) { + this.parentId = parentId; + } + + + public CreateUpdateProduct metaInfo(Map metaInfo) { + + this.metaInfo = metaInfo; + return this; + } + + public CreateUpdateProduct putMetaInfoItem(String key, GetContactInfoIdentifierParameter metaInfoItem) { + if (this.metaInfo == null) { + this.metaInfo = new HashMap<>(); + } + this.metaInfo.put(key, metaInfoItem); + return this; + } + + /** + * Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. + * @return metaInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetaInfo() { + return metaInfo; + } + + + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetaInfo(Map metaInfo) { + this.metaInfo = metaInfo; + } + + + public CreateUpdateProduct updateEnabled(Boolean updateEnabled) { + + this.updateEnabled = updateEnabled; + return this; + } + + /** + * Facilitate to update the existing category in the same request (updateEnabled = true) + * @return updateEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateEnabled() { + return updateEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateEnabled(Boolean updateEnabled) { + this.updateEnabled = updateEnabled; + } + + + public CreateUpdateProduct deletedAt(String deletedAt) { + + this.deletedAt = deletedAt; + return this; + } + + /** + * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database + * @return deletedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateProduct createUpdateProduct = (CreateUpdateProduct) o; + return Objects.equals(this.id, createUpdateProduct.id) && + Objects.equals(this.name, createUpdateProduct.name) && + Objects.equals(this.url, createUpdateProduct.url) && + Objects.equals(this.imageUrl, createUpdateProduct.imageUrl) && + Objects.equals(this.sku, createUpdateProduct.sku) && + Objects.equals(this.price, createUpdateProduct.price) && + Objects.equals(this.categories, createUpdateProduct.categories) && + Objects.equals(this.parentId, createUpdateProduct.parentId) && + Objects.equals(this.metaInfo, createUpdateProduct.metaInfo) && + Objects.equals(this.updateEnabled, createUpdateProduct.updateEnabled) && + Objects.equals(this.deletedAt, createUpdateProduct.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, imageUrl, sku, price, categories, parentId, metaInfo, updateEnabled, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateProduct {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" sku: ").append(toIndentedString(sku)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" metaInfo: ").append(toIndentedString(metaInfo)).append("\n"); + sb.append(" updateEnabled: ").append(toIndentedString(updateEnabled)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + try { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getImageUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sku` to the URL query string + if (getSku() != null) { + try { + joiner.add(String.format("%ssku%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSku()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `price` to the URL query string + if (getPrice() != null) { + try { + joiner.add(String.format("%sprice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + try { + joiner.add(String.format("%scategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategories().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `parentId` to the URL query string + if (getParentId() != null) { + try { + joiner.add(String.format("%sparentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getParentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `metaInfo` to the URL query string + if (getMetaInfo() != null) { + for (String _key : getMetaInfo().keySet()) { + if (getMetaInfo().get(_key) != null) { + joiner.add(getMetaInfo().get(_key).toUrlQueryString(String.format("%smetaInfo%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `updateEnabled` to the URL query string + if (getUpdateEnabled() != null) { + try { + joiner.add(String.format("%supdateEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `deletedAt` to the URL query string + if (getDeletedAt() != null) { + try { + joiner.add(String.format("%sdeletedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeletedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProducts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProducts.java new file mode 100644 index 0000000..383a016 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateUpdateProducts.java @@ -0,0 +1,556 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import software.xdev.brevo.model.GetContactInfoIdentifierParameter; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateUpdateProducts + */ +@JsonPropertyOrder({ + CreateUpdateProducts.JSON_PROPERTY_ID, + CreateUpdateProducts.JSON_PROPERTY_NAME, + CreateUpdateProducts.JSON_PROPERTY_URL, + CreateUpdateProducts.JSON_PROPERTY_IMAGE_URL, + CreateUpdateProducts.JSON_PROPERTY_SKU, + CreateUpdateProducts.JSON_PROPERTY_PRICE, + CreateUpdateProducts.JSON_PROPERTY_CATEGORIES, + CreateUpdateProducts.JSON_PROPERTY_PARENT_ID, + CreateUpdateProducts.JSON_PROPERTY_META_INFO, + CreateUpdateProducts.JSON_PROPERTY_DELETED_AT +}) +@JsonTypeName("createUpdateProducts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateUpdateProducts { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + private String imageUrl; + + public static final String JSON_PROPERTY_SKU = "sku"; + private String sku; + + public static final String JSON_PROPERTY_PRICE = "price"; + private Float price; + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories; + + public static final String JSON_PROPERTY_PARENT_ID = "parentId"; + private String parentId; + + public static final String JSON_PROPERTY_META_INFO = "metaInfo"; + private Map metaInfo = new HashMap<>(); + + public static final String JSON_PROPERTY_DELETED_AT = "deletedAt"; + private String deletedAt; + + public CreateUpdateProducts() { + } + + public CreateUpdateProducts id(String id) { + + this.id = id; + return this; + } + + /** + * Product ID for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public CreateUpdateProducts name(String name) { + + this.name = name; + return this; + } + + /** + * Mandatory in case of creation**. Name of the product for which you requested the details + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateUpdateProducts url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the product + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateUpdateProducts imageUrl(String imageUrl) { + + this.imageUrl = imageUrl; + return this; + } + + /** + * Absolute URL to the cover image of the product + * @return imageUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getImageUrl() { + return imageUrl; + } + + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + + public CreateUpdateProducts sku(String sku) { + + this.sku = sku; + return this; + } + + /** + * Product identifier from the shop + * @return sku + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSku() { + return sku; + } + + + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSku(String sku) { + this.sku = sku; + } + + + public CreateUpdateProducts price(Float price) { + + this.price = price; + return this; + } + + /** + * Price of the product + * @return price + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getPrice() { + return price; + } + + + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrice(Float price) { + this.price = price; + } + + + public CreateUpdateProducts categories(List categories) { + + this.categories = categories; + return this; + } + + public CreateUpdateProducts addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Category ID-s of the product + * @return categories + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public CreateUpdateProducts parentId(String parentId) { + + this.parentId = parentId; + return this; + } + + /** + * Parent product id of the product + * @return parentId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getParentId() { + return parentId; + } + + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentId(String parentId) { + this.parentId = parentId; + } + + + public CreateUpdateProducts metaInfo(Map metaInfo) { + + this.metaInfo = metaInfo; + return this; + } + + public CreateUpdateProducts putMetaInfoItem(String key, GetContactInfoIdentifierParameter metaInfoItem) { + if (this.metaInfo == null) { + this.metaInfo = new HashMap<>(); + } + this.metaInfo.put(key, metaInfoItem); + return this; + } + + /** + * Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. + * @return metaInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetaInfo() { + return metaInfo; + } + + + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetaInfo(Map metaInfo) { + this.metaInfo = metaInfo; + } + + + public CreateUpdateProducts deletedAt(String deletedAt) { + + this.deletedAt = deletedAt; + return this; + } + + /** + * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database + * @return deletedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeletedAt() { + return deletedAt; + } + + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUpdateProducts createUpdateProducts = (CreateUpdateProducts) o; + return Objects.equals(this.id, createUpdateProducts.id) && + Objects.equals(this.name, createUpdateProducts.name) && + Objects.equals(this.url, createUpdateProducts.url) && + Objects.equals(this.imageUrl, createUpdateProducts.imageUrl) && + Objects.equals(this.sku, createUpdateProducts.sku) && + Objects.equals(this.price, createUpdateProducts.price) && + Objects.equals(this.categories, createUpdateProducts.categories) && + Objects.equals(this.parentId, createUpdateProducts.parentId) && + Objects.equals(this.metaInfo, createUpdateProducts.metaInfo) && + Objects.equals(this.deletedAt, createUpdateProducts.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, imageUrl, sku, price, categories, parentId, metaInfo, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUpdateProducts {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" sku: ").append(toIndentedString(sku)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" metaInfo: ").append(toIndentedString(metaInfo)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + try { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getImageUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sku` to the URL query string + if (getSku() != null) { + try { + joiner.add(String.format("%ssku%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSku()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `price` to the URL query string + if (getPrice() != null) { + try { + joiner.add(String.format("%sprice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + try { + joiner.add(String.format("%scategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategories().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `parentId` to the URL query string + if (getParentId() != null) { + try { + joiner.add(String.format("%sparentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getParentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `metaInfo` to the URL query string + if (getMetaInfo() != null) { + for (String _key : getMetaInfo().keySet()) { + if (getMetaInfo().get(_key) != null) { + joiner.add(getMetaInfo().get(_key).toUrlQueryString(String.format("%smetaInfo%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `deletedAt` to the URL query string + if (getDeletedAt() != null) { + try { + joiner.add(String.format("%sdeletedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeletedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWebhook.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWebhook.java new file mode 100644 index 0000000..316cb17 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWebhook.java @@ -0,0 +1,575 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateWebhook + */ +@JsonPropertyOrder({ + CreateWebhook.JSON_PROPERTY_URL, + CreateWebhook.JSON_PROPERTY_DESCRIPTION, + CreateWebhook.JSON_PROPERTY_EVENTS, + CreateWebhook.JSON_PROPERTY_TYPE, + CreateWebhook.JSON_PROPERTY_DOMAIN, + CreateWebhook.JSON_PROPERTY_BATCHED, + CreateWebhook.JSON_PROPERTY_AUTH, + CreateWebhook.JSON_PROPERTY_HEADERS +}) +@JsonTypeName("createWebhook") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateWebhook { + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** + * Gets or Sets events + */ + public enum EventsEnum { + SENT("sent"), + + HARDBOUNCE("hardBounce"), + + SOFTBOUNCE("softBounce"), + + BLOCKED("blocked"), + + SPAM("spam"), + + DELIVERED("delivered"), + + REQUEST("request"), + + CLICK("click"), + + INVALID("invalid"), + + DEFERRED("deferred"), + + OPENED("opened"), + + UNIQUEOPENED("uniqueOpened"), + + UNSUBSCRIBED("unsubscribed"), + + LISTADDITION("listAddition"), + + CONTACTUPDATED("contactUpdated"), + + CONTACTDELETED("contactDeleted"), + + INBOUNDEMAILPROCESSED("inboundEmailProcessed"); + + private String value; + + EventsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventsEnum fromValue(String value) { + for (EventsEnum b : EventsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events = new ArrayList<>(); + + /** + * Type of the webhook + */ + public enum TypeEnum { + TRANSACTIONAL("transactional"), + + MARKETING("marketing"), + + INBOUND("inbound"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.TRANSACTIONAL; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_BATCHED = "batched"; + private Boolean batched; + + public static final String JSON_PROPERTY_AUTH = "auth"; + private Object auth; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers; + + public CreateWebhook() { + } + + public CreateWebhook url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the webhook + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + + public CreateWebhook description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the webhook + * @return description + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + + public CreateWebhook events(List events) { + + this.events = events; + return this; + } + + public CreateWebhook addEventsItem(EventsEnum eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` + * @return events + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvents(List events) { + this.events = events; + } + + + public CreateWebhook type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of the webhook + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public CreateWebhook domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Inbound domain of webhook, required in case of event type `inbound` + * @return domain + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public CreateWebhook batched(Boolean batched) { + + this.batched = batched; + return this; + } + + /** + * Batching configuration of the webhook, we send batched webhooks if its true + * @return batched + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getBatched() { + return batched; + } + + + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatched(Boolean batched) { + this.batched = batched; + } + + + public CreateWebhook auth(Object auth) { + + this.auth = auth; + return this; + } + + /** + * Authentication header to be send with the webhook requests + * @return auth + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAuth() { + return auth; + } + + + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(Object auth) { + this.auth = auth; + } + + + public CreateWebhook headers(List headers) { + + this.headers = headers; + return this; + } + + public CreateWebhook addHeadersItem(Object headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Get headers + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWebhook createWebhook = (CreateWebhook) o; + return Objects.equals(this.url, createWebhook.url) && + Objects.equals(this.description, createWebhook.description) && + Objects.equals(this.events, createWebhook.events) && + Objects.equals(this.type, createWebhook.type) && + Objects.equals(this.domain, createWebhook.domain) && + Objects.equals(this.batched, createWebhook.batched) && + Objects.equals(this.auth, createWebhook.auth) && + Objects.equals(this.headers, createWebhook.headers); + } + + @Override + public int hashCode() { + return Objects.hash(url, description, events, type, domain, batched, auth, headers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWebhook {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" batched: ").append(toIndentedString(batched)).append("\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + try { + joiner.add(String.format("%sevents%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEvents().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batched` to the URL query string + if (getBatched() != null) { + try { + joiner.add(String.format("%sbatched%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatched()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `auth` to the URL query string + if (getAuth() != null) { + try { + joiner.add(String.format("%sauth%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuth()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + try { + joiner.add(String.format("%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getHeaders().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaign.java new file mode 100644 index 0000000..8e53e9b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaign.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateWhatsAppCampaignRecipients; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateWhatsAppCampaign + */ +@JsonPropertyOrder({ + CreateWhatsAppCampaign.JSON_PROPERTY_NAME, + CreateWhatsAppCampaign.JSON_PROPERTY_TEMPLATE_ID, + CreateWhatsAppCampaign.JSON_PROPERTY_SCHEDULED_AT, + CreateWhatsAppCampaign.JSON_PROPERTY_RECIPIENTS +}) +@JsonTypeName("createWhatsAppCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateWhatsAppCampaign { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Integer templateId; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private CreateWhatsAppCampaignRecipients recipients; + + public CreateWhatsAppCampaign() { + } + + public CreateWhatsAppCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the WhatsApp campaign creation + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateWhatsAppCampaign templateId(Integer templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the WhatsApp template in **approved** state + * @return templateId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + + public CreateWhatsAppCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** + * @return scheduledAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public CreateWhatsAppCampaign recipients(CreateWhatsAppCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CreateWhatsAppCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipients(CreateWhatsAppCampaignRecipients recipients) { + this.recipients = recipients; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWhatsAppCampaign createWhatsAppCampaign = (CreateWhatsAppCampaign) o; + return Objects.equals(this.name, createWhatsAppCampaign.name) && + Objects.equals(this.templateId, createWhatsAppCampaign.templateId) && + Objects.equals(this.scheduledAt, createWhatsAppCampaign.scheduledAt) && + Objects.equals(this.recipients, createWhatsAppCampaign.recipients); + } + + @Override + public int hashCode() { + return Objects.hash(name, templateId, scheduledAt, recipients); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWhatsAppCampaign {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaignRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaignRecipients.java new file mode 100644 index 0000000..18c3ff9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppCampaignRecipients.java @@ -0,0 +1,275 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Segment ids and List ids to include/exclude from campaign + */ +@JsonPropertyOrder({ + CreateWhatsAppCampaignRecipients.JSON_PROPERTY_EXCLUDED_LIST_IDS, + CreateWhatsAppCampaignRecipients.JSON_PROPERTY_LIST_IDS, + CreateWhatsAppCampaignRecipients.JSON_PROPERTY_SEGMENTS +}) +@JsonTypeName("createWhatsAppCampaign_recipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateWhatsAppCampaignRecipients { + public static final String JSON_PROPERTY_EXCLUDED_LIST_IDS = "excludedListIds"; + private List excludedListIds; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_SEGMENTS = "segments"; + private List segments; + + public CreateWhatsAppCampaignRecipients() { + } + + public CreateWhatsAppCampaignRecipients excludedListIds(List excludedListIds) { + + this.excludedListIds = excludedListIds; + return this; + } + + public CreateWhatsAppCampaignRecipients addExcludedListIdsItem(Long excludedListIdsItem) { + if (this.excludedListIds == null) { + this.excludedListIds = new ArrayList<>(); + } + this.excludedListIds.add(excludedListIdsItem); + return this; + } + + /** + * List ids to exclude from the campaign + * @return excludedListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDED_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExcludedListIds() { + return excludedListIds; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUDED_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExcludedListIds(List excludedListIds) { + this.excludedListIds = excludedListIds; + } + + + public CreateWhatsAppCampaignRecipients listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public CreateWhatsAppCampaignRecipients addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public CreateWhatsAppCampaignRecipients segments(List segments) { + + this.segments = segments; + return this; + } + + public CreateWhatsAppCampaignRecipients addSegmentsItem(Long segmentsItem) { + if (this.segments == null) { + this.segments = new ArrayList<>(); + } + this.segments.add(segmentsItem); + return this; + } + + /** + * **Mandatory if listIds are not used**. Segment ids to send the campaign to. + * @return segments + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSegments() { + return segments; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegments(List segments) { + this.segments = segments; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWhatsAppCampaignRecipients createWhatsAppCampaignRecipients = (CreateWhatsAppCampaignRecipients) o; + return Objects.equals(this.excludedListIds, createWhatsAppCampaignRecipients.excludedListIds) && + Objects.equals(this.listIds, createWhatsAppCampaignRecipients.listIds) && + Objects.equals(this.segments, createWhatsAppCampaignRecipients.segments); + } + + @Override + public int hashCode() { + return Objects.hash(excludedListIds, listIds, segments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWhatsAppCampaignRecipients {\n"); + sb.append(" excludedListIds: ").append(toIndentedString(excludedListIds)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" segments: ").append(toIndentedString(segments)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `excludedListIds` to the URL query string + if (getExcludedListIds() != null) { + for (int i = 0; i < getExcludedListIds().size(); i++) { + try { + joiner.add(String.format("%sexcludedListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExcludedListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `segments` to the URL query string + if (getSegments() != null) { + for (int i = 0; i < getSegments().size(); i++) { + try { + joiner.add(String.format("%ssegments%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSegments().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppTemplate.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppTemplate.java new file mode 100644 index 0000000..9e37037 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateWhatsAppTemplate.java @@ -0,0 +1,474 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreateWhatsAppTemplate + */ +@JsonPropertyOrder({ + CreateWhatsAppTemplate.JSON_PROPERTY_NAME, + CreateWhatsAppTemplate.JSON_PROPERTY_LANGUAGE, + CreateWhatsAppTemplate.JSON_PROPERTY_CATEGORY, + CreateWhatsAppTemplate.JSON_PROPERTY_MEDIA_URL, + CreateWhatsAppTemplate.JSON_PROPERTY_BODY_TEXT, + CreateWhatsAppTemplate.JSON_PROPERTY_HEADER_TEXT, + CreateWhatsAppTemplate.JSON_PROPERTY_SOURCE +}) +@JsonTypeName("createWhatsAppTemplate") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateWhatsAppTemplate { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private String language; + + /** + * Category of the template + */ + public enum CategoryEnum { + MARKETING("MARKETING"), + + UTILITY("UTILITY"); + + private String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CategoryEnum fromValue(String value) { + for (CategoryEnum b : CategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private CategoryEnum category; + + public static final String JSON_PROPERTY_MEDIA_URL = "mediaUrl"; + private String mediaUrl; + + public static final String JSON_PROPERTY_BODY_TEXT = "bodyText"; + private String bodyText; + + public static final String JSON_PROPERTY_HEADER_TEXT = "headerText"; + private String headerText; + + /** + * source of the template + */ + public enum SourceEnum { + AUTOMATION("Automation"), + + CONVERSATIONS("Conversations"); + + private String value; + + SourceEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SourceEnum fromValue(String value) { + for (SourceEnum b : SourceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_SOURCE = "source"; + private SourceEnum source; + + public CreateWhatsAppTemplate() { + } + + public CreateWhatsAppTemplate name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the template + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CreateWhatsAppTemplate language(String language) { + + this.language = language; + return this; + } + + /** + * Language of the template. For Example : **en** for English + * @return language + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLanguage(String language) { + this.language = language; + } + + + public CreateWhatsAppTemplate category(CategoryEnum category) { + + this.category = category; + return this; + } + + /** + * Category of the template + * @return category + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CategoryEnum getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategory(CategoryEnum category) { + this.category = category; + } + + + public CreateWhatsAppTemplate mediaUrl(String mediaUrl) { + + this.mediaUrl = mediaUrl; + return this; + } + + /** + * Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty**. Allowed extensions for media files are: #### jpeg | png | mp4 | pdf + * @return mediaUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEDIA_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMediaUrl() { + return mediaUrl; + } + + + @JsonProperty(JSON_PROPERTY_MEDIA_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaUrl(String mediaUrl) { + this.mediaUrl = mediaUrl; + } + + + public CreateWhatsAppTemplate bodyText(String bodyText) { + + this.bodyText = bodyText; + return this; + } + + /** + * Body of the template. **Maximum allowed characters are 1024** + * @return bodyText + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BODY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBodyText() { + return bodyText; + } + + + @JsonProperty(JSON_PROPERTY_BODY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBodyText(String bodyText) { + this.bodyText = bodyText; + } + + + public CreateWhatsAppTemplate headerText(String headerText) { + + this.headerText = headerText; + return this; + } + + /** + * Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty** + * @return headerText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeaderText() { + return headerText; + } + + + @JsonProperty(JSON_PROPERTY_HEADER_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderText(String headerText) { + this.headerText = headerText; + } + + + public CreateWhatsAppTemplate source(SourceEnum source) { + + this.source = source; + return this; + } + + /** + * source of the template + * @return source + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SourceEnum getSource() { + return source; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSource(SourceEnum source) { + this.source = source; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWhatsAppTemplate createWhatsAppTemplate = (CreateWhatsAppTemplate) o; + return Objects.equals(this.name, createWhatsAppTemplate.name) && + Objects.equals(this.language, createWhatsAppTemplate.language) && + Objects.equals(this.category, createWhatsAppTemplate.category) && + Objects.equals(this.mediaUrl, createWhatsAppTemplate.mediaUrl) && + Objects.equals(this.bodyText, createWhatsAppTemplate.bodyText) && + Objects.equals(this.headerText, createWhatsAppTemplate.headerText) && + Objects.equals(this.source, createWhatsAppTemplate.source); + } + + @Override + public int hashCode() { + return Objects.hash(name, language, category, mediaUrl, bodyText, headerText, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWhatsAppTemplate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" mediaUrl: ").append(toIndentedString(mediaUrl)).append("\n"); + sb.append(" bodyText: ").append(toIndentedString(bodyText)).append("\n"); + sb.append(" headerText: ").append(toIndentedString(headerText)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `category` to the URL query string + if (getCategory() != null) { + try { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCategory()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mediaUrl` to the URL query string + if (getMediaUrl() != null) { + try { + joiner.add(String.format("%smediaUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMediaUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `bodyText` to the URL query string + if (getBodyText() != null) { + try { + joiner.add(String.format("%sbodyText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBodyText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headerText` to the URL query string + if (getHeaderText() != null) { + try { + joiner.add(String.format("%sheaderText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeaderText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `source` to the URL query string + if (getSource() != null) { + try { + joiner.add(String.format("%ssource%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSource()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedBatchId.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedBatchId.java new file mode 100644 index 0000000..8043d3e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedBatchId.java @@ -0,0 +1,195 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreatedBatchId + */ +@JsonPropertyOrder({ + CreatedBatchId.JSON_PROPERTY_BATCH_ID, + CreatedBatchId.JSON_PROPERTY_COUNT +}) +@JsonTypeName("createdBatchId") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreatedBatchId { + public static final String JSON_PROPERTY_BATCH_ID = "batchId"; + private BigDecimal batchId; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public CreatedBatchId() { + } + + public CreatedBatchId batchId(BigDecimal batchId) { + + this.batchId = batchId; + return this; + } + + /** + * Batch ID of the request + * @return batchId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getBatchId() { + return batchId; + } + + + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBatchId(BigDecimal batchId) { + this.batchId = batchId; + } + + + public CreatedBatchId count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of orders + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatedBatchId createdBatchId = (CreatedBatchId) o; + return Objects.equals(this.batchId, createdBatchId.batchId) && + Objects.equals(this.count, createdBatchId.count); + } + + @Override + public int hashCode() { + return Objects.hash(batchId, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatedBatchId {\n"); + sb.append(" batchId: ").append(toIndentedString(batchId)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `batchId` to the URL query string + if (getBatchId() != null) { + try { + joiner.add(String.format("%sbatchId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatchId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedProcessId.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedProcessId.java new file mode 100644 index 0000000..aa16eed --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreatedProcessId.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CreatedProcessId + */ +@JsonPropertyOrder({ + CreatedProcessId.JSON_PROPERTY_PROCESS_ID +}) +@JsonTypeName("createdProcessId") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreatedProcessId { + public static final String JSON_PROPERTY_PROCESS_ID = "processId"; + private Long processId; + + public CreatedProcessId() { + } + + public CreatedProcessId processId(Long processId) { + + this.processId = processId; + return this; + } + + /** + * Id of the process created + * @return processId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROCESS_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getProcessId() { + return processId; + } + + + @JsonProperty(JSON_PROPERTY_PROCESS_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProcessId(Long processId) { + this.processId = processId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatedProcessId createdProcessId = (CreatedProcessId) o; + return Objects.equals(this.processId, createdProcessId.processId); + } + + @Override + public int hashCode() { + return Objects.hash(processId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatedProcessId {\n"); + sb.append(" processId: ").append(toIndentedString(processId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `processId` to the URL query string + if (getProcessId() != null) { + try { + joiner.add(String.format("%sprocessId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProcessId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsIdPatchRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsIdPatchRequest.java new file mode 100644 index 0000000..79381b1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsIdPatchRequest.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CrmDealsIdPatchRequest + */ +@JsonPropertyOrder({ + CrmDealsIdPatchRequest.JSON_PROPERTY_NAME, + CrmDealsIdPatchRequest.JSON_PROPERTY_ATTRIBUTES +}) +@JsonTypeName("_crm_deals__id__patch_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmDealsIdPatchRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public CrmDealsIdPatchRequest() { + } + + public CrmDealsIdPatchRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of deal + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CrmDealsIdPatchRequest attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Attributes for deal update If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage` Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmDealsIdPatchRequest crmDealsIdPatchRequest = (CrmDealsIdPatchRequest) o; + return Objects.equals(this.name, crmDealsIdPatchRequest.name) && + Objects.equals(this.attributes, crmDealsIdPatchRequest.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(name, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmDealsIdPatchRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsLinkUnlinkIdPatchRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsLinkUnlinkIdPatchRequest.java new file mode 100644 index 0000000..4bc7ac7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsLinkUnlinkIdPatchRequest.java @@ -0,0 +1,329 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CrmDealsLinkUnlinkIdPatchRequest + */ +@JsonPropertyOrder({ + CrmDealsLinkUnlinkIdPatchRequest.JSON_PROPERTY_LINK_CONTACT_IDS, + CrmDealsLinkUnlinkIdPatchRequest.JSON_PROPERTY_UNLINK_CONTACT_IDS, + CrmDealsLinkUnlinkIdPatchRequest.JSON_PROPERTY_LINK_COMPANY_IDS, + CrmDealsLinkUnlinkIdPatchRequest.JSON_PROPERTY_UNLINK_COMPANY_IDS +}) +@JsonTypeName("_crm_deals_link_unlink__id__patch_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmDealsLinkUnlinkIdPatchRequest { + public static final String JSON_PROPERTY_LINK_CONTACT_IDS = "linkContactIds"; + private List linkContactIds; + + public static final String JSON_PROPERTY_UNLINK_CONTACT_IDS = "unlinkContactIds"; + private List unlinkContactIds; + + public static final String JSON_PROPERTY_LINK_COMPANY_IDS = "linkCompanyIds"; + private List linkCompanyIds; + + public static final String JSON_PROPERTY_UNLINK_COMPANY_IDS = "unlinkCompanyIds"; + private List unlinkCompanyIds; + + public CrmDealsLinkUnlinkIdPatchRequest() { + } + + public CrmDealsLinkUnlinkIdPatchRequest linkContactIds(List linkContactIds) { + + this.linkContactIds = linkContactIds; + return this; + } + + public CrmDealsLinkUnlinkIdPatchRequest addLinkContactIdsItem(Long linkContactIdsItem) { + if (this.linkContactIds == null) { + this.linkContactIds = new ArrayList<>(); + } + this.linkContactIds.add(linkContactIdsItem); + return this; + } + + /** + * Contact ids for contacts to be linked with deal + * @return linkContactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkContactIds() { + return linkContactIds; + } + + + @JsonProperty(JSON_PROPERTY_LINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkContactIds(List linkContactIds) { + this.linkContactIds = linkContactIds; + } + + + public CrmDealsLinkUnlinkIdPatchRequest unlinkContactIds(List unlinkContactIds) { + + this.unlinkContactIds = unlinkContactIds; + return this; + } + + public CrmDealsLinkUnlinkIdPatchRequest addUnlinkContactIdsItem(Long unlinkContactIdsItem) { + if (this.unlinkContactIds == null) { + this.unlinkContactIds = new ArrayList<>(); + } + this.unlinkContactIds.add(unlinkContactIdsItem); + return this; + } + + /** + * Contact ids for contacts to be unlinked from deal + * @return unlinkContactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkContactIds() { + return unlinkContactIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkContactIds(List unlinkContactIds) { + this.unlinkContactIds = unlinkContactIds; + } + + + public CrmDealsLinkUnlinkIdPatchRequest linkCompanyIds(List linkCompanyIds) { + + this.linkCompanyIds = linkCompanyIds; + return this; + } + + public CrmDealsLinkUnlinkIdPatchRequest addLinkCompanyIdsItem(String linkCompanyIdsItem) { + if (this.linkCompanyIds == null) { + this.linkCompanyIds = new ArrayList<>(); + } + this.linkCompanyIds.add(linkCompanyIdsItem); + return this; + } + + /** + * Company ids to be linked with deal + * @return linkCompanyIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkCompanyIds() { + return linkCompanyIds; + } + + + @JsonProperty(JSON_PROPERTY_LINK_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkCompanyIds(List linkCompanyIds) { + this.linkCompanyIds = linkCompanyIds; + } + + + public CrmDealsLinkUnlinkIdPatchRequest unlinkCompanyIds(List unlinkCompanyIds) { + + this.unlinkCompanyIds = unlinkCompanyIds; + return this; + } + + public CrmDealsLinkUnlinkIdPatchRequest addUnlinkCompanyIdsItem(String unlinkCompanyIdsItem) { + if (this.unlinkCompanyIds == null) { + this.unlinkCompanyIds = new ArrayList<>(); + } + this.unlinkCompanyIds.add(unlinkCompanyIdsItem); + return this; + } + + /** + * Company ids to be unlinked from deal + * @return unlinkCompanyIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkCompanyIds() { + return unlinkCompanyIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkCompanyIds(List unlinkCompanyIds) { + this.unlinkCompanyIds = unlinkCompanyIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmDealsLinkUnlinkIdPatchRequest crmDealsLinkUnlinkIdPatchRequest = (CrmDealsLinkUnlinkIdPatchRequest) o; + return Objects.equals(this.linkContactIds, crmDealsLinkUnlinkIdPatchRequest.linkContactIds) && + Objects.equals(this.unlinkContactIds, crmDealsLinkUnlinkIdPatchRequest.unlinkContactIds) && + Objects.equals(this.linkCompanyIds, crmDealsLinkUnlinkIdPatchRequest.linkCompanyIds) && + Objects.equals(this.unlinkCompanyIds, crmDealsLinkUnlinkIdPatchRequest.unlinkCompanyIds); + } + + @Override + public int hashCode() { + return Objects.hash(linkContactIds, unlinkContactIds, linkCompanyIds, unlinkCompanyIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmDealsLinkUnlinkIdPatchRequest {\n"); + sb.append(" linkContactIds: ").append(toIndentedString(linkContactIds)).append("\n"); + sb.append(" unlinkContactIds: ").append(toIndentedString(unlinkContactIds)).append("\n"); + sb.append(" linkCompanyIds: ").append(toIndentedString(linkCompanyIds)).append("\n"); + sb.append(" unlinkCompanyIds: ").append(toIndentedString(unlinkCompanyIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `linkContactIds` to the URL query string + if (getLinkContactIds() != null) { + for (int i = 0; i < getLinkContactIds().size(); i++) { + try { + joiner.add(String.format("%slinkContactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkContactIds` to the URL query string + if (getUnlinkContactIds() != null) { + for (int i = 0; i < getUnlinkContactIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkContactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `linkCompanyIds` to the URL query string + if (getLinkCompanyIds() != null) { + for (int i = 0; i < getLinkCompanyIds().size(); i++) { + try { + joiner.add(String.format("%slinkCompanyIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkCompanyIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkCompanyIds` to the URL query string + if (getUnlinkCompanyIds() != null) { + for (int i = 0; i < getUnlinkCompanyIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkCompanyIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkCompanyIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPost201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPost201Response.java new file mode 100644 index 0000000..e2f9be9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPost201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Created deal id + */ +@JsonPropertyOrder({ + CrmDealsPost201Response.JSON_PROPERTY_ID +}) +@JsonTypeName("_crm_deals_post_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmDealsPost201Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CrmDealsPost201Response() { + } + + public CrmDealsPost201Response id(String id) { + + this.id = id; + return this; + } + + /** + * Unique deal id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmDealsPost201Response crmDealsPost201Response = (CrmDealsPost201Response) o; + return Objects.equals(this.id, crmDealsPost201Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmDealsPost201Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPostRequest.java new file mode 100644 index 0000000..ef9d3a6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmDealsPostRequest.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CrmDealsPostRequest + */ +@JsonPropertyOrder({ + CrmDealsPostRequest.JSON_PROPERTY_NAME, + CrmDealsPostRequest.JSON_PROPERTY_ATTRIBUTES +}) +@JsonTypeName("_crm_deals_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmDealsPostRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public CrmDealsPostRequest() { + } + + public CrmDealsPostRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of deal + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CrmDealsPostRequest attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Attributes for deal creation If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmDealsPostRequest crmDealsPostRequest = (CrmDealsPostRequest) o; + return Objects.equals(this.name, crmDealsPostRequest.name) && + Objects.equals(this.attributes, crmDealsPostRequest.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(name, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmDealsPostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksIdPatchRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksIdPatchRequest.java new file mode 100644 index 0000000..dd27b2e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksIdPatchRequest.java @@ -0,0 +1,608 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.TaskReminder; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CrmTasksIdPatchRequest + */ +@JsonPropertyOrder({ + CrmTasksIdPatchRequest.JSON_PROPERTY_NAME, + CrmTasksIdPatchRequest.JSON_PROPERTY_DURATION, + CrmTasksIdPatchRequest.JSON_PROPERTY_TASK_TYPE_ID, + CrmTasksIdPatchRequest.JSON_PROPERTY_DATE, + CrmTasksIdPatchRequest.JSON_PROPERTY_NOTES, + CrmTasksIdPatchRequest.JSON_PROPERTY_DONE, + CrmTasksIdPatchRequest.JSON_PROPERTY_ASSIGN_TO_ID, + CrmTasksIdPatchRequest.JSON_PROPERTY_CONTACTS_IDS, + CrmTasksIdPatchRequest.JSON_PROPERTY_DEALS_IDS, + CrmTasksIdPatchRequest.JSON_PROPERTY_COMPANIES_IDS, + CrmTasksIdPatchRequest.JSON_PROPERTY_REMINDER +}) +@JsonTypeName("_crm_tasks__id__patch_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmTasksIdPatchRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + + public static final String JSON_PROPERTY_TASK_TYPE_ID = "taskTypeId"; + private String taskTypeId; + + public static final String JSON_PROPERTY_DATE = "date"; + private OffsetDateTime date; + + public static final String JSON_PROPERTY_NOTES = "notes"; + private String notes; + + public static final String JSON_PROPERTY_DONE = "done"; + private Boolean done; + + public static final String JSON_PROPERTY_ASSIGN_TO_ID = "assignToId"; + private String assignToId; + + public static final String JSON_PROPERTY_CONTACTS_IDS = "contactsIds"; + private List contactsIds; + + public static final String JSON_PROPERTY_DEALS_IDS = "dealsIds"; + private List dealsIds; + + public static final String JSON_PROPERTY_COMPANIES_IDS = "companiesIds"; + private List companiesIds; + + public static final String JSON_PROPERTY_REMINDER = "reminder"; + private TaskReminder reminder; + + public CrmTasksIdPatchRequest() { + } + + public CrmTasksIdPatchRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of task + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public CrmTasksIdPatchRequest duration(Long duration) { + + this.duration = duration; + return this; + } + + /** + * Duration of task in milliseconds [1 minute = 60000 ms] + * @return duration + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDuration() { + return duration; + } + + + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(Long duration) { + this.duration = duration; + } + + + public CrmTasksIdPatchRequest taskTypeId(String taskTypeId) { + + this.taskTypeId = taskTypeId; + return this; + } + + /** + * Id for type of task e.g Call / Email / Meeting etc. + * @return taskTypeId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTaskTypeId() { + return taskTypeId; + } + + + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTaskTypeId(String taskTypeId) { + this.taskTypeId = taskTypeId; + } + + + public CrmTasksIdPatchRequest date(OffsetDateTime date) { + + this.date = date; + return this; + } + + /** + * Task date/time + * @return date + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(OffsetDateTime date) { + this.date = date; + } + + + public CrmTasksIdPatchRequest notes(String notes) { + + this.notes = notes; + return this; + } + + /** + * Notes added to a task + * @return notes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotes() { + return notes; + } + + + @JsonProperty(JSON_PROPERTY_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotes(String notes) { + this.notes = notes; + } + + + public CrmTasksIdPatchRequest done(Boolean done) { + + this.done = done; + return this; + } + + /** + * Task marked as done + * @return done + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDone() { + return done; + } + + + @JsonProperty(JSON_PROPERTY_DONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDone(Boolean done) { + this.done = done; + } + + + public CrmTasksIdPatchRequest assignToId(String assignToId) { + + this.assignToId = assignToId; + return this; + } + + /** + * User id to whom task is assigned + * @return assignToId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGN_TO_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAssignToId() { + return assignToId; + } + + + @JsonProperty(JSON_PROPERTY_ASSIGN_TO_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAssignToId(String assignToId) { + this.assignToId = assignToId; + } + + + public CrmTasksIdPatchRequest contactsIds(List contactsIds) { + + this.contactsIds = contactsIds; + return this; + } + + public CrmTasksIdPatchRequest addContactsIdsItem(Integer contactsIdsItem) { + if (this.contactsIds == null) { + this.contactsIds = new ArrayList<>(); + } + this.contactsIds.add(contactsIdsItem); + return this; + } + + /** + * Contact ids for contacts linked to this task + * @return contactsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContactsIds() { + return contactsIds; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactsIds(List contactsIds) { + this.contactsIds = contactsIds; + } + + + public CrmTasksIdPatchRequest dealsIds(List dealsIds) { + + this.dealsIds = dealsIds; + return this; + } + + public CrmTasksIdPatchRequest addDealsIdsItem(String dealsIdsItem) { + if (this.dealsIds == null) { + this.dealsIds = new ArrayList<>(); + } + this.dealsIds.add(dealsIdsItem); + return this; + } + + /** + * Deal ids for deals a task is linked to + * @return dealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDealsIds() { + return dealsIds; + } + + + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealsIds(List dealsIds) { + this.dealsIds = dealsIds; + } + + + public CrmTasksIdPatchRequest companiesIds(List companiesIds) { + + this.companiesIds = companiesIds; + return this; + } + + public CrmTasksIdPatchRequest addCompaniesIdsItem(String companiesIdsItem) { + if (this.companiesIds == null) { + this.companiesIds = new ArrayList<>(); + } + this.companiesIds.add(companiesIdsItem); + return this; + } + + /** + * Companies ids for companies a task is linked to + * @return companiesIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCompaniesIds() { + return companiesIds; + } + + + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompaniesIds(List companiesIds) { + this.companiesIds = companiesIds; + } + + + public CrmTasksIdPatchRequest reminder(TaskReminder reminder) { + + this.reminder = reminder; + return this; + } + + /** + * Get reminder + * @return reminder + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMINDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TaskReminder getReminder() { + return reminder; + } + + + @JsonProperty(JSON_PROPERTY_REMINDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReminder(TaskReminder reminder) { + this.reminder = reminder; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmTasksIdPatchRequest crmTasksIdPatchRequest = (CrmTasksIdPatchRequest) o; + return Objects.equals(this.name, crmTasksIdPatchRequest.name) && + Objects.equals(this.duration, crmTasksIdPatchRequest.duration) && + Objects.equals(this.taskTypeId, crmTasksIdPatchRequest.taskTypeId) && + Objects.equals(this.date, crmTasksIdPatchRequest.date) && + Objects.equals(this.notes, crmTasksIdPatchRequest.notes) && + Objects.equals(this.done, crmTasksIdPatchRequest.done) && + Objects.equals(this.assignToId, crmTasksIdPatchRequest.assignToId) && + Objects.equals(this.contactsIds, crmTasksIdPatchRequest.contactsIds) && + Objects.equals(this.dealsIds, crmTasksIdPatchRequest.dealsIds) && + Objects.equals(this.companiesIds, crmTasksIdPatchRequest.companiesIds) && + Objects.equals(this.reminder, crmTasksIdPatchRequest.reminder); + } + + @Override + public int hashCode() { + return Objects.hash(name, duration, taskTypeId, date, notes, done, assignToId, contactsIds, dealsIds, companiesIds, reminder); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmTasksIdPatchRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" taskTypeId: ").append(toIndentedString(taskTypeId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" done: ").append(toIndentedString(done)).append("\n"); + sb.append(" assignToId: ").append(toIndentedString(assignToId)).append("\n"); + sb.append(" contactsIds: ").append(toIndentedString(contactsIds)).append("\n"); + sb.append(" dealsIds: ").append(toIndentedString(dealsIds)).append("\n"); + sb.append(" companiesIds: ").append(toIndentedString(companiesIds)).append("\n"); + sb.append(" reminder: ").append(toIndentedString(reminder)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `duration` to the URL query string + if (getDuration() != null) { + try { + joiner.add(String.format("%sduration%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDuration()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `taskTypeId` to the URL query string + if (getTaskTypeId() != null) { + try { + joiner.add(String.format("%staskTypeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTaskTypeId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `notes` to the URL query string + if (getNotes() != null) { + try { + joiner.add(String.format("%snotes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `done` to the URL query string + if (getDone() != null) { + try { + joiner.add(String.format("%sdone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDone()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `assignToId` to the URL query string + if (getAssignToId() != null) { + try { + joiner.add(String.format("%sassignToId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAssignToId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactsIds` to the URL query string + if (getContactsIds() != null) { + for (int i = 0; i < getContactsIds().size(); i++) { + try { + joiner.add(String.format("%scontactsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `dealsIds` to the URL query string + if (getDealsIds() != null) { + for (int i = 0; i < getDealsIds().size(); i++) { + try { + joiner.add(String.format("%sdealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `companiesIds` to the URL query string + if (getCompaniesIds() != null) { + for (int i = 0; i < getCompaniesIds().size(); i++) { + try { + joiner.add(String.format("%scompaniesIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCompaniesIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `reminder` to the URL query string + if (getReminder() != null) { + joiner.add(getReminder().toUrlQueryString(prefix + "reminder" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPost201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPost201Response.java new file mode 100644 index 0000000..fb68dc5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPost201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Task Details + */ +@JsonPropertyOrder({ + CrmTasksPost201Response.JSON_PROPERTY_ID +}) +@JsonTypeName("_crm_tasks_post_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmTasksPost201Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CrmTasksPost201Response() { + } + + public CrmTasksPost201Response id(String id) { + + this.id = id; + return this; + } + + /** + * Unique task id + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmTasksPost201Response crmTasksPost201Response = (CrmTasksPost201Response) o; + return Objects.equals(this.id, crmTasksPost201Response.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmTasksPost201Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPostRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPostRequest.java new file mode 100644 index 0000000..b4e1080 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/CrmTasksPostRequest.java @@ -0,0 +1,609 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.TaskReminder; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * CrmTasksPostRequest + */ +@JsonPropertyOrder({ + CrmTasksPostRequest.JSON_PROPERTY_NAME, + CrmTasksPostRequest.JSON_PROPERTY_DURATION, + CrmTasksPostRequest.JSON_PROPERTY_TASK_TYPE_ID, + CrmTasksPostRequest.JSON_PROPERTY_DATE, + CrmTasksPostRequest.JSON_PROPERTY_NOTES, + CrmTasksPostRequest.JSON_PROPERTY_DONE, + CrmTasksPostRequest.JSON_PROPERTY_ASSIGN_TO_ID, + CrmTasksPostRequest.JSON_PROPERTY_CONTACTS_IDS, + CrmTasksPostRequest.JSON_PROPERTY_DEALS_IDS, + CrmTasksPostRequest.JSON_PROPERTY_COMPANIES_IDS, + CrmTasksPostRequest.JSON_PROPERTY_REMINDER +}) +@JsonTypeName("_crm_tasks_post_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CrmTasksPostRequest { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + + public static final String JSON_PROPERTY_TASK_TYPE_ID = "taskTypeId"; + private String taskTypeId; + + public static final String JSON_PROPERTY_DATE = "date"; + private OffsetDateTime date; + + public static final String JSON_PROPERTY_NOTES = "notes"; + private String notes; + + public static final String JSON_PROPERTY_DONE = "done"; + private Boolean done; + + public static final String JSON_PROPERTY_ASSIGN_TO_ID = "assignToId"; + private String assignToId; + + public static final String JSON_PROPERTY_CONTACTS_IDS = "contactsIds"; + private List contactsIds; + + public static final String JSON_PROPERTY_DEALS_IDS = "dealsIds"; + private List dealsIds; + + public static final String JSON_PROPERTY_COMPANIES_IDS = "companiesIds"; + private List companiesIds; + + public static final String JSON_PROPERTY_REMINDER = "reminder"; + private TaskReminder reminder; + + public CrmTasksPostRequest() { + } + + public CrmTasksPostRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of task + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public CrmTasksPostRequest duration(Long duration) { + + this.duration = duration; + return this; + } + + /** + * Duration of task in milliseconds [1 minute = 60000 ms] + * minimum: 0 + * @return duration + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDuration() { + return duration; + } + + + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(Long duration) { + this.duration = duration; + } + + + public CrmTasksPostRequest taskTypeId(String taskTypeId) { + + this.taskTypeId = taskTypeId; + return this; + } + + /** + * Id for type of task e.g Call / Email / Meeting etc. + * @return taskTypeId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTaskTypeId() { + return taskTypeId; + } + + + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTaskTypeId(String taskTypeId) { + this.taskTypeId = taskTypeId; + } + + + public CrmTasksPostRequest date(OffsetDateTime date) { + + this.date = date; + return this; + } + + /** + * Task due date and time + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(OffsetDateTime date) { + this.date = date; + } + + + public CrmTasksPostRequest notes(String notes) { + + this.notes = notes; + return this; + } + + /** + * Notes added to a task + * @return notes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotes() { + return notes; + } + + + @JsonProperty(JSON_PROPERTY_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotes(String notes) { + this.notes = notes; + } + + + public CrmTasksPostRequest done(Boolean done) { + + this.done = done; + return this; + } + + /** + * Task marked as done + * @return done + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDone() { + return done; + } + + + @JsonProperty(JSON_PROPERTY_DONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDone(Boolean done) { + this.done = done; + } + + + public CrmTasksPostRequest assignToId(String assignToId) { + + this.assignToId = assignToId; + return this; + } + + /** + * User id to whom task is assigned + * @return assignToId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGN_TO_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAssignToId() { + return assignToId; + } + + + @JsonProperty(JSON_PROPERTY_ASSIGN_TO_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAssignToId(String assignToId) { + this.assignToId = assignToId; + } + + + public CrmTasksPostRequest contactsIds(List contactsIds) { + + this.contactsIds = contactsIds; + return this; + } + + public CrmTasksPostRequest addContactsIdsItem(Integer contactsIdsItem) { + if (this.contactsIds == null) { + this.contactsIds = new ArrayList<>(); + } + this.contactsIds.add(contactsIdsItem); + return this; + } + + /** + * Contact ids for contacts linked to this task + * @return contactsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContactsIds() { + return contactsIds; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactsIds(List contactsIds) { + this.contactsIds = contactsIds; + } + + + public CrmTasksPostRequest dealsIds(List dealsIds) { + + this.dealsIds = dealsIds; + return this; + } + + public CrmTasksPostRequest addDealsIdsItem(String dealsIdsItem) { + if (this.dealsIds == null) { + this.dealsIds = new ArrayList<>(); + } + this.dealsIds.add(dealsIdsItem); + return this; + } + + /** + * Deal ids for deals a task is linked to + * @return dealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDealsIds() { + return dealsIds; + } + + + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealsIds(List dealsIds) { + this.dealsIds = dealsIds; + } + + + public CrmTasksPostRequest companiesIds(List companiesIds) { + + this.companiesIds = companiesIds; + return this; + } + + public CrmTasksPostRequest addCompaniesIdsItem(String companiesIdsItem) { + if (this.companiesIds == null) { + this.companiesIds = new ArrayList<>(); + } + this.companiesIds.add(companiesIdsItem); + return this; + } + + /** + * Companies ids for companies a task is linked to + * @return companiesIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCompaniesIds() { + return companiesIds; + } + + + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompaniesIds(List companiesIds) { + this.companiesIds = companiesIds; + } + + + public CrmTasksPostRequest reminder(TaskReminder reminder) { + + this.reminder = reminder; + return this; + } + + /** + * Get reminder + * @return reminder + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMINDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TaskReminder getReminder() { + return reminder; + } + + + @JsonProperty(JSON_PROPERTY_REMINDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReminder(TaskReminder reminder) { + this.reminder = reminder; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrmTasksPostRequest crmTasksPostRequest = (CrmTasksPostRequest) o; + return Objects.equals(this.name, crmTasksPostRequest.name) && + Objects.equals(this.duration, crmTasksPostRequest.duration) && + Objects.equals(this.taskTypeId, crmTasksPostRequest.taskTypeId) && + Objects.equals(this.date, crmTasksPostRequest.date) && + Objects.equals(this.notes, crmTasksPostRequest.notes) && + Objects.equals(this.done, crmTasksPostRequest.done) && + Objects.equals(this.assignToId, crmTasksPostRequest.assignToId) && + Objects.equals(this.contactsIds, crmTasksPostRequest.contactsIds) && + Objects.equals(this.dealsIds, crmTasksPostRequest.dealsIds) && + Objects.equals(this.companiesIds, crmTasksPostRequest.companiesIds) && + Objects.equals(this.reminder, crmTasksPostRequest.reminder); + } + + @Override + public int hashCode() { + return Objects.hash(name, duration, taskTypeId, date, notes, done, assignToId, contactsIds, dealsIds, companiesIds, reminder); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrmTasksPostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" taskTypeId: ").append(toIndentedString(taskTypeId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" done: ").append(toIndentedString(done)).append("\n"); + sb.append(" assignToId: ").append(toIndentedString(assignToId)).append("\n"); + sb.append(" contactsIds: ").append(toIndentedString(contactsIds)).append("\n"); + sb.append(" dealsIds: ").append(toIndentedString(dealsIds)).append("\n"); + sb.append(" companiesIds: ").append(toIndentedString(companiesIds)).append("\n"); + sb.append(" reminder: ").append(toIndentedString(reminder)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `duration` to the URL query string + if (getDuration() != null) { + try { + joiner.add(String.format("%sduration%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDuration()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `taskTypeId` to the URL query string + if (getTaskTypeId() != null) { + try { + joiner.add(String.format("%staskTypeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTaskTypeId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `notes` to the URL query string + if (getNotes() != null) { + try { + joiner.add(String.format("%snotes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `done` to the URL query string + if (getDone() != null) { + try { + joiner.add(String.format("%sdone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDone()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `assignToId` to the URL query string + if (getAssignToId() != null) { + try { + joiner.add(String.format("%sassignToId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAssignToId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactsIds` to the URL query string + if (getContactsIds() != null) { + for (int i = 0; i < getContactsIds().size(); i++) { + try { + joiner.add(String.format("%scontactsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `dealsIds` to the URL query string + if (getDealsIds() != null) { + for (int i = 0; i < getDealsIds().size(); i++) { + try { + joiner.add(String.format("%sdealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `companiesIds` to the URL query string + if (getCompaniesIds() != null) { + for (int i = 0; i < getCompaniesIds().size(); i++) { + try { + joiner.add(String.format("%scompaniesIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCompaniesIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `reminder` to the URL query string + if (getReminder() != null) { + joiner.add(getReminder().toUrlQueryString(prefix + "reminder" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Deal.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Deal.java new file mode 100644 index 0000000..3e33ab3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Deal.java @@ -0,0 +1,304 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Deal Details + */ +@JsonPropertyOrder({ + Deal.JSON_PROPERTY_ID, + Deal.JSON_PROPERTY_ATTRIBUTES, + Deal.JSON_PROPERTY_LINKED_CONTACTS_IDS, + Deal.JSON_PROPERTY_LINKED_COMPANIES_IDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Deal { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_LINKED_CONTACTS_IDS = "linkedContactsIds"; + private List linkedContactsIds; + + public static final String JSON_PROPERTY_LINKED_COMPANIES_IDS = "linkedCompaniesIds"; + private List linkedCompaniesIds; + + public Deal() { + } + + public Deal id(String id) { + + this.id = id; + return this; + } + + /** + * Unique deal id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public Deal attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Deal attributes with values + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + + public Deal linkedContactsIds(List linkedContactsIds) { + + this.linkedContactsIds = linkedContactsIds; + return this; + } + + public Deal addLinkedContactsIdsItem(Integer linkedContactsIdsItem) { + if (this.linkedContactsIds == null) { + this.linkedContactsIds = new ArrayList<>(); + } + this.linkedContactsIds.add(linkedContactsIdsItem); + return this; + } + + /** + * Contact ids for contacts linked to this deal + * @return linkedContactsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKED_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkedContactsIds() { + return linkedContactsIds; + } + + + @JsonProperty(JSON_PROPERTY_LINKED_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkedContactsIds(List linkedContactsIds) { + this.linkedContactsIds = linkedContactsIds; + } + + + public Deal linkedCompaniesIds(List linkedCompaniesIds) { + + this.linkedCompaniesIds = linkedCompaniesIds; + return this; + } + + public Deal addLinkedCompaniesIdsItem(String linkedCompaniesIdsItem) { + if (this.linkedCompaniesIds == null) { + this.linkedCompaniesIds = new ArrayList<>(); + } + this.linkedCompaniesIds.add(linkedCompaniesIdsItem); + return this; + } + + /** + * Companies ids for companies linked to this deal + * @return linkedCompaniesIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKED_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLinkedCompaniesIds() { + return linkedCompaniesIds; + } + + + @JsonProperty(JSON_PROPERTY_LINKED_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkedCompaniesIds(List linkedCompaniesIds) { + this.linkedCompaniesIds = linkedCompaniesIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Deal deal = (Deal) o; + return Objects.equals(this.id, deal.id) && + Objects.equals(this.attributes, deal.attributes) && + Objects.equals(this.linkedContactsIds, deal.linkedContactsIds) && + Objects.equals(this.linkedCompaniesIds, deal.linkedCompaniesIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, attributes, linkedContactsIds, linkedCompaniesIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Deal {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" linkedContactsIds: ").append(toIndentedString(linkedContactsIds)).append("\n"); + sb.append(" linkedCompaniesIds: ").append(toIndentedString(linkedCompaniesIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `linkedContactsIds` to the URL query string + if (getLinkedContactsIds() != null) { + for (int i = 0; i < getLinkedContactsIds().size(); i++) { + try { + joiner.add(String.format("%slinkedContactsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkedContactsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `linkedCompaniesIds` to the URL query string + if (getLinkedCompaniesIds() != null) { + for (int i = 0; i < getLinkedCompaniesIds().size(); i++) { + try { + joiner.add(String.format("%slinkedCompaniesIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLinkedCompaniesIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealAttributesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealAttributesInner.java new file mode 100644 index 0000000..f7012e6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealAttributesInner.java @@ -0,0 +1,335 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of attributes + */ +@JsonPropertyOrder({ + DealAttributesInner.JSON_PROPERTY_INTERNAL_NAME, + DealAttributesInner.JSON_PROPERTY_LABEL, + DealAttributesInner.JSON_PROPERTY_ATTRIBUTE_TYPE_NAME, + DealAttributesInner.JSON_PROPERTY_ATTRIBUTE_OPTIONS, + DealAttributesInner.JSON_PROPERTY_IS_REQUIRED +}) +@JsonTypeName("DealAttributes_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DealAttributesInner { + public static final String JSON_PROPERTY_INTERNAL_NAME = "internalName"; + private String internalName; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_ATTRIBUTE_TYPE_NAME = "attributeTypeName"; + private String attributeTypeName; + + public static final String JSON_PROPERTY_ATTRIBUTE_OPTIONS = "attributeOptions"; + private List attributeOptions; + + public static final String JSON_PROPERTY_IS_REQUIRED = "isRequired"; + private Boolean isRequired; + + public DealAttributesInner() { + } + + public DealAttributesInner internalName(String internalName) { + + this.internalName = internalName; + return this; + } + + /** + * Get internalName + * @return internalName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERNAL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInternalName() { + return internalName; + } + + + @JsonProperty(JSON_PROPERTY_INTERNAL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInternalName(String internalName) { + this.internalName = internalName; + } + + + public DealAttributesInner label(String label) { + + this.label = label; + return this; + } + + /** + * Get label + * @return label + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLabel() { + return label; + } + + + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLabel(String label) { + this.label = label; + } + + + public DealAttributesInner attributeTypeName(String attributeTypeName) { + + this.attributeTypeName = attributeTypeName; + return this; + } + + /** + * Get attributeTypeName + * @return attributeTypeName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_TYPE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttributeTypeName() { + return attributeTypeName; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_TYPE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeTypeName(String attributeTypeName) { + this.attributeTypeName = attributeTypeName; + } + + + public DealAttributesInner attributeOptions(List attributeOptions) { + + this.attributeOptions = attributeOptions; + return this; + } + + public DealAttributesInner addAttributeOptionsItem(Object attributeOptionsItem) { + if (this.attributeOptions == null) { + this.attributeOptions = new ArrayList<>(); + } + this.attributeOptions.add(attributeOptionsItem); + return this; + } + + /** + * Get attributeOptions + * @return attributeOptions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttributeOptions() { + return attributeOptions; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeOptions(List attributeOptions) { + this.attributeOptions = attributeOptions; + } + + + public DealAttributesInner isRequired(Boolean isRequired) { + + this.isRequired = isRequired; + return this; + } + + /** + * Get isRequired + * @return isRequired + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsRequired() { + return isRequired; + } + + + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsRequired(Boolean isRequired) { + this.isRequired = isRequired; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DealAttributesInner dealAttributesInner = (DealAttributesInner) o; + return Objects.equals(this.internalName, dealAttributesInner.internalName) && + Objects.equals(this.label, dealAttributesInner.label) && + Objects.equals(this.attributeTypeName, dealAttributesInner.attributeTypeName) && + Objects.equals(this.attributeOptions, dealAttributesInner.attributeOptions) && + Objects.equals(this.isRequired, dealAttributesInner.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash(internalName, label, attributeTypeName, attributeOptions, isRequired); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DealAttributesInner {\n"); + sb.append(" internalName: ").append(toIndentedString(internalName)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" attributeTypeName: ").append(toIndentedString(attributeTypeName)).append("\n"); + sb.append(" attributeOptions: ").append(toIndentedString(attributeOptions)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `internalName` to the URL query string + if (getInternalName() != null) { + try { + joiner.add(String.format("%sinternalName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInternalName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `label` to the URL query string + if (getLabel() != null) { + try { + joiner.add(String.format("%slabel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLabel()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributeTypeName` to the URL query string + if (getAttributeTypeName() != null) { + try { + joiner.add(String.format("%sattributeTypeName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributeTypeName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributeOptions` to the URL query string + if (getAttributeOptions() != null) { + for (int i = 0; i < getAttributeOptions().size(); i++) { + try { + joiner.add(String.format("%sattributeOptions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getAttributeOptions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `isRequired` to the URL query string + if (getIsRequired() != null) { + try { + joiner.add(String.format("%sisRequired%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsRequired()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealsList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealsList.java new file mode 100644 index 0000000..003de87 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DealsList.java @@ -0,0 +1,163 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.Deal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of Deals + */ +@JsonPropertyOrder({ + DealsList.JSON_PROPERTY_ITEMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DealsList { + public static final String JSON_PROPERTY_ITEMS = "items"; + private List items; + + public DealsList() { + } + + public DealsList items(List items) { + + this.items = items; + return this; + } + + public DealsList addItemsItem(Deal itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * List of deals + * @return items + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getItems() { + return items; + } + + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DealsList dealsList = (DealsList) o; + return Objects.equals(this.items, dealsList.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DealsList {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sitems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/DeleteHardbounces.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DeleteHardbounces.java new file mode 100644 index 0000000..70bd0c2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/DeleteHardbounces.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * DeleteHardbounces + */ +@JsonPropertyOrder({ + DeleteHardbounces.JSON_PROPERTY_START_DATE, + DeleteHardbounces.JSON_PROPERTY_END_DATE, + DeleteHardbounces.JSON_PROPERTY_CONTACT_EMAIL +}) +@JsonTypeName("deleteHardbounces") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteHardbounces { + public static final String JSON_PROPERTY_START_DATE = "startDate"; + private String startDate; + + public static final String JSON_PROPERTY_END_DATE = "endDate"; + private String endDate; + + public static final String JSON_PROPERTY_CONTACT_EMAIL = "contactEmail"; + private String contactEmail; + + public DeleteHardbounces() { + } + + public DeleteHardbounces startDate(String startDate) { + + this.startDate = startDate; + return this; + } + + /** + * Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate + * @return startDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + + public DeleteHardbounces endDate(String endDate) { + + this.endDate = endDate; + return this; + } + + /** + * Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate + * @return endDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + + public DeleteHardbounces contactEmail(String contactEmail) { + + this.contactEmail = contactEmail; + return this; + } + + /** + * Target a specific email address + * @return contactEmail + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContactEmail() { + return contactEmail; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactEmail(String contactEmail) { + this.contactEmail = contactEmail; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteHardbounces deleteHardbounces = (DeleteHardbounces) o; + return Objects.equals(this.startDate, deleteHardbounces.startDate) && + Objects.equals(this.endDate, deleteHardbounces.endDate) && + Objects.equals(this.contactEmail, deleteHardbounces.contactEmail); + } + + @Override + public int hashCode() { + return Objects.hash(startDate, endDate, contactEmail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteHardbounces {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" contactEmail: ").append(toIndentedString(contactEmail)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `startDate` to the URL query string + if (getStartDate() != null) { + try { + joiner.add(String.format("%sstartDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endDate` to the URL query string + if (getEndDate() != null) { + try { + joiner.add(String.format("%sendDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactEmail` to the URL query string + if (getContactEmail() != null) { + try { + joiner.add(String.format("%scontactEmail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContactEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/EmailExportRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/EmailExportRecipients.java new file mode 100644 index 0000000..5a11b9d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/EmailExportRecipients.java @@ -0,0 +1,241 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * EmailExportRecipients + */ +@JsonPropertyOrder({ + EmailExportRecipients.JSON_PROPERTY_NOTIFY_U_R_L, + EmailExportRecipients.JSON_PROPERTY_RECIPIENTS_TYPE +}) +@JsonTypeName("emailExportRecipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailExportRecipients { + public static final String JSON_PROPERTY_NOTIFY_U_R_L = "notifyURL"; + private String notifyURL; + + /** + * Type of recipients to export for a campaign + */ + public enum RecipientsTypeEnum { + ALL("all"), + + NONCLICKERS("nonClickers"), + + NONOPENERS("nonOpeners"), + + CLICKERS("clickers"), + + OPENERS("openers"), + + SOFTBOUNCES("softBounces"), + + HARDBOUNCES("hardBounces"), + + UNSUBSCRIBED("unsubscribed"); + + private String value; + + RecipientsTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecipientsTypeEnum fromValue(String value) { + for (RecipientsTypeEnum b : RecipientsTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_RECIPIENTS_TYPE = "recipientsType"; + private RecipientsTypeEnum recipientsType; + + public EmailExportRecipients() { + } + + public EmailExportRecipients notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + * @return notifyURL + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotifyURL() { + return notifyURL; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public EmailExportRecipients recipientsType(RecipientsTypeEnum recipientsType) { + + this.recipientsType = recipientsType; + return this; + } + + /** + * Type of recipients to export for a campaign + * @return recipientsType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RecipientsTypeEnum getRecipientsType() { + return recipientsType; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipientsType(RecipientsTypeEnum recipientsType) { + this.recipientsType = recipientsType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailExportRecipients emailExportRecipients = (EmailExportRecipients) o; + return Objects.equals(this.notifyURL, emailExportRecipients.notifyURL) && + Objects.equals(this.recipientsType, emailExportRecipients.recipientsType); + } + + @Override + public int hashCode() { + return Objects.hash(notifyURL, recipientsType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailExportRecipients {\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" recipientsType: ").append(toIndentedString(recipientsType)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `notifyURL` to the URL query string + if (getNotifyURL() != null) { + try { + joiner.add(String.format("%snotifyURL%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyURL()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipientsType` to the URL query string + if (getRecipientsType() != null) { + try { + joiner.add(String.format("%srecipientsType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecipientsType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ErrorModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ErrorModel.java new file mode 100644 index 0000000..4effddd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ErrorModel.java @@ -0,0 +1,257 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ErrorModel + */ +@JsonPropertyOrder({ + ErrorModel.JSON_PROPERTY_CODE, + ErrorModel.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("errorModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorModel { + /** + * Error code displayed in case of a failure + */ + public enum CodeEnum { + INVALID_PARAMETER("invalid_parameter"), + + MISSING_PARAMETER("missing_parameter"), + + OUT_OF_RANGE("out_of_range"), + + CAMPAIGN_PROCESSING("campaign_processing"), + + CAMPAIGN_SENT("campaign_sent"), + + DOCUMENT_NOT_FOUND("document_not_found"), + + RESELLER_PERMISSION_DENIED("reseller_permission_denied"), + + NOT_ENOUGH_CREDITS("not_enough_credits"), + + PERMISSION_DENIED("permission_denied"), + + DUPLICATE_PARAMETER("duplicate_parameter"), + + DUPLICATE_REQUEST("duplicate_request"), + + METHOD_NOT_ALLOWED("method_not_allowed"), + + UNAUTHORIZED("unauthorized"), + + ACCOUNT_UNDER_VALIDATION("account_under_validation"), + + NOT_ACCEPTABLE("not_acceptable"), + + BAD_REQUEST("bad_request"); + + private String value; + + CodeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CodeEnum fromValue(String value) { + for (CodeEnum b : CodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CODE = "code"; + private CodeEnum code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public ErrorModel() { + } + + public ErrorModel code(CodeEnum code) { + + this.code = code; + return this; + } + + /** + * Error code displayed in case of a failure + * @return code + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CodeEnum getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(CodeEnum code) { + this.code = code; + } + + + public ErrorModel message(String message) { + + this.message = message; + return this; + } + + /** + * Readable message associated to the failure + * @return message + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorModel errorModel = (ErrorModel) o; + return Objects.equals(this.code, errorModel.code) && + Objects.equals(this.message, errorModel.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorModel {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + try { + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistory.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistory.java new file mode 100644 index 0000000..8cd2b99 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistory.java @@ -0,0 +1,630 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ExportWebhooksHistory + */ +@JsonPropertyOrder({ + ExportWebhooksHistory.JSON_PROPERTY_DAYS, + ExportWebhooksHistory.JSON_PROPERTY_START_DATE, + ExportWebhooksHistory.JSON_PROPERTY_END_DATE, + ExportWebhooksHistory.JSON_PROPERTY_SORT, + ExportWebhooksHistory.JSON_PROPERTY_TYPE, + ExportWebhooksHistory.JSON_PROPERTY_EVENT, + ExportWebhooksHistory.JSON_PROPERTY_NOTIFY_U_R_L, + ExportWebhooksHistory.JSON_PROPERTY_WEBHOOK_ID, + ExportWebhooksHistory.JSON_PROPERTY_EMAIL, + ExportWebhooksHistory.JSON_PROPERTY_MESSAGE_ID +}) +@JsonTypeName("exportWebhooksHistory") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ExportWebhooksHistory { + public static final String JSON_PROPERTY_DAYS = "days"; + private Integer days; + + public static final String JSON_PROPERTY_START_DATE = "startDate"; + private String startDate; + + public static final String JSON_PROPERTY_END_DATE = "endDate"; + private String endDate; + + public static final String JSON_PROPERTY_SORT = "sort"; + private String sort; + + /** + * Filter the history based on webhook type + */ + public enum TypeEnum { + TRANSACTIONAL("transactional"), + + MARKETING("marketing"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Filter the history for a specific event type + */ + public enum EventEnum { + INVALID_PARAMETER("invalid_parameter"), + + MISSING_PARAMETER("missing_parameter"), + + HARDBOUNCE("hardBounce"), + + SOFTBOUNCE("softBounce"), + + DELIVERED("delivered"), + + SPAM("spam"), + + REQUEST("request"), + + OPENED("opened"), + + CLICK("click"), + + INVALID("invalid"), + + DEFERRED("deferred"), + + BLOCKED("blocked"), + + UNSUBSCRIBED("unsubscribed"), + + ERROR("error"), + + UNIQUEOPENED("uniqueOpened"), + + LOADEDBYPROXY("loadedByProxy"), + + ALLEVENTS("allEvents"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENT = "event"; + private EventEnum event; + + public static final String JSON_PROPERTY_NOTIFY_U_R_L = "notifyURL"; + private String notifyURL; + + public static final String JSON_PROPERTY_WEBHOOK_ID = "webhookId"; + private Integer webhookId; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private Integer messageId; + + public ExportWebhooksHistory() { + } + + public ExportWebhooksHistory days(Integer days) { + + this.days = days; + return this; + } + + /** + * Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + * @return days + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDays() { + return days; + } + + + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDays(Integer days) { + this.days = days; + } + + + public ExportWebhooksHistory startDate(String startDate) { + + this.startDate = startDate; + return this; + } + + /** + * Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate + * @return startDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + + public ExportWebhooksHistory endDate(String endDate) { + + this.endDate = endDate; + return this; + } + + /** + * Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + * @return endDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + + public ExportWebhooksHistory sort(String sort) { + + this.sort = sort; + return this; + } + + /** + * Sorting order of records (asc or desc) + * @return sort + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSort(String sort) { + this.sort = sort; + } + + + public ExportWebhooksHistory type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Filter the history based on webhook type + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public ExportWebhooksHistory event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Filter the history for a specific event type + * @return event + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventEnum getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(EventEnum event) { + this.event = event; + } + + + public ExportWebhooksHistory notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * Webhook URL to receive CSV file link + * @return notifyURL + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNotifyURL() { + return notifyURL; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public ExportWebhooksHistory webhookId(Integer webhookId) { + + this.webhookId = webhookId; + return this; + } + + /** + * Filter the history for a specific webhook id + * @return webhookId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBHOOK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWebhookId() { + return webhookId; + } + + + @JsonProperty(JSON_PROPERTY_WEBHOOK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebhookId(Integer webhookId) { + this.webhookId = webhookId; + } + + + public ExportWebhooksHistory email(String email) { + + this.email = email; + return this; + } + + /** + * Filter the history for a specific email + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public ExportWebhooksHistory messageId(Integer messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Filter the history for a specific message id. Applicable only for transactional webhooks. + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(Integer messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExportWebhooksHistory exportWebhooksHistory = (ExportWebhooksHistory) o; + return Objects.equals(this.days, exportWebhooksHistory.days) && + Objects.equals(this.startDate, exportWebhooksHistory.startDate) && + Objects.equals(this.endDate, exportWebhooksHistory.endDate) && + Objects.equals(this.sort, exportWebhooksHistory.sort) && + Objects.equals(this.type, exportWebhooksHistory.type) && + Objects.equals(this.event, exportWebhooksHistory.event) && + Objects.equals(this.notifyURL, exportWebhooksHistory.notifyURL) && + Objects.equals(this.webhookId, exportWebhooksHistory.webhookId) && + Objects.equals(this.email, exportWebhooksHistory.email) && + Objects.equals(this.messageId, exportWebhooksHistory.messageId); + } + + @Override + public int hashCode() { + return Objects.hash(days, startDate, endDate, sort, type, event, notifyURL, webhookId, email, messageId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExportWebhooksHistory {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `days` to the URL query string + if (getDays() != null) { + try { + joiner.add(String.format("%sdays%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDays()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startDate` to the URL query string + if (getStartDate() != null) { + try { + joiner.add(String.format("%sstartDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endDate` to the URL query string + if (getEndDate() != null) { + try { + joiner.add(String.format("%sendDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `event` to the URL query string + if (getEvent() != null) { + try { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEvent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `notifyURL` to the URL query string + if (getNotifyURL() != null) { + try { + joiner.add(String.format("%snotifyURL%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyURL()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `webhookId` to the URL query string + if (getWebhookId() != null) { + try { + joiner.add(String.format("%swebhookId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWebhookId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistoryRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistoryRequest.java new file mode 100644 index 0000000..e4b8672 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ExportWebhooksHistoryRequest.java @@ -0,0 +1,631 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.ExportWebhooksHistory; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ExportWebhooksHistoryRequest + */ +@JsonPropertyOrder({ + ExportWebhooksHistoryRequest.JSON_PROPERTY_DAYS, + ExportWebhooksHistoryRequest.JSON_PROPERTY_START_DATE, + ExportWebhooksHistoryRequest.JSON_PROPERTY_END_DATE, + ExportWebhooksHistoryRequest.JSON_PROPERTY_SORT, + ExportWebhooksHistoryRequest.JSON_PROPERTY_TYPE, + ExportWebhooksHistoryRequest.JSON_PROPERTY_EVENT, + ExportWebhooksHistoryRequest.JSON_PROPERTY_NOTIFY_U_R_L, + ExportWebhooksHistoryRequest.JSON_PROPERTY_WEBHOOK_ID, + ExportWebhooksHistoryRequest.JSON_PROPERTY_EMAIL, + ExportWebhooksHistoryRequest.JSON_PROPERTY_MESSAGE_ID +}) +@JsonTypeName("exportWebhooksHistory_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ExportWebhooksHistoryRequest { + public static final String JSON_PROPERTY_DAYS = "days"; + private Integer days; + + public static final String JSON_PROPERTY_START_DATE = "startDate"; + private String startDate; + + public static final String JSON_PROPERTY_END_DATE = "endDate"; + private String endDate; + + public static final String JSON_PROPERTY_SORT = "sort"; + private String sort; + + /** + * Filter the history based on webhook type + */ + public enum TypeEnum { + TRANSACTIONAL("transactional"), + + MARKETING("marketing"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Filter the history for a specific event type + */ + public enum EventEnum { + INVALID_PARAMETER("invalid_parameter"), + + MISSING_PARAMETER("missing_parameter"), + + HARDBOUNCE("hardBounce"), + + SOFTBOUNCE("softBounce"), + + DELIVERED("delivered"), + + SPAM("spam"), + + REQUEST("request"), + + OPENED("opened"), + + CLICK("click"), + + INVALID("invalid"), + + DEFERRED("deferred"), + + BLOCKED("blocked"), + + UNSUBSCRIBED("unsubscribed"), + + ERROR("error"), + + UNIQUEOPENED("uniqueOpened"), + + LOADEDBYPROXY("loadedByProxy"), + + ALLEVENTS("allEvents"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENT = "event"; + private EventEnum event; + + public static final String JSON_PROPERTY_NOTIFY_U_R_L = "notifyURL"; + private String notifyURL; + + public static final String JSON_PROPERTY_WEBHOOK_ID = "webhookId"; + private Integer webhookId; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private Integer messageId; + + public ExportWebhooksHistoryRequest() { + } + + public ExportWebhooksHistoryRequest days(Integer days) { + + this.days = days; + return this; + } + + /** + * Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + * @return days + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDays() { + return days; + } + + + @JsonProperty(JSON_PROPERTY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDays(Integer days) { + this.days = days; + } + + + public ExportWebhooksHistoryRequest startDate(String startDate) { + + this.startDate = startDate; + return this; + } + + /** + * Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate + * @return startDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + + public ExportWebhooksHistoryRequest endDate(String endDate) { + + this.endDate = endDate; + return this; + } + + /** + * Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + * @return endDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + + public ExportWebhooksHistoryRequest sort(String sort) { + + this.sort = sort; + return this; + } + + /** + * Sorting order of records (asc or desc) + * @return sort + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSort() { + return sort; + } + + + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSort(String sort) { + this.sort = sort; + } + + + public ExportWebhooksHistoryRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Filter the history based on webhook type + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public ExportWebhooksHistoryRequest event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Filter the history for a specific event type + * @return event + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventEnum getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(EventEnum event) { + this.event = event; + } + + + public ExportWebhooksHistoryRequest notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * Webhook URL to receive CSV file link + * @return notifyURL + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNotifyURL() { + return notifyURL; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public ExportWebhooksHistoryRequest webhookId(Integer webhookId) { + + this.webhookId = webhookId; + return this; + } + + /** + * Filter the history for a specific webhook id + * @return webhookId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBHOOK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWebhookId() { + return webhookId; + } + + + @JsonProperty(JSON_PROPERTY_WEBHOOK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebhookId(Integer webhookId) { + this.webhookId = webhookId; + } + + + public ExportWebhooksHistoryRequest email(String email) { + + this.email = email; + return this; + } + + /** + * Filter the history for a specific email + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public ExportWebhooksHistoryRequest messageId(Integer messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Filter the history for a specific message id. Applicable only for transactional webhooks. + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(Integer messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExportWebhooksHistoryRequest exportWebhooksHistoryRequest = (ExportWebhooksHistoryRequest) o; + return Objects.equals(this.days, exportWebhooksHistoryRequest.days) && + Objects.equals(this.startDate, exportWebhooksHistoryRequest.startDate) && + Objects.equals(this.endDate, exportWebhooksHistoryRequest.endDate) && + Objects.equals(this.sort, exportWebhooksHistoryRequest.sort) && + Objects.equals(this.type, exportWebhooksHistoryRequest.type) && + Objects.equals(this.event, exportWebhooksHistoryRequest.event) && + Objects.equals(this.notifyURL, exportWebhooksHistoryRequest.notifyURL) && + Objects.equals(this.webhookId, exportWebhooksHistoryRequest.webhookId) && + Objects.equals(this.email, exportWebhooksHistoryRequest.email) && + Objects.equals(this.messageId, exportWebhooksHistoryRequest.messageId); + } + + @Override + public int hashCode() { + return Objects.hash(days, startDate, endDate, sort, type, event, notifyURL, webhookId, email, messageId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExportWebhooksHistoryRequest {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `days` to the URL query string + if (getDays() != null) { + try { + joiner.add(String.format("%sdays%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDays()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startDate` to the URL query string + if (getStartDate() != null) { + try { + joiner.add(String.format("%sstartDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endDate` to the URL query string + if (getEndDate() != null) { + try { + joiner.add(String.format("%sendDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sort` to the URL query string + if (getSort() != null) { + try { + joiner.add(String.format("%ssort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `event` to the URL query string + if (getEvent() != null) { + try { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEvent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `notifyURL` to the URL query string + if (getNotifyURL() != null) { + try { + joiner.add(String.format("%snotifyURL%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyURL()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `webhookId` to the URL query string + if (getWebhookId() != null) { + try { + joiner.add(String.format("%swebhookId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWebhookId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileData.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileData.java new file mode 100644 index 0000000..b8c9277 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileData.java @@ -0,0 +1,404 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * File data that is uploaded + */ +@JsonPropertyOrder({ + FileData.JSON_PROPERTY_NAME, + FileData.JSON_PROPERTY_AUTHOR_ID, + FileData.JSON_PROPERTY_CONTACT_ID, + FileData.JSON_PROPERTY_DEAL_ID, + FileData.JSON_PROPERTY_COMPANY_ID, + FileData.JSON_PROPERTY_SIZE, + FileData.JSON_PROPERTY_CREATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FileData { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_AUTHOR_ID = "authorId"; + private String authorId; + + public static final String JSON_PROPERTY_CONTACT_ID = "contactId"; + private Long contactId; + + public static final String JSON_PROPERTY_DEAL_ID = "dealId"; + private String dealId; + + public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; + private String companyId; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public FileData() { + } + + public FileData name(String name) { + + this.name = name; + return this; + } + + /** + * Name of uploaded file + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public FileData authorId(String authorId) { + + this.authorId = authorId; + return this; + } + + /** + * Account id of user which created the file + * @return authorId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAuthorId() { + return authorId; + } + + + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorId(String authorId) { + this.authorId = authorId; + } + + + public FileData contactId(Long contactId) { + + this.contactId = contactId; + return this; + } + + /** + * Contact id of contact on which file is uploaded + * @return contactId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getContactId() { + return contactId; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactId(Long contactId) { + this.contactId = contactId; + } + + + public FileData dealId(String dealId) { + + this.dealId = dealId; + return this; + } + + /** + * Deal id linked to a file + * @return dealId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDealId() { + return dealId; + } + + + @JsonProperty(JSON_PROPERTY_DEAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealId(String dealId) { + this.dealId = dealId; + } + + + public FileData companyId(String companyId) { + + this.companyId = companyId; + return this; + } + + /** + * Company id linked to a file + * @return companyId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyId() { + return companyId; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public FileData size(Long size) { + + this.size = size; + return this; + } + + /** + * Size of file in bytes + * @return size + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(Long size) { + this.size = size; + } + + + public FileData createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * File created date/time + * @return createdAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileData fileData = (FileData) o; + return Objects.equals(this.name, fileData.name) && + Objects.equals(this.authorId, fileData.authorId) && + Objects.equals(this.contactId, fileData.contactId) && + Objects.equals(this.dealId, fileData.dealId) && + Objects.equals(this.companyId, fileData.companyId) && + Objects.equals(this.size, fileData.size) && + Objects.equals(this.createdAt, fileData.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(name, authorId, contactId, dealId, companyId, size, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileData {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authorId: ").append(toIndentedString(authorId)).append("\n"); + sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n"); + sb.append(" dealId: ").append(toIndentedString(dealId)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authorId` to the URL query string + if (getAuthorId() != null) { + try { + joiner.add(String.format("%sauthorId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthorId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactId` to the URL query string + if (getContactId() != null) { + try { + joiner.add(String.format("%scontactId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContactId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `dealId` to the URL query string + if (getDealId() != null) { + try { + joiner.add(String.format("%sdealId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDealId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyId` to the URL query string + if (getCompanyId() != null) { + try { + joiner.add(String.format("%scompanyId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `size` to the URL query string + if (getSize() != null) { + try { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileDownloadableLink.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileDownloadableLink.java new file mode 100644 index 0000000..ce45945 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/FileDownloadableLink.java @@ -0,0 +1,151 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Downloadable file link + */ +@JsonPropertyOrder({ + FileDownloadableLink.JSON_PROPERTY_FILE_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FileDownloadableLink { + public static final String JSON_PROPERTY_FILE_URL = "fileUrl"; + private String fileUrl; + + public FileDownloadableLink() { + } + + public FileDownloadableLink fileUrl(String fileUrl) { + + this.fileUrl = fileUrl; + return this; + } + + /** + * A unique link to download the requested file. + * @return fileUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileUrl() { + return fileUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileDownloadableLink fileDownloadableLink = (FileDownloadableLink) o; + return Objects.equals(this.fileUrl, fileDownloadableLink.fileUrl); + } + + @Override + public int hashCode() { + return Objects.hash(fileUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileDownloadableLink {\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `fileUrl` to the URL query string + if (getFileUrl() != null) { + try { + joiner.add(String.format("%sfileUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFileUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccount.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccount.java new file mode 100644 index 0000000..f29c6af --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccount.java @@ -0,0 +1,446 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetAccountAllOfMarketingAutomation; +import software.xdev.brevo.model.GetAccountAllOfPlan; +import software.xdev.brevo.model.GetAccountAllOfRelay; +import software.xdev.brevo.model.GetExtendedClientAllOfAddress; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAccount + */ +@JsonPropertyOrder({ + GetAccount.JSON_PROPERTY_EMAIL, + GetAccount.JSON_PROPERTY_FIRST_NAME, + GetAccount.JSON_PROPERTY_LAST_NAME, + GetAccount.JSON_PROPERTY_COMPANY_NAME, + GetAccount.JSON_PROPERTY_ADDRESS, + GetAccount.JSON_PROPERTY_PLAN, + GetAccount.JSON_PROPERTY_RELAY, + GetAccount.JSON_PROPERTY_MARKETING_AUTOMATION +}) +@JsonTypeName("getAccount") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccount { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + private GetExtendedClientAllOfAddress address; + + public static final String JSON_PROPERTY_PLAN = "plan"; + private List plan = new ArrayList<>(); + + public static final String JSON_PROPERTY_RELAY = "relay"; + private GetAccountAllOfRelay relay; + + public static final String JSON_PROPERTY_MARKETING_AUTOMATION = "marketingAutomation"; + private GetAccountAllOfMarketingAutomation marketingAutomation; + + public GetAccount() { + } + + public GetAccount email(String email) { + + this.email = email; + return this; + } + + /** + * Login Email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetAccount firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First Name + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public GetAccount lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last Name + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public GetAccount companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public GetAccount address(GetExtendedClientAllOfAddress address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedClientAllOfAddress getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(GetExtendedClientAllOfAddress address) { + this.address = address; + } + + + public GetAccount plan(List plan) { + + this.plan = plan; + return this; + } + + public GetAccount addPlanItem(GetAccountAllOfPlan planItem) { + if (this.plan == null) { + this.plan = new ArrayList<>(); + } + this.plan.add(planItem); + return this; + } + + /** + * Information about your plans and credits + * @return plan + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PLAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPlan() { + return plan; + } + + + @JsonProperty(JSON_PROPERTY_PLAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPlan(List plan) { + this.plan = plan; + } + + + public GetAccount relay(GetAccountAllOfRelay relay) { + + this.relay = relay; + return this; + } + + /** + * Get relay + * @return relay + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RELAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetAccountAllOfRelay getRelay() { + return relay; + } + + + @JsonProperty(JSON_PROPERTY_RELAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRelay(GetAccountAllOfRelay relay) { + this.relay = relay; + } + + + public GetAccount marketingAutomation(GetAccountAllOfMarketingAutomation marketingAutomation) { + + this.marketingAutomation = marketingAutomation; + return this; + } + + /** + * Get marketingAutomation + * @return marketingAutomation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MARKETING_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetAccountAllOfMarketingAutomation getMarketingAutomation() { + return marketingAutomation; + } + + + @JsonProperty(JSON_PROPERTY_MARKETING_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMarketingAutomation(GetAccountAllOfMarketingAutomation marketingAutomation) { + this.marketingAutomation = marketingAutomation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccount getAccount = (GetAccount) o; + return Objects.equals(this.email, getAccount.email) && + Objects.equals(this.firstName, getAccount.firstName) && + Objects.equals(this.lastName, getAccount.lastName) && + Objects.equals(this.companyName, getAccount.companyName) && + Objects.equals(this.address, getAccount.address) && + Objects.equals(this.plan, getAccount.plan) && + Objects.equals(this.relay, getAccount.relay) && + Objects.equals(this.marketingAutomation, getAccount.marketingAutomation); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, address, plan, relay, marketingAutomation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccount {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" plan: ").append(toIndentedString(plan)).append("\n"); + sb.append(" relay: ").append(toIndentedString(relay)).append("\n"); + sb.append(" marketingAutomation: ").append(toIndentedString(marketingAutomation)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(getAddress().toUrlQueryString(prefix + "address" + suffix)); + } + + // add `plan` to the URL query string + if (getPlan() != null) { + for (int i = 0; i < getPlan().size(); i++) { + if (getPlan().get(i) != null) { + joiner.add(getPlan().get(i).toUrlQueryString(String.format("%splan%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `relay` to the URL query string + if (getRelay() != null) { + joiner.add(getRelay().toUrlQueryString(prefix + "relay" + suffix)); + } + + // add `marketingAutomation` to the URL query string + if (getMarketingAutomation() != null) { + joiner.add(getMarketingAutomation().toUrlQueryString(prefix + "marketingAutomation" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivity.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivity.java new file mode 100644 index 0000000..8540bb2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivity.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetAccountActivityLogsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAccountActivity + */ +@JsonPropertyOrder({ + GetAccountActivity.JSON_PROPERTY_LOGS +}) +@JsonTypeName("getAccountActivity") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountActivity { + public static final String JSON_PROPERTY_LOGS = "logs"; + private List logs; + + public GetAccountActivity() { + } + + public GetAccountActivity logs(List logs) { + + this.logs = logs; + return this; + } + + public GetAccountActivity addLogsItem(GetAccountActivityLogsInner logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * Get user activity logs + * @return logs + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLogs() { + return logs; + } + + + @JsonProperty(JSON_PROPERTY_LOGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogs(List logs) { + this.logs = logs; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountActivity getAccountActivity = (GetAccountActivity) o; + return Objects.equals(this.logs, getAccountActivity.logs); + } + + @Override + public int hashCode() { + return Objects.hash(logs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountActivity {\n"); + sb.append(" logs: ").append(toIndentedString(logs)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `logs` to the URL query string + if (getLogs() != null) { + for (int i = 0; i < getLogs().size(); i++) { + if (getLogs().get(i) != null) { + joiner.add(getLogs().get(i).toUrlQueryString(String.format("%slogs%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivityLogsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivityLogsInner.java new file mode 100644 index 0000000..2bea9b5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountActivityLogsInner.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAccountActivityLogsInner + */ +@JsonPropertyOrder({ + GetAccountActivityLogsInner.JSON_PROPERTY_ACTION, + GetAccountActivityLogsInner.JSON_PROPERTY_DATE, + GetAccountActivityLogsInner.JSON_PROPERTY_USER_EMAIL, + GetAccountActivityLogsInner.JSON_PROPERTY_USER_IP, + GetAccountActivityLogsInner.JSON_PROPERTY_USER_AGENT +}) +@JsonTypeName("getAccountActivity_logs_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountActivityLogsInner { + public static final String JSON_PROPERTY_ACTION = "action"; + private String action; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_USER_EMAIL = "user_email"; + private String userEmail; + + public static final String JSON_PROPERTY_USER_IP = "user_ip"; + private String userIp; + + public static final String JSON_PROPERTY_USER_AGENT = "user_agent"; + private String userAgent; + + public GetAccountActivityLogsInner() { + } + + public GetAccountActivityLogsInner action(String action) { + + this.action = action; + return this; + } + + /** + * Type of activity in the account. + * @return action + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getAction() { + return action; + } + + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAction(String action) { + this.action = action; + } + + + public GetAccountActivityLogsInner date(String date) { + + this.date = date; + return this; + } + + /** + * Time of the activity. + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(String date) { + this.date = date; + } + + + public GetAccountActivityLogsInner userEmail(String userEmail) { + + this.userEmail = userEmail; + return this; + } + + /** + * Email address of the user who performed activity in the account. + * @return userEmail + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUserEmail() { + return userEmail; + } + + + @JsonProperty(JSON_PROPERTY_USER_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + + public GetAccountActivityLogsInner userIp(String userIp) { + + this.userIp = userIp; + return this; + } + + /** + * IP address of the user who performed activity in the account. + * @return userIp + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUserIp() { + return userIp; + } + + + @JsonProperty(JSON_PROPERTY_USER_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserIp(String userIp) { + this.userIp = userIp; + } + + + public GetAccountActivityLogsInner userAgent(String userAgent) { + + this.userAgent = userAgent; + return this; + } + + /** + * Browser details of the user who performed the activity. + * @return userAgent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUserAgent() { + return userAgent; + } + + + @JsonProperty(JSON_PROPERTY_USER_AGENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountActivityLogsInner getAccountActivityLogsInner = (GetAccountActivityLogsInner) o; + return Objects.equals(this.action, getAccountActivityLogsInner.action) && + Objects.equals(this.date, getAccountActivityLogsInner.date) && + Objects.equals(this.userEmail, getAccountActivityLogsInner.userEmail) && + Objects.equals(this.userIp, getAccountActivityLogsInner.userIp) && + Objects.equals(this.userAgent, getAccountActivityLogsInner.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(action, date, userEmail, userIp, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountActivityLogsInner {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); + sb.append(" userIp: ").append(toIndentedString(userIp)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `action` to the URL query string + if (getAction() != null) { + try { + joiner.add(String.format("%saction%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAction()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `user_email` to the URL query string + if (getUserEmail() != null) { + try { + joiner.add(String.format("%suser_email%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `user_ip` to the URL query string + if (getUserIp() != null) { + try { + joiner.add(String.format("%suser_ip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `user_agent` to the URL query string + if (getUserAgent() != null) { + try { + joiner.add(String.format("%suser_agent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserAgent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfMarketingAutomation.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfMarketingAutomation.java new file mode 100644 index 0000000..baf177e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfMarketingAutomation.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAccountAllOfMarketingAutomation + */ +@JsonPropertyOrder({ + GetAccountAllOfMarketingAutomation.JSON_PROPERTY_KEY, + GetAccountAllOfMarketingAutomation.JSON_PROPERTY_ENABLED +}) +@JsonTypeName("getAccount_allOf_marketingAutomation") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAllOfMarketingAutomation { + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public GetAccountAllOfMarketingAutomation() { + } + + public GetAccountAllOfMarketingAutomation key(String key) { + + this.key = key; + return this; + } + + /** + * Marketing Automation Tracker ID + * @return key + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(String key) { + this.key = key; + } + + + public GetAccountAllOfMarketingAutomation enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) + * @return enabled + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAllOfMarketingAutomation getAccountAllOfMarketingAutomation = (GetAccountAllOfMarketingAutomation) o; + return Objects.equals(this.key, getAccountAllOfMarketingAutomation.key) && + Objects.equals(this.enabled, getAccountAllOfMarketingAutomation.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(key, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAllOfMarketingAutomation {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `key` to the URL query string + if (getKey() != null) { + try { + joiner.add(String.format("%skey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKey()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `enabled` to the URL query string + if (getEnabled() != null) { + try { + joiner.add(String.format("%senabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfPlan.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfPlan.java new file mode 100644 index 0000000..f5a1a26 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfPlan.java @@ -0,0 +1,437 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAccountAllOfPlan + */ +@JsonPropertyOrder({ + GetAccountAllOfPlan.JSON_PROPERTY_TYPE, + GetAccountAllOfPlan.JSON_PROPERTY_CREDITS_TYPE, + GetAccountAllOfPlan.JSON_PROPERTY_CREDITS, + GetAccountAllOfPlan.JSON_PROPERTY_START_DATE, + GetAccountAllOfPlan.JSON_PROPERTY_END_DATE, + GetAccountAllOfPlan.JSON_PROPERTY_USER_LIMIT +}) +@JsonTypeName("getAccount_allOf_plan") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAllOfPlan { + /** + * Displays the plan type of the user + */ + public enum TypeEnum { + PAYASYOUGO("payAsYouGo"), + + FREE("free"), + + SUBSCRIPTION("subscription"), + + SMS("sms"), + + RESELLER("reseller"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. + */ + public enum CreditsTypeEnum { + SENDLIMIT("sendLimit"); + + private String value; + + CreditsTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CreditsTypeEnum fromValue(String value) { + for (CreditsTypeEnum b : CreditsTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CREDITS_TYPE = "creditsType"; + private CreditsTypeEnum creditsType; + + public static final String JSON_PROPERTY_CREDITS = "credits"; + private Float credits; + + public static final String JSON_PROPERTY_START_DATE = "startDate"; + private LocalDate startDate; + + public static final String JSON_PROPERTY_END_DATE = "endDate"; + private LocalDate endDate; + + public static final String JSON_PROPERTY_USER_LIMIT = "userLimit"; + private Integer userLimit; + + public GetAccountAllOfPlan() { + } + + public GetAccountAllOfPlan type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Displays the plan type of the user + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetAccountAllOfPlan creditsType(CreditsTypeEnum creditsType) { + + this.creditsType = creditsType; + return this; + } + + /** + * This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. + * @return creditsType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREDITS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CreditsTypeEnum getCreditsType() { + return creditsType; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreditsType(CreditsTypeEnum creditsType) { + this.creditsType = creditsType; + } + + + public GetAccountAllOfPlan credits(Float credits) { + + this.credits = credits; + return this; + } + + /** + * Remaining credits of the user + * @return credits + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getCredits() { + return credits; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCredits(Float credits) { + this.credits = credits; + } + + + public GetAccountAllOfPlan startDate(LocalDate startDate) { + + this.startDate = startDate; + return this; + } + + /** + * Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) + * @return startDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LocalDate getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + + public GetAccountAllOfPlan endDate(LocalDate endDate) { + + this.endDate = endDate; + return this; + } + + /** + * Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) + * @return endDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LocalDate getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(LocalDate endDate) { + this.endDate = endDate; + } + + + public GetAccountAllOfPlan userLimit(Integer userLimit) { + + this.userLimit = userLimit; + return this; + } + + /** + * Only in case of reseller account. It implies the total number of child accounts you can add to your account. + * @return userLimit + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUserLimit() { + return userLimit; + } + + + @JsonProperty(JSON_PROPERTY_USER_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserLimit(Integer userLimit) { + this.userLimit = userLimit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAllOfPlan getAccountAllOfPlan = (GetAccountAllOfPlan) o; + return Objects.equals(this.type, getAccountAllOfPlan.type) && + Objects.equals(this.creditsType, getAccountAllOfPlan.creditsType) && + Objects.equals(this.credits, getAccountAllOfPlan.credits) && + Objects.equals(this.startDate, getAccountAllOfPlan.startDate) && + Objects.equals(this.endDate, getAccountAllOfPlan.endDate) && + Objects.equals(this.userLimit, getAccountAllOfPlan.userLimit); + } + + @Override + public int hashCode() { + return Objects.hash(type, creditsType, credits, startDate, endDate, userLimit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAllOfPlan {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" creditsType: ").append(toIndentedString(creditsType)).append("\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" userLimit: ").append(toIndentedString(userLimit)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `creditsType` to the URL query string + if (getCreditsType() != null) { + try { + joiner.add(String.format("%screditsType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreditsType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credits` to the URL query string + if (getCredits() != null) { + try { + joiner.add(String.format("%scredits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCredits()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `startDate` to the URL query string + if (getStartDate() != null) { + try { + joiner.add(String.format("%sstartDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `endDate` to the URL query string + if (getEndDate() != null) { + try { + joiner.add(String.format("%sendDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `userLimit` to the URL query string + if (getUserLimit() != null) { + try { + joiner.add(String.format("%suserLimit%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserLimit()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelay.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelay.java new file mode 100644 index 0000000..b147f32 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelay.java @@ -0,0 +1,190 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetAccountAllOfRelayData; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Information about your transactional email account + */ +@JsonPropertyOrder({ + GetAccountAllOfRelay.JSON_PROPERTY_ENABLED, + GetAccountAllOfRelay.JSON_PROPERTY_DATA +}) +@JsonTypeName("getAccount_allOf_relay") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAllOfRelay { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_DATA = "data"; + private GetAccountAllOfRelayData data; + + public GetAccountAllOfRelay() { + } + + public GetAccountAllOfRelay enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Status of your transactional email Account (true=Enabled, false=Disabled) + * @return enabled + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + public GetAccountAllOfRelay data(GetAccountAllOfRelayData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetAccountAllOfRelayData getData() { + return data; + } + + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(GetAccountAllOfRelayData data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAllOfRelay getAccountAllOfRelay = (GetAccountAllOfRelay) o; + return Objects.equals(this.enabled, getAccountAllOfRelay.enabled) && + Objects.equals(this.data, getAccountAllOfRelay.data); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAllOfRelay {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enabled` to the URL query string + if (getEnabled() != null) { + try { + joiner.add(String.format("%senabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelayData.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelayData.java new file mode 100644 index 0000000..dbdcc00 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAccountAllOfRelayData.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Data regarding the transactional email account + */ +@JsonPropertyOrder({ + GetAccountAllOfRelayData.JSON_PROPERTY_USER_NAME, + GetAccountAllOfRelayData.JSON_PROPERTY_RELAY, + GetAccountAllOfRelayData.JSON_PROPERTY_PORT +}) +@JsonTypeName("getAccount_allOf_relay_data") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAllOfRelayData { + public static final String JSON_PROPERTY_USER_NAME = "userName"; + private String userName; + + public static final String JSON_PROPERTY_RELAY = "relay"; + private String relay; + + public static final String JSON_PROPERTY_PORT = "port"; + private Integer port; + + public GetAccountAllOfRelayData() { + } + + public GetAccountAllOfRelayData userName(String userName) { + + this.userName = userName; + return this; + } + + /** + * Email to use as login on transactional platform + * @return userName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUserName() { + return userName; + } + + + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserName(String userName) { + this.userName = userName; + } + + + public GetAccountAllOfRelayData relay(String relay) { + + this.relay = relay; + return this; + } + + /** + * URL of the SMTP Relay + * @return relay + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RELAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRelay() { + return relay; + } + + + @JsonProperty(JSON_PROPERTY_RELAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRelay(String relay) { + this.relay = relay; + } + + + public GetAccountAllOfRelayData port(Integer port) { + + this.port = port; + return this; + } + + /** + * Port used for SMTP Relay + * @return port + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getPort() { + return port; + } + + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPort(Integer port) { + this.port = port; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAllOfRelayData getAccountAllOfRelayData = (GetAccountAllOfRelayData) o; + return Objects.equals(this.userName, getAccountAllOfRelayData.userName) && + Objects.equals(this.relay, getAccountAllOfRelayData.relay) && + Objects.equals(this.port, getAccountAllOfRelayData.port); + } + + @Override + public int hashCode() { + return Objects.hash(userName, relay, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAllOfRelayData {\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" relay: ").append(toIndentedString(relay)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `userName` to the URL query string + if (getUserName() != null) { + try { + joiner.add(String.format("%suserName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `relay` to the URL query string + if (getRelay() != null) { + try { + joiner.add(String.format("%srelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `port` to the URL query string + if (getPort() != null) { + try { + joiner.add(String.format("%sport%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPort()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAggregatedReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAggregatedReport.java new file mode 100644 index 0000000..503f8d2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAggregatedReport.java @@ -0,0 +1,656 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAggregatedReport + */ +@JsonPropertyOrder({ + GetAggregatedReport.JSON_PROPERTY_RANGE, + GetAggregatedReport.JSON_PROPERTY_REQUESTS, + GetAggregatedReport.JSON_PROPERTY_DELIVERED, + GetAggregatedReport.JSON_PROPERTY_HARD_BOUNCES, + GetAggregatedReport.JSON_PROPERTY_SOFT_BOUNCES, + GetAggregatedReport.JSON_PROPERTY_CLICKS, + GetAggregatedReport.JSON_PROPERTY_UNIQUE_CLICKS, + GetAggregatedReport.JSON_PROPERTY_OPENS, + GetAggregatedReport.JSON_PROPERTY_UNIQUE_OPENS, + GetAggregatedReport.JSON_PROPERTY_SPAM_REPORTS, + GetAggregatedReport.JSON_PROPERTY_BLOCKED, + GetAggregatedReport.JSON_PROPERTY_INVALID, + GetAggregatedReport.JSON_PROPERTY_UNSUBSCRIBED +}) +@JsonTypeName("getAggregatedReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAggregatedReport { + public static final String JSON_PROPERTY_RANGE = "range"; + private String range; + + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private Long requests; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_CLICKS = "clicks"; + private Long clicks; + + public static final String JSON_PROPERTY_UNIQUE_CLICKS = "uniqueClicks"; + private Long uniqueClicks; + + public static final String JSON_PROPERTY_OPENS = "opens"; + private Long opens; + + public static final String JSON_PROPERTY_UNIQUE_OPENS = "uniqueOpens"; + private Long uniqueOpens; + + public static final String JSON_PROPERTY_SPAM_REPORTS = "spamReports"; + private Long spamReports; + + public static final String JSON_PROPERTY_BLOCKED = "blocked"; + private Long blocked; + + public static final String JSON_PROPERTY_INVALID = "invalid"; + private Long invalid; + + public static final String JSON_PROPERTY_UNSUBSCRIBED = "unsubscribed"; + private Long unsubscribed; + + public GetAggregatedReport() { + } + + public GetAggregatedReport range(String range) { + + this.range = range; + return this; + } + + /** + * Time frame of the report + * @return range + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRange() { + return range; + } + + + @JsonProperty(JSON_PROPERTY_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRange(String range) { + this.range = range; + } + + + public GetAggregatedReport requests(Long requests) { + + this.requests = requests; + return this; + } + + /** + * Number of requests for the timeframe + * @return requests + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRequests() { + return requests; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequests(Long requests) { + this.requests = requests; + } + + + public GetAggregatedReport delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered emails for the timeframe + * @return delivered + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetAggregatedReport hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of hardbounces for the timeframe + * @return hardBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetAggregatedReport softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounces for the timeframe + * @return softBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetAggregatedReport clicks(Long clicks) { + + this.clicks = clicks; + return this; + } + + /** + * Number of clicks for the timeframe + * @return clicks + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getClicks() { + return clicks; + } + + + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClicks(Long clicks) { + this.clicks = clicks; + } + + + public GetAggregatedReport uniqueClicks(Long uniqueClicks) { + + this.uniqueClicks = uniqueClicks; + return this; + } + + /** + * Number of unique clicks for the timeframe + * @return uniqueClicks + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUniqueClicks() { + return uniqueClicks; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUniqueClicks(Long uniqueClicks) { + this.uniqueClicks = uniqueClicks; + } + + + public GetAggregatedReport opens(Long opens) { + + this.opens = opens; + return this; + } + + /** + * Number of openings for the timeframe + * @return opens + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getOpens() { + return opens; + } + + + @JsonProperty(JSON_PROPERTY_OPENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpens(Long opens) { + this.opens = opens; + } + + + public GetAggregatedReport uniqueOpens(Long uniqueOpens) { + + this.uniqueOpens = uniqueOpens; + return this; + } + + /** + * Number of unique openings for the timeframe + * @return uniqueOpens + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIQUE_OPENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUniqueOpens() { + return uniqueOpens; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_OPENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUniqueOpens(Long uniqueOpens) { + this.uniqueOpens = uniqueOpens; + } + + + public GetAggregatedReport spamReports(Long spamReports) { + + this.spamReports = spamReports; + return this; + } + + /** + * Number of complaint (spam report) for the timeframe + * @return spamReports + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPAM_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSpamReports() { + return spamReports; + } + + + @JsonProperty(JSON_PROPERTY_SPAM_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpamReports(Long spamReports) { + this.spamReports = spamReports; + } + + + public GetAggregatedReport blocked(Long blocked) { + + this.blocked = blocked; + return this; + } + + /** + * Number of blocked contact emails for the timeframe + * @return blocked + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getBlocked() { + return blocked; + } + + + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlocked(Long blocked) { + this.blocked = blocked; + } + + + public GetAggregatedReport invalid(Long invalid) { + + this.invalid = invalid; + return this; + } + + /** + * Number of invalid emails for the timeframe + * @return invalid + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInvalid() { + return invalid; + } + + + @JsonProperty(JSON_PROPERTY_INVALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalid(Long invalid) { + this.invalid = invalid; + } + + + public GetAggregatedReport unsubscribed(Long unsubscribed) { + + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Number of unsubscribed emails for the timeframe + * @return unsubscribed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUnsubscribed() { + return unsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscribed(Long unsubscribed) { + this.unsubscribed = unsubscribed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAggregatedReport getAggregatedReport = (GetAggregatedReport) o; + return Objects.equals(this.range, getAggregatedReport.range) && + Objects.equals(this.requests, getAggregatedReport.requests) && + Objects.equals(this.delivered, getAggregatedReport.delivered) && + Objects.equals(this.hardBounces, getAggregatedReport.hardBounces) && + Objects.equals(this.softBounces, getAggregatedReport.softBounces) && + Objects.equals(this.clicks, getAggregatedReport.clicks) && + Objects.equals(this.uniqueClicks, getAggregatedReport.uniqueClicks) && + Objects.equals(this.opens, getAggregatedReport.opens) && + Objects.equals(this.uniqueOpens, getAggregatedReport.uniqueOpens) && + Objects.equals(this.spamReports, getAggregatedReport.spamReports) && + Objects.equals(this.blocked, getAggregatedReport.blocked) && + Objects.equals(this.invalid, getAggregatedReport.invalid) && + Objects.equals(this.unsubscribed, getAggregatedReport.unsubscribed); + } + + @Override + public int hashCode() { + return Objects.hash(range, requests, delivered, hardBounces, softBounces, clicks, uniqueClicks, opens, uniqueOpens, spamReports, blocked, invalid, unsubscribed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAggregatedReport {\n"); + sb.append(" range: ").append(toIndentedString(range)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" clicks: ").append(toIndentedString(clicks)).append("\n"); + sb.append(" uniqueClicks: ").append(toIndentedString(uniqueClicks)).append("\n"); + sb.append(" opens: ").append(toIndentedString(opens)).append("\n"); + sb.append(" uniqueOpens: ").append(toIndentedString(uniqueOpens)).append("\n"); + sb.append(" spamReports: ").append(toIndentedString(spamReports)).append("\n"); + sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); + sb.append(" invalid: ").append(toIndentedString(invalid)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `range` to the URL query string + if (getRange() != null) { + try { + joiner.add(String.format("%srange%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRange()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `requests` to the URL query string + if (getRequests() != null) { + try { + joiner.add(String.format("%srequests%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRequests()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clicks` to the URL query string + if (getClicks() != null) { + try { + joiner.add(String.format("%sclicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueClicks` to the URL query string + if (getUniqueClicks() != null) { + try { + joiner.add(String.format("%suniqueClicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `opens` to the URL query string + if (getOpens() != null) { + try { + joiner.add(String.format("%sopens%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOpens()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueOpens` to the URL query string + if (getUniqueOpens() != null) { + try { + joiner.add(String.format("%suniqueOpens%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueOpens()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `spamReports` to the URL query string + if (getSpamReports() != null) { + try { + joiner.add(String.format("%sspamReports%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpamReports()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `blocked` to the URL query string + if (getBlocked() != null) { + try { + joiner.add(String.format("%sblocked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBlocked()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `invalid` to the URL query string + if (getInvalid() != null) { + try { + joiner.add(String.format("%sinvalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInvalid()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribed` to the URL query string + if (getUnsubscribed() != null) { + try { + joiner.add(String.format("%sunsubscribed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeeds.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeeds.java new file mode 100644 index 0000000..5fba308 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeeds.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetAllExternalFeedsFeedsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAllExternalFeeds + */ +@JsonPropertyOrder({ + GetAllExternalFeeds.JSON_PROPERTY_COUNT, + GetAllExternalFeeds.JSON_PROPERTY_FEEDS +}) +@JsonTypeName("getAllExternalFeeds") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAllExternalFeeds { + public static final String JSON_PROPERTY_COUNT = "count"; + private Integer count; + + public static final String JSON_PROPERTY_FEEDS = "feeds"; + private List feeds; + + public GetAllExternalFeeds() { + } + + public GetAllExternalFeeds count(Integer count) { + + this.count = count; + return this; + } + + /** + * Total number of batches + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Integer count) { + this.count = count; + } + + + public GetAllExternalFeeds feeds(List feeds) { + + this.feeds = feeds; + return this; + } + + public GetAllExternalFeeds addFeedsItem(GetAllExternalFeedsFeedsInner feedsItem) { + if (this.feeds == null) { + this.feeds = new ArrayList<>(); + } + this.feeds.add(feedsItem); + return this; + } + + /** + * Get feeds + * @return feeds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEEDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFeeds() { + return feeds; + } + + + @JsonProperty(JSON_PROPERTY_FEEDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeeds(List feeds) { + this.feeds = feeds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllExternalFeeds getAllExternalFeeds = (GetAllExternalFeeds) o; + return Objects.equals(this.count, getAllExternalFeeds.count) && + Objects.equals(this.feeds, getAllExternalFeeds.feeds); + } + + @Override + public int hashCode() { + return Objects.hash(count, feeds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllExternalFeeds {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" feeds: ").append(toIndentedString(feeds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `feeds` to the URL query string + if (getFeeds() != null) { + for (int i = 0; i < getFeeds().size(); i++) { + if (getFeeds().get(i) != null) { + joiner.add(getFeeds().get(i).toUrlQueryString(String.format("%sfeeds%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeedsFeedsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeedsFeedsInner.java new file mode 100644 index 0000000..7f0b99f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAllExternalFeedsFeedsInner.java @@ -0,0 +1,666 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExternalFeedByUUIDHeadersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAllExternalFeedsFeedsInner + */ +@JsonPropertyOrder({ + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_ID, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_NAME, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_URL, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_AUTH_TYPE, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_USERNAME, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_PASSWORD, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_TOKEN, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_HEADERS, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_MAX_RETRIES, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_CACHE, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_CREATED_AT, + GetAllExternalFeedsFeedsInner.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getAllExternalFeeds_feeds_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAllExternalFeedsFeedsInner { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + */ + public enum AuthTypeEnum { + BASIC("basic"), + + TOKEN("token"), + + NOAUTH("noAuth"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_AUTH_TYPE = "authType"; + private AuthTypeEnum authType; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_RETRIES = "maxRetries"; + private Integer maxRetries = 5; + + public static final String JSON_PROPERTY_CACHE = "cache"; + private Boolean cache; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private OffsetDateTime modifiedAt; + + public GetAllExternalFeedsFeedsInner() { + } + + public GetAllExternalFeedsFeedsInner id(String id) { + + this.id = id; + return this; + } + + /** + * ID of the feed + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public GetAllExternalFeedsFeedsInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the feed + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetAllExternalFeedsFeedsInner url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the feed + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + + public GetAllExternalFeedsFeedsInner authType(AuthTypeEnum authType) { + + this.authType = authType; + return this; + } + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + * @return authType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AuthTypeEnum getAuthType() { + return authType; + } + + + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthType(AuthTypeEnum authType) { + this.authType = authType; + } + + + public GetAllExternalFeedsFeedsInner username(String username) { + + this.username = username; + return this; + } + + /** + * Username for authType `basic` + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + + public GetAllExternalFeedsFeedsInner password(String password) { + + this.password = password; + return this; + } + + /** + * Password for authType `basic` + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + + public GetAllExternalFeedsFeedsInner token(String token) { + + this.token = token; + return this; + } + + /** + * Token for authType `token` + * @return token + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(String token) { + this.token = token; + } + + + public GetAllExternalFeedsFeedsInner headers(List headers) { + + this.headers = headers; + return this; + } + + public GetAllExternalFeedsFeedsInner addHeadersItem(GetExternalFeedByUUIDHeadersInner headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Custom headers for the feed + * @return headers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeaders(List headers) { + this.headers = headers; + } + + + public GetAllExternalFeedsFeedsInner maxRetries(Integer maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Maximum number of retries on the feed url + * minimum: 0 + * maximum: 5 + * @return maxRetries + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getMaxRetries() { + return maxRetries; + } + + + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + + public GetAllExternalFeedsFeedsInner cache(Boolean cache) { + + this.cache = cache; + return this; + } + + /** + * Toggle caching of feed url response + * @return cache + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getCache() { + return cache; + } + + + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCache(Boolean cache) { + this.cache = cache; + } + + + public GetAllExternalFeedsFeedsInner createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the feed was created + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetAllExternalFeedsFeedsInner modifiedAt(OffsetDateTime modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Datetime on which the feed was modified + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllExternalFeedsFeedsInner getAllExternalFeedsFeedsInner = (GetAllExternalFeedsFeedsInner) o; + return Objects.equals(this.id, getAllExternalFeedsFeedsInner.id) && + Objects.equals(this.name, getAllExternalFeedsFeedsInner.name) && + Objects.equals(this.url, getAllExternalFeedsFeedsInner.url) && + Objects.equals(this.authType, getAllExternalFeedsFeedsInner.authType) && + Objects.equals(this.username, getAllExternalFeedsFeedsInner.username) && + Objects.equals(this.password, getAllExternalFeedsFeedsInner.password) && + Objects.equals(this.token, getAllExternalFeedsFeedsInner.token) && + Objects.equals(this.headers, getAllExternalFeedsFeedsInner.headers) && + Objects.equals(this.maxRetries, getAllExternalFeedsFeedsInner.maxRetries) && + Objects.equals(this.cache, getAllExternalFeedsFeedsInner.cache) && + Objects.equals(this.createdAt, getAllExternalFeedsFeedsInner.createdAt) && + Objects.equals(this.modifiedAt, getAllExternalFeedsFeedsInner.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, authType, username, password, token, headers, maxRetries, cache, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllExternalFeedsFeedsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" cache: ").append(toIndentedString(cache)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authType` to the URL query string + if (getAuthType() != null) { + try { + joiner.add(String.format("%sauthType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `username` to the URL query string + if (getUsername() != null) { + try { + joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `token` to the URL query string + if (getToken() != null) { + try { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToken()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + if (getHeaders().get(i) != null) { + joiner.add(getHeaders().get(i).toUrlQueryString(String.format("%sheaders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `maxRetries` to the URL query string + if (getMaxRetries() != null) { + try { + joiner.add(String.format("%smaxRetries%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMaxRetries()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `cache` to the URL query string + if (getCache() != null) { + try { + joiner.add(String.format("%scache%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCache()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributes.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributes.java new file mode 100644 index 0000000..b7ab56f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributes.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetAttributesAttributesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAttributes + */ +@JsonPropertyOrder({ + GetAttributes.JSON_PROPERTY_ATTRIBUTES +}) +@JsonTypeName("getAttributes") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAttributes { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private List attributes = new ArrayList<>(); + + public GetAttributes() { + } + + public GetAttributes attributes(List attributes) { + + this.attributes = attributes; + return this; + } + + public GetAttributes addAttributesItem(GetAttributesAttributesInner attributesItem) { + if (this.attributes == null) { + this.attributes = new ArrayList<>(); + } + this.attributes.add(attributesItem); + return this; + } + + /** + * Listing of available contact attributes in your account + * @return attributes + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAttributes getAttributes = (GetAttributes) o; + return Objects.equals(this.attributes, getAttributes.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAttributes {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (int i = 0; i < getAttributes().size(); i++) { + if (getAttributes().get(i) != null) { + joiner.add(getAttributes().get(i).toUrlQueryString(String.format("%sattributes%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInner.java new file mode 100644 index 0000000..2f2604c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInner.java @@ -0,0 +1,414 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetAttributesAttributesInnerEnumerationInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAttributesAttributesInner + */ +@JsonPropertyOrder({ + GetAttributesAttributesInner.JSON_PROPERTY_NAME, + GetAttributesAttributesInner.JSON_PROPERTY_CATEGORY, + GetAttributesAttributesInner.JSON_PROPERTY_TYPE, + GetAttributesAttributesInner.JSON_PROPERTY_ENUMERATION, + GetAttributesAttributesInner.JSON_PROPERTY_CALCULATED_VALUE +}) +@JsonTypeName("getAttributes_attributes_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAttributesAttributesInner { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * Category of the attribute + */ + public enum CategoryEnum { + NORMAL("normal"), + + TRANSACTIONAL("transactional"), + + CATEGORY("category"), + + CALCULATED("calculated"), + + GLOBAL("global"); + + private String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CategoryEnum fromValue(String value) { + for (CategoryEnum b : CategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private CategoryEnum category; + + /** + * Type of the attribute + */ + public enum TypeEnum { + TEXT("text"), + + DATE("date"), + + FLOAT("float"), + + ID("id"), + + BOOLEAN("boolean"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_ENUMERATION = "enumeration"; + private List enumeration; + + public static final String JSON_PROPERTY_CALCULATED_VALUE = "calculatedValue"; + private String calculatedValue; + + public GetAttributesAttributesInner() { + } + + public GetAttributesAttributesInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the attribute + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetAttributesAttributesInner category(CategoryEnum category) { + + this.category = category; + return this; + } + + /** + * Category of the attribute + * @return category + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CategoryEnum getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategory(CategoryEnum category) { + this.category = category; + } + + + public GetAttributesAttributesInner type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of the attribute + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetAttributesAttributesInner enumeration(List enumeration) { + + this.enumeration = enumeration; + return this; + } + + public GetAttributesAttributesInner addEnumerationItem(GetAttributesAttributesInnerEnumerationInner enumerationItem) { + if (this.enumeration == null) { + this.enumeration = new ArrayList<>(); + } + this.enumeration.add(enumerationItem); + return this; + } + + /** + * Parameter only available for \"category\" type attributes. + * @return enumeration + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEnumeration() { + return enumeration; + } + + + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumeration(List enumeration) { + this.enumeration = enumeration; + } + + + public GetAttributesAttributesInner calculatedValue(String calculatedValue) { + + this.calculatedValue = calculatedValue; + return this; + } + + /** + * Calculated value formula + * @return calculatedValue + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALCULATED_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCalculatedValue() { + return calculatedValue; + } + + + @JsonProperty(JSON_PROPERTY_CALCULATED_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCalculatedValue(String calculatedValue) { + this.calculatedValue = calculatedValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAttributesAttributesInner getAttributesAttributesInner = (GetAttributesAttributesInner) o; + return Objects.equals(this.name, getAttributesAttributesInner.name) && + Objects.equals(this.category, getAttributesAttributesInner.category) && + Objects.equals(this.type, getAttributesAttributesInner.type) && + Objects.equals(this.enumeration, getAttributesAttributesInner.enumeration) && + Objects.equals(this.calculatedValue, getAttributesAttributesInner.calculatedValue); + } + + @Override + public int hashCode() { + return Objects.hash(name, category, type, enumeration, calculatedValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAttributesAttributesInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" enumeration: ").append(toIndentedString(enumeration)).append("\n"); + sb.append(" calculatedValue: ").append(toIndentedString(calculatedValue)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `category` to the URL query string + if (getCategory() != null) { + try { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCategory()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `enumeration` to the URL query string + if (getEnumeration() != null) { + for (int i = 0; i < getEnumeration().size(); i++) { + if (getEnumeration().get(i) != null) { + joiner.add(getEnumeration().get(i).toUrlQueryString(String.format("%senumeration%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `calculatedValue` to the URL query string + if (getCalculatedValue() != null) { + try { + joiner.add(String.format("%scalculatedValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCalculatedValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInnerEnumerationInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInnerEnumerationInner.java new file mode 100644 index 0000000..1eadb91 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetAttributesAttributesInnerEnumerationInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetAttributesAttributesInnerEnumerationInner + */ +@JsonPropertyOrder({ + GetAttributesAttributesInnerEnumerationInner.JSON_PROPERTY_VALUE, + GetAttributesAttributesInnerEnumerationInner.JSON_PROPERTY_LABEL +}) +@JsonTypeName("getAttributes_attributes_inner_enumeration_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAttributesAttributesInnerEnumerationInner { + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public GetAttributesAttributesInnerEnumerationInner() { + } + + public GetAttributesAttributesInnerEnumerationInner value(Long value) { + + this.value = value; + return this; + } + + /** + * ID of Value of the \"category\" type attribute + * @return value + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(Long value) { + this.value = value; + } + + + public GetAttributesAttributesInnerEnumerationInner label(String label) { + + this.label = label; + return this; + } + + /** + * Label of the \"category\" type attribute + * @return label + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLabel() { + return label; + } + + + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLabel(String label) { + this.label = label; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAttributesAttributesInnerEnumerationInner getAttributesAttributesInnerEnumerationInner = (GetAttributesAttributesInnerEnumerationInner) o; + return Objects.equals(this.value, getAttributesAttributesInnerEnumerationInner.value) && + Objects.equals(this.label, getAttributesAttributesInnerEnumerationInner.label); + } + + @Override + public int hashCode() { + return Objects.hash(value, label); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAttributesAttributesInnerEnumerationInner {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `label` to the URL query string + if (getLabel() != null) { + try { + joiner.add(String.format("%slabel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLabel()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetBlockedDomains.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetBlockedDomains.java new file mode 100644 index 0000000..f72f4fa --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetBlockedDomains.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetBlockedDomains + */ +@JsonPropertyOrder({ + GetBlockedDomains.JSON_PROPERTY_DOMAINS +}) +@JsonTypeName("getBlockedDomains") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockedDomains { + public static final String JSON_PROPERTY_DOMAINS = "domains"; + private List domains = new ArrayList<>(); + + public GetBlockedDomains() { + } + + public GetBlockedDomains domains(List domains) { + + this.domains = domains; + return this; + } + + public GetBlockedDomains addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * List of all blocked domains + * @return domains + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getDomains() { + return domains; + } + + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomains(List domains) { + this.domains = domains; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockedDomains getBlockedDomains = (GetBlockedDomains) o; + return Objects.equals(this.domains, getBlockedDomains.domains); + } + + @Override + public int hashCode() { + return Objects.hash(domains); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockedDomains {\n"); + sb.append(" domains: ").append(toIndentedString(domains)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domains` to the URL query string + if (getDomains() != null) { + for (int i = 0; i < getDomains().size(); i++) { + try { + joiner.add(String.format("%sdomains%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDomains().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignOverview.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignOverview.java new file mode 100644 index 0000000..c102cf2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignOverview.java @@ -0,0 +1,776 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCampaignOverview + */ +@JsonPropertyOrder({ + GetCampaignOverview.JSON_PROPERTY_ID, + GetCampaignOverview.JSON_PROPERTY_NAME, + GetCampaignOverview.JSON_PROPERTY_SUBJECT, + GetCampaignOverview.JSON_PROPERTY_PREVIEW_TEXT, + GetCampaignOverview.JSON_PROPERTY_TYPE, + GetCampaignOverview.JSON_PROPERTY_STATUS, + GetCampaignOverview.JSON_PROPERTY_SCHEDULED_AT, + GetCampaignOverview.JSON_PROPERTY_AB_TESTING, + GetCampaignOverview.JSON_PROPERTY_SUBJECT_A, + GetCampaignOverview.JSON_PROPERTY_SUBJECT_B, + GetCampaignOverview.JSON_PROPERTY_SPLIT_RULE, + GetCampaignOverview.JSON_PROPERTY_WINNER_CRITERIA, + GetCampaignOverview.JSON_PROPERTY_WINNER_DELAY, + GetCampaignOverview.JSON_PROPERTY_SEND_AT_BEST_TIME +}) +@JsonTypeName("getCampaignOverview") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCampaignOverview { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + /** + * Type of campaign + */ + public enum TypeEnum { + CLASSIC("classic"), + + TRIGGER("trigger"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Status of the campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + IN_PROCESS("in_process"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Integer splitRule; + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private String winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Integer winnerDelay; + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime; + + public GetCampaignOverview() { + } + + public GetCampaignOverview id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetCampaignOverview name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetCampaignOverview subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetCampaignOverview previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public GetCampaignOverview type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of campaign + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetCampaignOverview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetCampaignOverview scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetCampaignOverview abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public GetCampaignOverview subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public GetCampaignOverview subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public GetCampaignOverview splitRule(Integer splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Integer splitRule) { + this.splitRule = splitRule; + } + + + public GetCampaignOverview winnerCriteria(String winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(String winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public GetCampaignOverview winnerDelay(Integer winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Integer winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public GetCampaignOverview sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * It is true if you have chosen to send your campaign at best time, otherwise it is false + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCampaignOverview getCampaignOverview = (GetCampaignOverview) o; + return Objects.equals(this.id, getCampaignOverview.id) && + Objects.equals(this.name, getCampaignOverview.name) && + Objects.equals(this.subject, getCampaignOverview.subject) && + Objects.equals(this.previewText, getCampaignOverview.previewText) && + Objects.equals(this.type, getCampaignOverview.type) && + Objects.equals(this.status, getCampaignOverview.status) && + Objects.equals(this.scheduledAt, getCampaignOverview.scheduledAt) && + Objects.equals(this.abTesting, getCampaignOverview.abTesting) && + Objects.equals(this.subjectA, getCampaignOverview.subjectA) && + Objects.equals(this.subjectB, getCampaignOverview.subjectB) && + Objects.equals(this.splitRule, getCampaignOverview.splitRule) && + Objects.equals(this.winnerCriteria, getCampaignOverview.winnerCriteria) && + Objects.equals(this.winnerDelay, getCampaignOverview.winnerDelay) && + Objects.equals(this.sendAtBestTime, getCampaignOverview.sendAtBestTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, subject, previewText, type, status, scheduledAt, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, sendAtBestTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCampaignOverview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignRecipients.java new file mode 100644 index 0000000..53bbf8d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignRecipients.java @@ -0,0 +1,221 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCampaignRecipients + */ +@JsonPropertyOrder({ + GetCampaignRecipients.JSON_PROPERTY_LISTS, + GetCampaignRecipients.JSON_PROPERTY_EXCLUSION_LISTS +}) +@JsonTypeName("getCampaignRecipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCampaignRecipients { + public static final String JSON_PROPERTY_LISTS = "lists"; + private List lists = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXCLUSION_LISTS = "exclusionLists"; + private List exclusionLists = new ArrayList<>(); + + public GetCampaignRecipients() { + } + + public GetCampaignRecipients lists(List lists) { + + this.lists = lists; + return this; + } + + public GetCampaignRecipients addListsItem(Long listsItem) { + if (this.lists == null) { + this.lists = new ArrayList<>(); + } + this.lists.add(listsItem); + return this; + } + + /** + * Get lists + * @return lists + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLists() { + return lists; + } + + + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLists(List lists) { + this.lists = lists; + } + + + public GetCampaignRecipients exclusionLists(List exclusionLists) { + + this.exclusionLists = exclusionLists; + return this; + } + + public GetCampaignRecipients addExclusionListsItem(Long exclusionListsItem) { + if (this.exclusionLists == null) { + this.exclusionLists = new ArrayList<>(); + } + this.exclusionLists.add(exclusionListsItem); + return this; + } + + /** + * Get exclusionLists + * @return exclusionLists + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXCLUSION_LISTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getExclusionLists() { + return exclusionLists; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUSION_LISTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExclusionLists(List exclusionLists) { + this.exclusionLists = exclusionLists; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCampaignRecipients getCampaignRecipients = (GetCampaignRecipients) o; + return Objects.equals(this.lists, getCampaignRecipients.lists) && + Objects.equals(this.exclusionLists, getCampaignRecipients.exclusionLists); + } + + @Override + public int hashCode() { + return Objects.hash(lists, exclusionLists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCampaignRecipients {\n"); + sb.append(" lists: ").append(toIndentedString(lists)).append("\n"); + sb.append(" exclusionLists: ").append(toIndentedString(exclusionLists)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lists` to the URL query string + if (getLists() != null) { + for (int i = 0; i < getLists().size(); i++) { + try { + joiner.add(String.format("%slists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getLists().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `exclusionLists` to the URL query string + if (getExclusionLists() != null) { + for (int i = 0; i < getExclusionLists().size(); i++) { + try { + joiner.add(String.format("%sexclusionLists%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExclusionLists().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignStats.java new file mode 100644 index 0000000..ac7cda5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCampaignStats.java @@ -0,0 +1,782 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCampaignStats + */ +@JsonPropertyOrder({ + GetCampaignStats.JSON_PROPERTY_LIST_ID, + GetCampaignStats.JSON_PROPERTY_UNIQUE_CLICKS, + GetCampaignStats.JSON_PROPERTY_CLICKERS, + GetCampaignStats.JSON_PROPERTY_COMPLAINTS, + GetCampaignStats.JSON_PROPERTY_DELIVERED, + GetCampaignStats.JSON_PROPERTY_SENT, + GetCampaignStats.JSON_PROPERTY_SOFT_BOUNCES, + GetCampaignStats.JSON_PROPERTY_HARD_BOUNCES, + GetCampaignStats.JSON_PROPERTY_UNIQUE_VIEWS, + GetCampaignStats.JSON_PROPERTY_TRACKABLE_VIEWS, + GetCampaignStats.JSON_PROPERTY_TRACKABLE_VIEWS_RATE, + GetCampaignStats.JSON_PROPERTY_ESTIMATED_VIEWS, + GetCampaignStats.JSON_PROPERTY_UNSUBSCRIPTIONS, + GetCampaignStats.JSON_PROPERTY_VIEWED, + GetCampaignStats.JSON_PROPERTY_DEFERRED, + GetCampaignStats.JSON_PROPERTY_RETURN_BOUNCE +}) +@JsonTypeName("getCampaignStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCampaignStats { + public static final String JSON_PROPERTY_LIST_ID = "listId"; + private Long listId; + + public static final String JSON_PROPERTY_UNIQUE_CLICKS = "uniqueClicks"; + private Long uniqueClicks; + + public static final String JSON_PROPERTY_CLICKERS = "clickers"; + private Long clickers; + + public static final String JSON_PROPERTY_COMPLAINTS = "complaints"; + private Long complaints; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_SENT = "sent"; + private Long sent; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_UNIQUE_VIEWS = "uniqueViews"; + private Long uniqueViews; + + public static final String JSON_PROPERTY_TRACKABLE_VIEWS = "trackableViews"; + private Long trackableViews; + + public static final String JSON_PROPERTY_TRACKABLE_VIEWS_RATE = "trackableViewsRate"; + private Float trackableViewsRate; + + public static final String JSON_PROPERTY_ESTIMATED_VIEWS = "estimatedViews"; + private Long estimatedViews; + + public static final String JSON_PROPERTY_UNSUBSCRIPTIONS = "unsubscriptions"; + private Long unsubscriptions; + + public static final String JSON_PROPERTY_VIEWED = "viewed"; + private Long viewed; + + public static final String JSON_PROPERTY_DEFERRED = "deferred"; + private Long deferred; + + public static final String JSON_PROPERTY_RETURN_BOUNCE = "returnBounce"; + private Long returnBounce; + + public GetCampaignStats() { + } + + public GetCampaignStats listId(Long listId) { + + this.listId = listId; + return this; + } + + /** + * List Id of email campaign (only in case of get email campaign(s)(not for global stats)) + * @return listId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getListId() { + return listId; + } + + + @JsonProperty(JSON_PROPERTY_LIST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListId(Long listId) { + this.listId = listId; + } + + + public GetCampaignStats uniqueClicks(Long uniqueClicks) { + + this.uniqueClicks = uniqueClicks; + return this; + } + + /** + * Number of unique clicks for the campaign + * @return uniqueClicks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueClicks() { + return uniqueClicks; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueClicks(Long uniqueClicks) { + this.uniqueClicks = uniqueClicks; + } + + + public GetCampaignStats clickers(Long clickers) { + + this.clickers = clickers; + return this; + } + + /** + * Number of total clicks for the campaign + * @return clickers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getClickers() { + return clickers; + } + + + @JsonProperty(JSON_PROPERTY_CLICKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClickers(Long clickers) { + this.clickers = clickers; + } + + + public GetCampaignStats complaints(Long complaints) { + + this.complaints = complaints; + return this; + } + + /** + * Number of complaints (Spam reports) for the campaign + * @return complaints + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getComplaints() { + return complaints; + } + + + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setComplaints(Long complaints) { + this.complaints = complaints; + } + + + public GetCampaignStats delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered emails for the campaign + * @return delivered + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetCampaignStats sent(Long sent) { + + this.sent = sent; + return this; + } + + /** + * Number of sent emails for the campaign + * @return sent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSent() { + return sent; + } + + + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSent(Long sent) { + this.sent = sent; + } + + + public GetCampaignStats softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounce for the campaign + * @return softBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetCampaignStats hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of harbounce for the campaign + * @return hardBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetCampaignStats uniqueViews(Long uniqueViews) { + + this.uniqueViews = uniqueViews; + return this; + } + + /** + * Number of unique openings for the campaign + * @return uniqueViews + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueViews() { + return uniqueViews; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueViews(Long uniqueViews) { + this.uniqueViews = uniqueViews; + } + + + public GetCampaignStats trackableViews(Long trackableViews) { + + this.trackableViews = trackableViews; + return this; + } + + /** + * Recipients without any privacy protection option enabled in their email client + * @return trackableViews + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRACKABLE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTrackableViews() { + return trackableViews; + } + + + @JsonProperty(JSON_PROPERTY_TRACKABLE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTrackableViews(Long trackableViews) { + this.trackableViews = trackableViews; + } + + + public GetCampaignStats trackableViewsRate(Float trackableViewsRate) { + + this.trackableViewsRate = trackableViewsRate; + return this; + } + + /** + * Rate of recipients without any privacy protection option enabled in their email client + * @return trackableViewsRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACKABLE_VIEWS_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getTrackableViewsRate() { + return trackableViewsRate; + } + + + @JsonProperty(JSON_PROPERTY_TRACKABLE_VIEWS_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackableViewsRate(Float trackableViewsRate) { + this.trackableViewsRate = trackableViewsRate; + } + + + public GetCampaignStats estimatedViews(Long estimatedViews) { + + this.estimatedViews = estimatedViews; + return this; + } + + /** + * Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails + * @return estimatedViews + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESTIMATED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEstimatedViews() { + return estimatedViews; + } + + + @JsonProperty(JSON_PROPERTY_ESTIMATED_VIEWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEstimatedViews(Long estimatedViews) { + this.estimatedViews = estimatedViews; + } + + + public GetCampaignStats unsubscriptions(Long unsubscriptions) { + + this.unsubscriptions = unsubscriptions; + return this; + } + + /** + * Number of unsubscription for the campaign + * @return unsubscriptions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUnsubscriptions() { + return unsubscriptions; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnsubscriptions(Long unsubscriptions) { + this.unsubscriptions = unsubscriptions; + } + + + public GetCampaignStats viewed(Long viewed) { + + this.viewed = viewed; + return this; + } + + /** + * Number of openings for the campaign + * @return viewed + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VIEWED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getViewed() { + return viewed; + } + + + @JsonProperty(JSON_PROPERTY_VIEWED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setViewed(Long viewed) { + this.viewed = viewed; + } + + + public GetCampaignStats deferred(Long deferred) { + + this.deferred = deferred; + return this; + } + + /** + * Number of deferred emails for the campaign + * @return deferred + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFERRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDeferred() { + return deferred; + } + + + @JsonProperty(JSON_PROPERTY_DEFERRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeferred(Long deferred) { + this.deferred = deferred; + } + + + public GetCampaignStats returnBounce(Long returnBounce) { + + this.returnBounce = returnBounce; + return this; + } + + /** + * Total number of non-delivered campaigns for a particular campaign id. + * @return returnBounce + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReturnBounce() { + return returnBounce; + } + + + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturnBounce(Long returnBounce) { + this.returnBounce = returnBounce; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCampaignStats getCampaignStats = (GetCampaignStats) o; + return Objects.equals(this.listId, getCampaignStats.listId) && + Objects.equals(this.uniqueClicks, getCampaignStats.uniqueClicks) && + Objects.equals(this.clickers, getCampaignStats.clickers) && + Objects.equals(this.complaints, getCampaignStats.complaints) && + Objects.equals(this.delivered, getCampaignStats.delivered) && + Objects.equals(this.sent, getCampaignStats.sent) && + Objects.equals(this.softBounces, getCampaignStats.softBounces) && + Objects.equals(this.hardBounces, getCampaignStats.hardBounces) && + Objects.equals(this.uniqueViews, getCampaignStats.uniqueViews) && + Objects.equals(this.trackableViews, getCampaignStats.trackableViews) && + Objects.equals(this.trackableViewsRate, getCampaignStats.trackableViewsRate) && + Objects.equals(this.estimatedViews, getCampaignStats.estimatedViews) && + Objects.equals(this.unsubscriptions, getCampaignStats.unsubscriptions) && + Objects.equals(this.viewed, getCampaignStats.viewed) && + Objects.equals(this.deferred, getCampaignStats.deferred) && + Objects.equals(this.returnBounce, getCampaignStats.returnBounce); + } + + @Override + public int hashCode() { + return Objects.hash(listId, uniqueClicks, clickers, complaints, delivered, sent, softBounces, hardBounces, uniqueViews, trackableViews, trackableViewsRate, estimatedViews, unsubscriptions, viewed, deferred, returnBounce); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCampaignStats {\n"); + sb.append(" listId: ").append(toIndentedString(listId)).append("\n"); + sb.append(" uniqueClicks: ").append(toIndentedString(uniqueClicks)).append("\n"); + sb.append(" clickers: ").append(toIndentedString(clickers)).append("\n"); + sb.append(" complaints: ").append(toIndentedString(complaints)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" sent: ").append(toIndentedString(sent)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" uniqueViews: ").append(toIndentedString(uniqueViews)).append("\n"); + sb.append(" trackableViews: ").append(toIndentedString(trackableViews)).append("\n"); + sb.append(" trackableViewsRate: ").append(toIndentedString(trackableViewsRate)).append("\n"); + sb.append(" estimatedViews: ").append(toIndentedString(estimatedViews)).append("\n"); + sb.append(" unsubscriptions: ").append(toIndentedString(unsubscriptions)).append("\n"); + sb.append(" viewed: ").append(toIndentedString(viewed)).append("\n"); + sb.append(" deferred: ").append(toIndentedString(deferred)).append("\n"); + sb.append(" returnBounce: ").append(toIndentedString(returnBounce)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `listId` to the URL query string + if (getListId() != null) { + try { + joiner.add(String.format("%slistId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getListId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueClicks` to the URL query string + if (getUniqueClicks() != null) { + try { + joiner.add(String.format("%suniqueClicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clickers` to the URL query string + if (getClickers() != null) { + try { + joiner.add(String.format("%sclickers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClickers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `complaints` to the URL query string + if (getComplaints() != null) { + try { + joiner.add(String.format("%scomplaints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getComplaints()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sent` to the URL query string + if (getSent() != null) { + try { + joiner.add(String.format("%ssent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueViews` to the URL query string + if (getUniqueViews() != null) { + try { + joiner.add(String.format("%suniqueViews%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueViews()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `trackableViews` to the URL query string + if (getTrackableViews() != null) { + try { + joiner.add(String.format("%strackableViews%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTrackableViews()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `trackableViewsRate` to the URL query string + if (getTrackableViewsRate() != null) { + try { + joiner.add(String.format("%strackableViewsRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTrackableViewsRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `estimatedViews` to the URL query string + if (getEstimatedViews() != null) { + try { + joiner.add(String.format("%sestimatedViews%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEstimatedViews()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscriptions` to the URL query string + if (getUnsubscriptions() != null) { + try { + joiner.add(String.format("%sunsubscriptions%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscriptions()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `viewed` to the URL query string + if (getViewed() != null) { + try { + joiner.add(String.format("%sviewed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getViewed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `deferred` to the URL query string + if (getDeferred() != null) { + try { + joiner.add(String.format("%sdeferred%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeferred()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `returnBounce` to the URL query string + if (getReturnBounce() != null) { + try { + joiner.add(String.format("%sreturnBounce%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturnBounce()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategories.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategories.java new file mode 100644 index 0000000..bf99e53 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategories.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetCategoryDetails; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCategories + */ +@JsonPropertyOrder({ + GetCategories.JSON_PROPERTY_CATEGORIES, + GetCategories.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getCategories") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCategories { + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetCategories() { + } + + public GetCategories categories(List categories) { + + this.categories = categories; + return this; + } + + public GetCategories addCategoriesItem(GetCategoryDetails categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Get categories + * @return categories + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public GetCategories count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of categories + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCategories getCategories = (GetCategories) o; + return Objects.equals(this.categories, getCategories.categories) && + Objects.equals(this.count, getCategories.count); + } + + @Override + public int hashCode() { + return Objects.hash(categories, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCategories {\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + if (getCategories().get(i) != null) { + joiner.add(getCategories().get(i).toUrlQueryString(String.format("%scategories%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategoryDetails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategoryDetails.java new file mode 100644 index 0000000..ddeb549 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCategoryDetails.java @@ -0,0 +1,362 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCategoryDetails + */ +@JsonPropertyOrder({ + GetCategoryDetails.JSON_PROPERTY_ID, + GetCategoryDetails.JSON_PROPERTY_NAME, + GetCategoryDetails.JSON_PROPERTY_CREATED_AT, + GetCategoryDetails.JSON_PROPERTY_MODIFIED_AT, + GetCategoryDetails.JSON_PROPERTY_URL, + GetCategoryDetails.JSON_PROPERTY_IS_DELETED +}) +@JsonTypeName("getCategoryDetails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCategoryDetails { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_IS_DELETED = "isDeleted"; + private Boolean isDeleted; + + public GetCategoryDetails() { + } + + public GetCategoryDetails id(String id) { + + this.id = id; + return this; + } + + /** + * Category ID for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public GetCategoryDetails name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the category for which you requested the details + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetCategoryDetails createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetCategoryDetails modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetCategoryDetails url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the category + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public GetCategoryDetails isDeleted(Boolean isDeleted) { + + this.isDeleted = isDeleted; + return this; + } + + /** + * category deleted from the shop's database + * @return isDeleted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DELETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsDeleted() { + return isDeleted; + } + + + @JsonProperty(JSON_PROPERTY_IS_DELETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeleted(Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCategoryDetails getCategoryDetails = (GetCategoryDetails) o; + return Objects.equals(this.id, getCategoryDetails.id) && + Objects.equals(this.name, getCategoryDetails.name) && + Objects.equals(this.createdAt, getCategoryDetails.createdAt) && + Objects.equals(this.modifiedAt, getCategoryDetails.modifiedAt) && + Objects.equals(this.url, getCategoryDetails.url) && + Objects.equals(this.isDeleted, getCategoryDetails.isDeleted); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, createdAt, modifiedAt, url, isDeleted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCategoryDetails {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isDeleted` to the URL query string + if (getIsDeleted() != null) { + try { + joiner.add(String.format("%sisDeleted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsDeleted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildAccountCreationStatus.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildAccountCreationStatus.java new file mode 100644 index 0000000..9a9c251 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildAccountCreationStatus.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildAccountCreationStatus + */ +@JsonPropertyOrder({ + GetChildAccountCreationStatus.JSON_PROPERTY_CHILD_ACCOUNT_CREATED +}) +@JsonTypeName("getChildAccountCreationStatus") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildAccountCreationStatus { + public static final String JSON_PROPERTY_CHILD_ACCOUNT_CREATED = "childAccountCreated"; + private Boolean childAccountCreated; + + public GetChildAccountCreationStatus() { + } + + public GetChildAccountCreationStatus childAccountCreated(Boolean childAccountCreated) { + + this.childAccountCreated = childAccountCreated; + return this; + } + + /** + * Status of child account creation whether it is successfully created (exists) or not. + * @return childAccountCreated + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CHILD_ACCOUNT_CREATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getChildAccountCreated() { + return childAccountCreated; + } + + + @JsonProperty(JSON_PROPERTY_CHILD_ACCOUNT_CREATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setChildAccountCreated(Boolean childAccountCreated) { + this.childAccountCreated = childAccountCreated; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildAccountCreationStatus getChildAccountCreationStatus = (GetChildAccountCreationStatus) o; + return Objects.equals(this.childAccountCreated, getChildAccountCreationStatus.childAccountCreated); + } + + @Override + public int hashCode() { + return Objects.hash(childAccountCreated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildAccountCreationStatus {\n"); + sb.append(" childAccountCreated: ").append(toIndentedString(childAccountCreated)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `childAccountCreated` to the URL query string + if (getChildAccountCreated() != null) { + try { + joiner.add(String.format("%schildAccountCreated%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getChildAccountCreated()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildDomain.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildDomain.java new file mode 100644 index 0000000..e34e820 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildDomain.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildDomain + */ +@JsonPropertyOrder({ + GetChildDomain.JSON_PROPERTY_DOMAIN, + GetChildDomain.JSON_PROPERTY_ACTIVE +}) +@JsonTypeName("getChildDomain") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildDomain { + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_ACTIVE = "active"; + private Boolean active; + + public GetChildDomain() { + } + + public GetChildDomain domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Sender domain + * @return domain + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public GetChildDomain active(Boolean active) { + + this.active = active; + return this; + } + + /** + * indicates whether a domain is verified or not + * @return active + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getActive() { + return active; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActive(Boolean active) { + this.active = active; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildDomain getChildDomain = (GetChildDomain) o; + return Objects.equals(this.domain, getChildDomain.domain) && + Objects.equals(this.active, getChildDomain.active); + } + + @Override + public int hashCode() { + return Objects.hash(domain, active); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildDomain {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `active` to the URL query string + if (getActive() != null) { + try { + joiner.add(String.format("%sactive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfo.java new file mode 100644 index 0000000..cd043de --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfo.java @@ -0,0 +1,491 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetChildInfoAllOfApiKeys; +import software.xdev.brevo.model.GetChildInfoAllOfCredits; +import software.xdev.brevo.model.GetChildInfoAllOfStatistics; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildInfo + */ +@JsonPropertyOrder({ + GetChildInfo.JSON_PROPERTY_EMAIL, + GetChildInfo.JSON_PROPERTY_FIRST_NAME, + GetChildInfo.JSON_PROPERTY_LAST_NAME, + GetChildInfo.JSON_PROPERTY_COMPANY_NAME, + GetChildInfo.JSON_PROPERTY_CREDITS, + GetChildInfo.JSON_PROPERTY_STATISTICS, + GetChildInfo.JSON_PROPERTY_PASSWORD, + GetChildInfo.JSON_PROPERTY_IPS, + GetChildInfo.JSON_PROPERTY_API_KEYS +}) +@JsonTypeName("getChildInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfo { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_CREDITS = "credits"; + private GetChildInfoAllOfCredits credits; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetChildInfoAllOfStatistics statistics; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips; + + public static final String JSON_PROPERTY_API_KEYS = "apiKeys"; + private GetChildInfoAllOfApiKeys apiKeys; + + public GetChildInfo() { + } + + public GetChildInfo email(String email) { + + this.email = email; + return this; + } + + /** + * Login Email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetChildInfo firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First Name + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public GetChildInfo lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last Name + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public GetChildInfo companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public GetChildInfo credits(GetChildInfoAllOfCredits credits) { + + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfCredits getCredits() { + return credits; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredits(GetChildInfoAllOfCredits credits) { + this.credits = credits; + } + + + public GetChildInfo statistics(GetChildInfoAllOfStatistics statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfStatistics getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatistics(GetChildInfoAllOfStatistics statistics) { + this.statistics = statistics; + } + + + public GetChildInfo password(String password) { + + this.password = password; + return this; + } + + /** + * The encrypted password of child account + * @return password + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + + public GetChildInfo ips(List ips) { + + this.ips = ips; + return this; + } + + public GetChildInfo addIpsItem(String ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * IP(s) associated to a child account user + * @return ips + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIps(List ips) { + this.ips = ips; + } + + + public GetChildInfo apiKeys(GetChildInfoAllOfApiKeys apiKeys) { + + this.apiKeys = apiKeys; + return this; + } + + /** + * Get apiKeys + * @return apiKeys + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfApiKeys getApiKeys() { + return apiKeys; + } + + + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKeys(GetChildInfoAllOfApiKeys apiKeys) { + this.apiKeys = apiKeys; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfo getChildInfo = (GetChildInfo) o; + return Objects.equals(this.email, getChildInfo.email) && + Objects.equals(this.firstName, getChildInfo.firstName) && + Objects.equals(this.lastName, getChildInfo.lastName) && + Objects.equals(this.companyName, getChildInfo.companyName) && + Objects.equals(this.credits, getChildInfo.credits) && + Objects.equals(this.statistics, getChildInfo.statistics) && + Objects.equals(this.password, getChildInfo.password) && + Objects.equals(this.ips, getChildInfo.ips) && + Objects.equals(this.apiKeys, getChildInfo.apiKeys); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, credits, statistics, password, ips, apiKeys); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfo {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" ips: ").append(toIndentedString(ips)).append("\n"); + sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credits` to the URL query string + if (getCredits() != null) { + joiner.add(getCredits().toUrlQueryString(prefix + "credits" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + try { + joiner.add(String.format("%sips%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIps().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `apiKeys` to the URL query string + if (getApiKeys() != null) { + joiner.add(getApiKeys().toUrlQueryString(prefix + "apiKeys" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeys.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeys.java new file mode 100644 index 0000000..a4957cb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeys.java @@ -0,0 +1,215 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetChildInfoAllOfApiKeysV2; +import software.xdev.brevo.model.GetChildInfoAllOfApiKeysV3; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * API Keys associated to child account + */ +@JsonPropertyOrder({ + GetChildInfoAllOfApiKeys.JSON_PROPERTY_V2, + GetChildInfoAllOfApiKeys.JSON_PROPERTY_V3 +}) +@JsonTypeName("getChildInfo_allOf_apiKeys") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfoAllOfApiKeys { + public static final String JSON_PROPERTY_V2 = "v2"; + private List v2 = new ArrayList<>(); + + public static final String JSON_PROPERTY_V3 = "v3"; + private List v3; + + public GetChildInfoAllOfApiKeys() { + } + + public GetChildInfoAllOfApiKeys v2(List v2) { + + this.v2 = v2; + return this; + } + + public GetChildInfoAllOfApiKeys addV2Item(GetChildInfoAllOfApiKeysV2 v2Item) { + if (this.v2 == null) { + this.v2 = new ArrayList<>(); + } + this.v2.add(v2Item); + return this; + } + + /** + * Get v2 + * @return v2 + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_V2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getV2() { + return v2; + } + + + @JsonProperty(JSON_PROPERTY_V2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setV2(List v2) { + this.v2 = v2; + } + + + public GetChildInfoAllOfApiKeys v3(List v3) { + + this.v3 = v3; + return this; + } + + public GetChildInfoAllOfApiKeys addV3Item(GetChildInfoAllOfApiKeysV3 v3Item) { + if (this.v3 == null) { + this.v3 = new ArrayList<>(); + } + this.v3.add(v3Item); + return this; + } + + /** + * Get v3 + * @return v3 + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_V3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getV3() { + return v3; + } + + + @JsonProperty(JSON_PROPERTY_V3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setV3(List v3) { + this.v3 = v3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfoAllOfApiKeys getChildInfoAllOfApiKeys = (GetChildInfoAllOfApiKeys) o; + return Objects.equals(this.v2, getChildInfoAllOfApiKeys.v2) && + Objects.equals(this.v3, getChildInfoAllOfApiKeys.v3); + } + + @Override + public int hashCode() { + return Objects.hash(v2, v3); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfoAllOfApiKeys {\n"); + sb.append(" v2: ").append(toIndentedString(v2)).append("\n"); + sb.append(" v3: ").append(toIndentedString(v3)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `v2` to the URL query string + if (getV2() != null) { + for (int i = 0; i < getV2().size(); i++) { + if (getV2().get(i) != null) { + joiner.add(getV2().get(i).toUrlQueryString(String.format("%sv2%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `v3` to the URL query string + if (getV3() != null) { + for (int i = 0; i < getV3().size(); i++) { + if (getV3().get(i) != null) { + joiner.add(getV3().get(i).toUrlQueryString(String.format("%sv3%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV2.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV2.java new file mode 100644 index 0000000..c209072 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV2.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildInfoAllOfApiKeysV2 + */ +@JsonPropertyOrder({ + GetChildInfoAllOfApiKeysV2.JSON_PROPERTY_NAME, + GetChildInfoAllOfApiKeysV2.JSON_PROPERTY_KEY +}) +@JsonTypeName("getChildInfo_allOf_apiKeys_v2") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfoAllOfApiKeysV2 { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public GetChildInfoAllOfApiKeysV2() { + } + + public GetChildInfoAllOfApiKeysV2 name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the key for version 2 + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetChildInfoAllOfApiKeysV2 key(String key) { + + this.key = key; + return this; + } + + /** + * API Key for version 2 + * @return key + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setKey(String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfoAllOfApiKeysV2 getChildInfoAllOfApiKeysV2 = (GetChildInfoAllOfApiKeysV2) o; + return Objects.equals(this.name, getChildInfoAllOfApiKeysV2.name) && + Objects.equals(this.key, getChildInfoAllOfApiKeysV2.key); + } + + @Override + public int hashCode() { + return Objects.hash(name, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfoAllOfApiKeysV2 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `key` to the URL query string + if (getKey() != null) { + try { + joiner.add(String.format("%skey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKey()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV3.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV3.java new file mode 100644 index 0000000..a080eef --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfApiKeysV3.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildInfoAllOfApiKeysV3 + */ +@JsonPropertyOrder({ + GetChildInfoAllOfApiKeysV3.JSON_PROPERTY_NAME, + GetChildInfoAllOfApiKeysV3.JSON_PROPERTY_KEY +}) +@JsonTypeName("getChildInfo_allOf_apiKeys_v3") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfoAllOfApiKeysV3 { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public GetChildInfoAllOfApiKeysV3() { + } + + public GetChildInfoAllOfApiKeysV3 name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the key for version 3 + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetChildInfoAllOfApiKeysV3 key(String key) { + + this.key = key; + return this; + } + + /** + * API Key for version 3 + * @return key + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setKey(String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfoAllOfApiKeysV3 getChildInfoAllOfApiKeysV3 = (GetChildInfoAllOfApiKeysV3) o; + return Objects.equals(this.name, getChildInfoAllOfApiKeysV3.name) && + Objects.equals(this.key, getChildInfoAllOfApiKeysV3.key); + } + + @Override + public int hashCode() { + return Objects.hash(name, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfoAllOfApiKeysV3 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `key` to the URL query string + if (getKey() != null) { + try { + joiner.add(String.format("%skey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKey()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfCredits.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfCredits.java new file mode 100644 index 0000000..b4c08f2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfCredits.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Credits available for your child + */ +@JsonPropertyOrder({ + GetChildInfoAllOfCredits.JSON_PROPERTY_EMAIL_CREDITS, + GetChildInfoAllOfCredits.JSON_PROPERTY_SMS_CREDITS +}) +@JsonTypeName("getChildInfo_allOf_credits") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfoAllOfCredits { + public static final String JSON_PROPERTY_EMAIL_CREDITS = "emailCredits"; + private Long emailCredits; + + public static final String JSON_PROPERTY_SMS_CREDITS = "smsCredits"; + private Long smsCredits; + + public GetChildInfoAllOfCredits() { + } + + public GetChildInfoAllOfCredits emailCredits(Long emailCredits) { + + this.emailCredits = emailCredits; + return this; + } + + /** + * Email credits available for your child + * @return emailCredits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEmailCredits() { + return emailCredits; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailCredits(Long emailCredits) { + this.emailCredits = emailCredits; + } + + + public GetChildInfoAllOfCredits smsCredits(Long smsCredits) { + + this.smsCredits = smsCredits; + return this; + } + + /** + * SMS credits available for your child + * @return smsCredits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSmsCredits() { + return smsCredits; + } + + + @JsonProperty(JSON_PROPERTY_SMS_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsCredits(Long smsCredits) { + this.smsCredits = smsCredits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfoAllOfCredits getChildInfoAllOfCredits = (GetChildInfoAllOfCredits) o; + return Objects.equals(this.emailCredits, getChildInfoAllOfCredits.emailCredits) && + Objects.equals(this.smsCredits, getChildInfoAllOfCredits.smsCredits); + } + + @Override + public int hashCode() { + return Objects.hash(emailCredits, smsCredits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfoAllOfCredits {\n"); + sb.append(" emailCredits: ").append(toIndentedString(emailCredits)).append("\n"); + sb.append(" smsCredits: ").append(toIndentedString(smsCredits)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emailCredits` to the URL query string + if (getEmailCredits() != null) { + try { + joiner.add(String.format("%semailCredits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailCredits()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsCredits` to the URL query string + if (getSmsCredits() != null) { + try { + joiner.add(String.format("%ssmsCredits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsCredits()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfStatistics.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfStatistics.java new file mode 100644 index 0000000..0579888 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildInfoAllOfStatistics.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Statistics about your child account activity + */ +@JsonPropertyOrder({ + GetChildInfoAllOfStatistics.JSON_PROPERTY_PREVIOUS_MONTH_TOTAL_SENT, + GetChildInfoAllOfStatistics.JSON_PROPERTY_CURRENT_MONTH_TOTAL_SENT, + GetChildInfoAllOfStatistics.JSON_PROPERTY_TOTAL_SENT +}) +@JsonTypeName("getChildInfo_allOf_statistics") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildInfoAllOfStatistics { + public static final String JSON_PROPERTY_PREVIOUS_MONTH_TOTAL_SENT = "previousMonthTotalSent"; + private Long previousMonthTotalSent; + + public static final String JSON_PROPERTY_CURRENT_MONTH_TOTAL_SENT = "currentMonthTotalSent"; + private Long currentMonthTotalSent; + + public static final String JSON_PROPERTY_TOTAL_SENT = "totalSent"; + private Long totalSent; + + public GetChildInfoAllOfStatistics() { + } + + public GetChildInfoAllOfStatistics previousMonthTotalSent(Long previousMonthTotalSent) { + + this.previousMonthTotalSent = previousMonthTotalSent; + return this; + } + + /** + * Overall emails sent for the previous month + * @return previousMonthTotalSent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIOUS_MONTH_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPreviousMonthTotalSent() { + return previousMonthTotalSent; + } + + + @JsonProperty(JSON_PROPERTY_PREVIOUS_MONTH_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviousMonthTotalSent(Long previousMonthTotalSent) { + this.previousMonthTotalSent = previousMonthTotalSent; + } + + + public GetChildInfoAllOfStatistics currentMonthTotalSent(Long currentMonthTotalSent) { + + this.currentMonthTotalSent = currentMonthTotalSent; + return this; + } + + /** + * Overall emails sent for current month + * @return currentMonthTotalSent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_MONTH_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCurrentMonthTotalSent() { + return currentMonthTotalSent; + } + + + @JsonProperty(JSON_PROPERTY_CURRENT_MONTH_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentMonthTotalSent(Long currentMonthTotalSent) { + this.currentMonthTotalSent = currentMonthTotalSent; + } + + + public GetChildInfoAllOfStatistics totalSent(Long totalSent) { + + this.totalSent = totalSent; + return this; + } + + /** + * Overall emails sent for since the account exists + * @return totalSent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTotalSent() { + return totalSent; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalSent(Long totalSent) { + this.totalSent = totalSent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildInfoAllOfStatistics getChildInfoAllOfStatistics = (GetChildInfoAllOfStatistics) o; + return Objects.equals(this.previousMonthTotalSent, getChildInfoAllOfStatistics.previousMonthTotalSent) && + Objects.equals(this.currentMonthTotalSent, getChildInfoAllOfStatistics.currentMonthTotalSent) && + Objects.equals(this.totalSent, getChildInfoAllOfStatistics.totalSent); + } + + @Override + public int hashCode() { + return Objects.hash(previousMonthTotalSent, currentMonthTotalSent, totalSent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildInfoAllOfStatistics {\n"); + sb.append(" previousMonthTotalSent: ").append(toIndentedString(previousMonthTotalSent)).append("\n"); + sb.append(" currentMonthTotalSent: ").append(toIndentedString(currentMonthTotalSent)).append("\n"); + sb.append(" totalSent: ").append(toIndentedString(totalSent)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `previousMonthTotalSent` to the URL query string + if (getPreviousMonthTotalSent() != null) { + try { + joiner.add(String.format("%spreviousMonthTotalSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviousMonthTotalSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `currentMonthTotalSent` to the URL query string + if (getCurrentMonthTotalSent() != null) { + try { + joiner.add(String.format("%scurrentMonthTotalSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCurrentMonthTotalSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalSent` to the URL query string + if (getTotalSent() != null) { + try { + joiner.add(String.format("%stotalSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenList.java new file mode 100644 index 0000000..0265fa4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenList.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetChildrenListChildrenInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildrenList + */ +@JsonPropertyOrder({ + GetChildrenList.JSON_PROPERTY_CHILDREN, + GetChildrenList.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getChildrenList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildrenList { + public static final String JSON_PROPERTY_CHILDREN = "children"; + private List children; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetChildrenList() { + } + + public GetChildrenList children(List children) { + + this.children = children; + return this; + } + + public GetChildrenList addChildrenItem(GetChildrenListChildrenInner childrenItem) { + if (this.children == null) { + this.children = new ArrayList<>(); + } + this.children.add(childrenItem); + return this; + } + + /** + * Your children's account information + * @return children + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHILDREN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getChildren() { + return children; + } + + + @JsonProperty(JSON_PROPERTY_CHILDREN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChildren(List children) { + this.children = children; + } + + + public GetChildrenList count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of child accounts + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildrenList getChildrenList = (GetChildrenList) o; + return Objects.equals(this.children, getChildrenList.children) && + Objects.equals(this.count, getChildrenList.count); + } + + @Override + public int hashCode() { + return Objects.hash(children, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildrenList {\n"); + sb.append(" children: ").append(toIndentedString(children)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `children` to the URL query string + if (getChildren() != null) { + for (int i = 0; i < getChildren().size(); i++) { + if (getChildren().get(i) != null) { + joiner.add(getChildren().get(i).toUrlQueryString(String.format("%schildren%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenListChildrenInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenListChildrenInner.java new file mode 100644 index 0000000..9ff38e6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetChildrenListChildrenInner.java @@ -0,0 +1,533 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetChildInfoAllOfApiKeys; +import software.xdev.brevo.model.GetChildInfoAllOfCredits; +import software.xdev.brevo.model.GetChildInfoAllOfStatistics; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetChildrenListChildrenInner + */ +@JsonPropertyOrder({ + GetChildrenListChildrenInner.JSON_PROPERTY_EMAIL, + GetChildrenListChildrenInner.JSON_PROPERTY_FIRST_NAME, + GetChildrenListChildrenInner.JSON_PROPERTY_LAST_NAME, + GetChildrenListChildrenInner.JSON_PROPERTY_COMPANY_NAME, + GetChildrenListChildrenInner.JSON_PROPERTY_CREDITS, + GetChildrenListChildrenInner.JSON_PROPERTY_STATISTICS, + GetChildrenListChildrenInner.JSON_PROPERTY_PASSWORD, + GetChildrenListChildrenInner.JSON_PROPERTY_IPS, + GetChildrenListChildrenInner.JSON_PROPERTY_API_KEYS, + GetChildrenListChildrenInner.JSON_PROPERTY_ID +}) +@JsonTypeName("getChildrenList_children_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetChildrenListChildrenInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_CREDITS = "credits"; + private GetChildInfoAllOfCredits credits; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetChildInfoAllOfStatistics statistics; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips; + + public static final String JSON_PROPERTY_API_KEYS = "apiKeys"; + private GetChildInfoAllOfApiKeys apiKeys; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public GetChildrenListChildrenInner() { + } + + public GetChildrenListChildrenInner email(String email) { + + this.email = email; + return this; + } + + /** + * Login Email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetChildrenListChildrenInner firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First Name + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public GetChildrenListChildrenInner lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last Name + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public GetChildrenListChildrenInner companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public GetChildrenListChildrenInner credits(GetChildInfoAllOfCredits credits) { + + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfCredits getCredits() { + return credits; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredits(GetChildInfoAllOfCredits credits) { + this.credits = credits; + } + + + public GetChildrenListChildrenInner statistics(GetChildInfoAllOfStatistics statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfStatistics getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatistics(GetChildInfoAllOfStatistics statistics) { + this.statistics = statistics; + } + + + public GetChildrenListChildrenInner password(String password) { + + this.password = password; + return this; + } + + /** + * The encrypted password of child account + * @return password + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + + public GetChildrenListChildrenInner ips(List ips) { + + this.ips = ips; + return this; + } + + public GetChildrenListChildrenInner addIpsItem(String ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * IP(s) associated to a child account user + * @return ips + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIps(List ips) { + this.ips = ips; + } + + + public GetChildrenListChildrenInner apiKeys(GetChildInfoAllOfApiKeys apiKeys) { + + this.apiKeys = apiKeys; + return this; + } + + /** + * Get apiKeys + * @return apiKeys + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetChildInfoAllOfApiKeys getApiKeys() { + return apiKeys; + } + + + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKeys(GetChildInfoAllOfApiKeys apiKeys) { + this.apiKeys = apiKeys; + } + + + public GetChildrenListChildrenInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the child + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetChildrenListChildrenInner getChildrenListChildrenInner = (GetChildrenListChildrenInner) o; + return Objects.equals(this.email, getChildrenListChildrenInner.email) && + Objects.equals(this.firstName, getChildrenListChildrenInner.firstName) && + Objects.equals(this.lastName, getChildrenListChildrenInner.lastName) && + Objects.equals(this.companyName, getChildrenListChildrenInner.companyName) && + Objects.equals(this.credits, getChildrenListChildrenInner.credits) && + Objects.equals(this.statistics, getChildrenListChildrenInner.statistics) && + Objects.equals(this.password, getChildrenListChildrenInner.password) && + Objects.equals(this.ips, getChildrenListChildrenInner.ips) && + Objects.equals(this.apiKeys, getChildrenListChildrenInner.apiKeys) && + Objects.equals(this.id, getChildrenListChildrenInner.id); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, credits, statistics, password, ips, apiKeys, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetChildrenListChildrenInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" ips: ").append(toIndentedString(ips)).append("\n"); + sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credits` to the URL query string + if (getCredits() != null) { + joiner.add(getCredits().toUrlQueryString(prefix + "credits" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + try { + joiner.add(String.format("%sips%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIps().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `apiKeys` to the URL query string + if (getApiKeys() != null) { + joiner.add(getApiKeys().toUrlQueryString(prefix + "apiKeys" + suffix)); + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetClient.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetClient.java new file mode 100644 index 0000000..60747a7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetClient.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetClient + */ +@JsonPropertyOrder({ + GetClient.JSON_PROPERTY_EMAIL, + GetClient.JSON_PROPERTY_FIRST_NAME, + GetClient.JSON_PROPERTY_LAST_NAME, + GetClient.JSON_PROPERTY_COMPANY_NAME +}) +@JsonTypeName("getClient") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetClient { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public GetClient() { + } + + public GetClient email(String email) { + + this.email = email; + return this; + } + + /** + * Login Email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetClient firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First Name + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public GetClient lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last Name + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public GetClient companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetClient getClient = (GetClient) o; + return Objects.equals(this.email, getClient.email) && + Objects.equals(this.firstName, getClient.firstName) && + Objects.equals(this.lastName, getClient.lastName) && + Objects.equals(this.companyName, getClient.companyName); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetClient {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStats.java new file mode 100644 index 0000000..e46005c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStats.java @@ -0,0 +1,555 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetContactCampaignStatsClickedInner; +import software.xdev.brevo.model.GetContactCampaignStatsOpenedInner; +import software.xdev.brevo.model.GetContactCampaignStatsTransacAttributesInner; +import software.xdev.brevo.model.GetContactCampaignStatsUnsubscriptions; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsMessagesSent; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Campaign Statistics for the contact + */ +@JsonPropertyOrder({ + GetContactCampaignStats.JSON_PROPERTY_MESSAGES_SENT, + GetContactCampaignStats.JSON_PROPERTY_HARD_BOUNCES, + GetContactCampaignStats.JSON_PROPERTY_SOFT_BOUNCES, + GetContactCampaignStats.JSON_PROPERTY_COMPLAINTS, + GetContactCampaignStats.JSON_PROPERTY_UNSUBSCRIPTIONS, + GetContactCampaignStats.JSON_PROPERTY_OPENED, + GetContactCampaignStats.JSON_PROPERTY_CLICKED, + GetContactCampaignStats.JSON_PROPERTY_TRANSAC_ATTRIBUTES, + GetContactCampaignStats.JSON_PROPERTY_DELIVERED +}) +@JsonTypeName("getContactCampaignStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactCampaignStats { + public static final String JSON_PROPERTY_MESSAGES_SENT = "messagesSent"; + private List messagesSent; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private List hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private List softBounces; + + public static final String JSON_PROPERTY_COMPLAINTS = "complaints"; + private List complaints; + + public static final String JSON_PROPERTY_UNSUBSCRIPTIONS = "unsubscriptions"; + private GetContactCampaignStatsUnsubscriptions unsubscriptions; + + public static final String JSON_PROPERTY_OPENED = "opened"; + private List opened; + + public static final String JSON_PROPERTY_CLICKED = "clicked"; + private List clicked; + + public static final String JSON_PROPERTY_TRANSAC_ATTRIBUTES = "transacAttributes"; + private List transacAttributes; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private List delivered; + + public GetContactCampaignStats() { + } + + public GetContactCampaignStats messagesSent(List messagesSent) { + + this.messagesSent = messagesSent; + return this; + } + + public GetContactCampaignStats addMessagesSentItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent messagesSentItem) { + if (this.messagesSent == null) { + this.messagesSent = new ArrayList<>(); + } + this.messagesSent.add(messagesSentItem); + return this; + } + + /** + * Get messagesSent + * @return messagesSent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMessagesSent() { + return messagesSent; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessagesSent(List messagesSent) { + this.messagesSent = messagesSent; + } + + + public GetContactCampaignStats hardBounces(List hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + public GetContactCampaignStats addHardBouncesItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent hardBouncesItem) { + if (this.hardBounces == null) { + this.hardBounces = new ArrayList<>(); + } + this.hardBounces.add(hardBouncesItem); + return this; + } + + /** + * Get hardBounces + * @return hardBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardBounces(List hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetContactCampaignStats softBounces(List softBounces) { + + this.softBounces = softBounces; + return this; + } + + public GetContactCampaignStats addSoftBouncesItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent softBouncesItem) { + if (this.softBounces == null) { + this.softBounces = new ArrayList<>(); + } + this.softBounces.add(softBouncesItem); + return this; + } + + /** + * Get softBounces + * @return softBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftBounces(List softBounces) { + this.softBounces = softBounces; + } + + + public GetContactCampaignStats complaints(List complaints) { + + this.complaints = complaints; + return this; + } + + public GetContactCampaignStats addComplaintsItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent complaintsItem) { + if (this.complaints == null) { + this.complaints = new ArrayList<>(); + } + this.complaints.add(complaintsItem); + return this; + } + + /** + * Get complaints + * @return complaints + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getComplaints() { + return complaints; + } + + + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplaints(List complaints) { + this.complaints = complaints; + } + + + public GetContactCampaignStats unsubscriptions(GetContactCampaignStatsUnsubscriptions unsubscriptions) { + + this.unsubscriptions = unsubscriptions; + return this; + } + + /** + * Get unsubscriptions + * @return unsubscriptions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetContactCampaignStatsUnsubscriptions getUnsubscriptions() { + return unsubscriptions; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscriptions(GetContactCampaignStatsUnsubscriptions unsubscriptions) { + this.unsubscriptions = unsubscriptions; + } + + + public GetContactCampaignStats opened(List opened) { + + this.opened = opened; + return this; + } + + public GetContactCampaignStats addOpenedItem(GetContactCampaignStatsOpenedInner openedItem) { + if (this.opened == null) { + this.opened = new ArrayList<>(); + } + this.opened.add(openedItem); + return this; + } + + /** + * Get opened + * @return opened + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPENED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getOpened() { + return opened; + } + + + @JsonProperty(JSON_PROPERTY_OPENED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpened(List opened) { + this.opened = opened; + } + + + public GetContactCampaignStats clicked(List clicked) { + + this.clicked = clicked; + return this; + } + + public GetContactCampaignStats addClickedItem(GetContactCampaignStatsClickedInner clickedItem) { + if (this.clicked == null) { + this.clicked = new ArrayList<>(); + } + this.clicked.add(clickedItem); + return this; + } + + /** + * Get clicked + * @return clicked + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLICKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getClicked() { + return clicked; + } + + + @JsonProperty(JSON_PROPERTY_CLICKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClicked(List clicked) { + this.clicked = clicked; + } + + + public GetContactCampaignStats transacAttributes(List transacAttributes) { + + this.transacAttributes = transacAttributes; + return this; + } + + public GetContactCampaignStats addTransacAttributesItem(GetContactCampaignStatsTransacAttributesInner transacAttributesItem) { + if (this.transacAttributes == null) { + this.transacAttributes = new ArrayList<>(); + } + this.transacAttributes.add(transacAttributesItem); + return this; + } + + /** + * Get transacAttributes + * @return transacAttributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSAC_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTransacAttributes() { + return transacAttributes; + } + + + @JsonProperty(JSON_PROPERTY_TRANSAC_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransacAttributes(List transacAttributes) { + this.transacAttributes = transacAttributes; + } + + + public GetContactCampaignStats delivered(List delivered) { + + this.delivered = delivered; + return this; + } + + public GetContactCampaignStats addDeliveredItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent deliveredItem) { + if (this.delivered == null) { + this.delivered = new ArrayList<>(); + } + this.delivered.add(deliveredItem); + return this; + } + + /** + * Get delivered + * @return delivered + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelivered(List delivered) { + this.delivered = delivered; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactCampaignStats getContactCampaignStats = (GetContactCampaignStats) o; + return Objects.equals(this.messagesSent, getContactCampaignStats.messagesSent) && + Objects.equals(this.hardBounces, getContactCampaignStats.hardBounces) && + Objects.equals(this.softBounces, getContactCampaignStats.softBounces) && + Objects.equals(this.complaints, getContactCampaignStats.complaints) && + Objects.equals(this.unsubscriptions, getContactCampaignStats.unsubscriptions) && + Objects.equals(this.opened, getContactCampaignStats.opened) && + Objects.equals(this.clicked, getContactCampaignStats.clicked) && + Objects.equals(this.transacAttributes, getContactCampaignStats.transacAttributes) && + Objects.equals(this.delivered, getContactCampaignStats.delivered); + } + + @Override + public int hashCode() { + return Objects.hash(messagesSent, hardBounces, softBounces, complaints, unsubscriptions, opened, clicked, transacAttributes, delivered); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactCampaignStats {\n"); + sb.append(" messagesSent: ").append(toIndentedString(messagesSent)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" complaints: ").append(toIndentedString(complaints)).append("\n"); + sb.append(" unsubscriptions: ").append(toIndentedString(unsubscriptions)).append("\n"); + sb.append(" opened: ").append(toIndentedString(opened)).append("\n"); + sb.append(" clicked: ").append(toIndentedString(clicked)).append("\n"); + sb.append(" transacAttributes: ").append(toIndentedString(transacAttributes)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `messagesSent` to the URL query string + if (getMessagesSent() != null) { + for (int i = 0; i < getMessagesSent().size(); i++) { + if (getMessagesSent().get(i) != null) { + joiner.add(getMessagesSent().get(i).toUrlQueryString(String.format("%smessagesSent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + for (int i = 0; i < getHardBounces().size(); i++) { + if (getHardBounces().get(i) != null) { + joiner.add(getHardBounces().get(i).toUrlQueryString(String.format("%shardBounces%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + for (int i = 0; i < getSoftBounces().size(); i++) { + if (getSoftBounces().get(i) != null) { + joiner.add(getSoftBounces().get(i).toUrlQueryString(String.format("%ssoftBounces%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `complaints` to the URL query string + if (getComplaints() != null) { + for (int i = 0; i < getComplaints().size(); i++) { + if (getComplaints().get(i) != null) { + joiner.add(getComplaints().get(i).toUrlQueryString(String.format("%scomplaints%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `unsubscriptions` to the URL query string + if (getUnsubscriptions() != null) { + joiner.add(getUnsubscriptions().toUrlQueryString(prefix + "unsubscriptions" + suffix)); + } + + // add `opened` to the URL query string + if (getOpened() != null) { + for (int i = 0; i < getOpened().size(); i++) { + if (getOpened().get(i) != null) { + joiner.add(getOpened().get(i).toUrlQueryString(String.format("%sopened%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `clicked` to the URL query string + if (getClicked() != null) { + for (int i = 0; i < getClicked().size(); i++) { + if (getClicked().get(i) != null) { + joiner.add(getClicked().get(i).toUrlQueryString(String.format("%sclicked%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `transacAttributes` to the URL query string + if (getTransacAttributes() != null) { + for (int i = 0; i < getTransacAttributes().size(); i++) { + if (getTransacAttributes().get(i) != null) { + joiner.add(getTransacAttributes().get(i).toUrlQueryString(String.format("%stransacAttributes%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + for (int i = 0; i < getDelivered().size(); i++) { + if (getDelivered().get(i) != null) { + joiner.add(getDelivered().get(i).toUrlQueryString(String.format("%sdelivered%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsClickedInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsClickedInner.java new file mode 100644 index 0000000..85826ca --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsClickedInner.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsLinks; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactCampaignStatsClickedInner + */ +@JsonPropertyOrder({ + GetContactCampaignStatsClickedInner.JSON_PROPERTY_CAMPAIGN_ID, + GetContactCampaignStatsClickedInner.JSON_PROPERTY_LINKS +}) +@JsonTypeName("getContactCampaignStats_clicked_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactCampaignStatsClickedInner { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = new ArrayList<>(); + + public GetContactCampaignStatsClickedInner() { + } + + public GetContactCampaignStatsClickedInner campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetContactCampaignStatsClickedInner links(List links) { + + this.links = links; + return this; + } + + public GetContactCampaignStatsClickedInner addLinksItem(GetExtendedContactDetailsAllOfStatisticsLinks linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLinks() { + return links; + } + + + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinks(List links) { + this.links = links; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactCampaignStatsClickedInner getContactCampaignStatsClickedInner = (GetContactCampaignStatsClickedInner) o; + return Objects.equals(this.campaignId, getContactCampaignStatsClickedInner.campaignId) && + Objects.equals(this.links, getContactCampaignStatsClickedInner.links); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, links); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactCampaignStatsClickedInner {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `links` to the URL query string + if (getLinks() != null) { + for (int i = 0; i < getLinks().size(); i++) { + if (getLinks().get(i) != null) { + joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsOpenedInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsOpenedInner.java new file mode 100644 index 0000000..ced4790 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsOpenedInner.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactCampaignStatsOpenedInner + */ +@JsonPropertyOrder({ + GetContactCampaignStatsOpenedInner.JSON_PROPERTY_CAMPAIGN_ID, + GetContactCampaignStatsOpenedInner.JSON_PROPERTY_COUNT, + GetContactCampaignStatsOpenedInner.JSON_PROPERTY_EVENT_TIME, + GetContactCampaignStatsOpenedInner.JSON_PROPERTY_IP +}) +@JsonTypeName("getContactCampaignStats_opened_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactCampaignStatsOpenedInner { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public GetContactCampaignStatsOpenedInner() { + } + + public GetContactCampaignStatsOpenedInner campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetContactCampaignStatsOpenedInner count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of openings of the campaign + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + + public GetContactCampaignStatsOpenedInner eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + + public GetContactCampaignStatsOpenedInner ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has opened the campaign + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactCampaignStatsOpenedInner getContactCampaignStatsOpenedInner = (GetContactCampaignStatsOpenedInner) o; + return Objects.equals(this.campaignId, getContactCampaignStatsOpenedInner.campaignId) && + Objects.equals(this.count, getContactCampaignStatsOpenedInner.count) && + Objects.equals(this.eventTime, getContactCampaignStatsOpenedInner.eventTime) && + Objects.equals(this.ip, getContactCampaignStatsOpenedInner.ip); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, count, eventTime, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactCampaignStatsOpenedInner {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsTransacAttributesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsTransacAttributesInner.java new file mode 100644 index 0000000..e5fd8dc --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsTransacAttributesInner.java @@ -0,0 +1,237 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactCampaignStatsTransacAttributesInner + */ +@JsonPropertyOrder({ + GetContactCampaignStatsTransacAttributesInner.JSON_PROPERTY_ORDER_DATE, + GetContactCampaignStatsTransacAttributesInner.JSON_PROPERTY_ORDER_PRICE, + GetContactCampaignStatsTransacAttributesInner.JSON_PROPERTY_ORDER_ID +}) +@JsonTypeName("getContactCampaignStats_transacAttributes_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactCampaignStatsTransacAttributesInner { + public static final String JSON_PROPERTY_ORDER_DATE = "orderDate"; + private LocalDate orderDate; + + public static final String JSON_PROPERTY_ORDER_PRICE = "orderPrice"; + private Float orderPrice; + + public static final String JSON_PROPERTY_ORDER_ID = "orderId"; + private Long orderId; + + public GetContactCampaignStatsTransacAttributesInner() { + } + + public GetContactCampaignStatsTransacAttributesInner orderDate(LocalDate orderDate) { + + this.orderDate = orderDate; + return this; + } + + /** + * Date of the order + * @return orderDate + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORDER_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getOrderDate() { + return orderDate; + } + + + @JsonProperty(JSON_PROPERTY_ORDER_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOrderDate(LocalDate orderDate) { + this.orderDate = orderDate; + } + + + public GetContactCampaignStatsTransacAttributesInner orderPrice(Float orderPrice) { + + this.orderPrice = orderPrice; + return this; + } + + /** + * Price of the order + * @return orderPrice + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORDER_PRICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getOrderPrice() { + return orderPrice; + } + + + @JsonProperty(JSON_PROPERTY_ORDER_PRICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOrderPrice(Float orderPrice) { + this.orderPrice = orderPrice; + } + + + public GetContactCampaignStatsTransacAttributesInner orderId(Long orderId) { + + this.orderId = orderId; + return this; + } + + /** + * ID of the order + * @return orderId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getOrderId() { + return orderId; + } + + + @JsonProperty(JSON_PROPERTY_ORDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactCampaignStatsTransacAttributesInner getContactCampaignStatsTransacAttributesInner = (GetContactCampaignStatsTransacAttributesInner) o; + return Objects.equals(this.orderDate, getContactCampaignStatsTransacAttributesInner.orderDate) && + Objects.equals(this.orderPrice, getContactCampaignStatsTransacAttributesInner.orderPrice) && + Objects.equals(this.orderId, getContactCampaignStatsTransacAttributesInner.orderId); + } + + @Override + public int hashCode() { + return Objects.hash(orderDate, orderPrice, orderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactCampaignStatsTransacAttributesInner {\n"); + sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n"); + sb.append(" orderPrice: ").append(toIndentedString(orderPrice)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `orderDate` to the URL query string + if (getOrderDate() != null) { + try { + joiner.add(String.format("%sorderDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrderDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `orderPrice` to the URL query string + if (getOrderPrice() != null) { + try { + joiner.add(String.format("%sorderPrice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrderPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `orderId` to the URL query string + if (getOrderId() != null) { + try { + joiner.add(String.format("%sorderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsUnsubscriptions.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsUnsubscriptions.java new file mode 100644 index 0000000..60298af --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactCampaignStatsUnsubscriptions.java @@ -0,0 +1,215 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactCampaignStatsUnsubscriptions + */ +@JsonPropertyOrder({ + GetContactCampaignStatsUnsubscriptions.JSON_PROPERTY_USER_UNSUBSCRIPTION, + GetContactCampaignStatsUnsubscriptions.JSON_PROPERTY_ADMIN_UNSUBSCRIPTION +}) +@JsonTypeName("getContactCampaignStats_unsubscriptions") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactCampaignStatsUnsubscriptions { + public static final String JSON_PROPERTY_USER_UNSUBSCRIPTION = "userUnsubscription"; + private List userUnsubscription = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMIN_UNSUBSCRIPTION = "adminUnsubscription"; + private List adminUnsubscription = new ArrayList<>(); + + public GetContactCampaignStatsUnsubscriptions() { + } + + public GetContactCampaignStatsUnsubscriptions userUnsubscription(List userUnsubscription) { + + this.userUnsubscription = userUnsubscription; + return this; + } + + public GetContactCampaignStatsUnsubscriptions addUserUnsubscriptionItem(GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription userUnsubscriptionItem) { + if (this.userUnsubscription == null) { + this.userUnsubscription = new ArrayList<>(); + } + this.userUnsubscription.add(userUnsubscriptionItem); + return this; + } + + /** + * Contact has unsubscribed via the unsubscription link in the email + * @return userUnsubscription + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getUserUnsubscription() { + return userUnsubscription; + } + + + @JsonProperty(JSON_PROPERTY_USER_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserUnsubscription(List userUnsubscription) { + this.userUnsubscription = userUnsubscription; + } + + + public GetContactCampaignStatsUnsubscriptions adminUnsubscription(List adminUnsubscription) { + + this.adminUnsubscription = adminUnsubscription; + return this; + } + + public GetContactCampaignStatsUnsubscriptions addAdminUnsubscriptionItem(GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription adminUnsubscriptionItem) { + if (this.adminUnsubscription == null) { + this.adminUnsubscription = new ArrayList<>(); + } + this.adminUnsubscription.add(adminUnsubscriptionItem); + return this; + } + + /** + * Contact has been unsubscribed from the administrator + * @return adminUnsubscription + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADMIN_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAdminUnsubscription() { + return adminUnsubscription; + } + + + @JsonProperty(JSON_PROPERTY_ADMIN_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAdminUnsubscription(List adminUnsubscription) { + this.adminUnsubscription = adminUnsubscription; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactCampaignStatsUnsubscriptions getContactCampaignStatsUnsubscriptions = (GetContactCampaignStatsUnsubscriptions) o; + return Objects.equals(this.userUnsubscription, getContactCampaignStatsUnsubscriptions.userUnsubscription) && + Objects.equals(this.adminUnsubscription, getContactCampaignStatsUnsubscriptions.adminUnsubscription); + } + + @Override + public int hashCode() { + return Objects.hash(userUnsubscription, adminUnsubscription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactCampaignStatsUnsubscriptions {\n"); + sb.append(" userUnsubscription: ").append(toIndentedString(userUnsubscription)).append("\n"); + sb.append(" adminUnsubscription: ").append(toIndentedString(adminUnsubscription)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `userUnsubscription` to the URL query string + if (getUserUnsubscription() != null) { + for (int i = 0; i < getUserUnsubscription().size(); i++) { + if (getUserUnsubscription().get(i) != null) { + joiner.add(getUserUnsubscription().get(i).toUrlQueryString(String.format("%suserUnsubscription%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `adminUnsubscription` to the URL query string + if (getAdminUnsubscription() != null) { + for (int i = 0; i < getAdminUnsubscription().size(); i++) { + if (getAdminUnsubscription().get(i) != null) { + joiner.add(getAdminUnsubscription().get(i).toUrlQueryString(String.format("%sadminUnsubscription%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactDetails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactDetails.java new file mode 100644 index 0000000..72623cd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactDetails.java @@ -0,0 +1,515 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactDetails + */ +@JsonPropertyOrder({ + GetContactDetails.JSON_PROPERTY_EMAIL, + GetContactDetails.JSON_PROPERTY_ID, + GetContactDetails.JSON_PROPERTY_EMAIL_BLACKLISTED, + GetContactDetails.JSON_PROPERTY_SMS_BLACKLISTED, + GetContactDetails.JSON_PROPERTY_CREATED_AT, + GetContactDetails.JSON_PROPERTY_MODIFIED_AT, + GetContactDetails.JSON_PROPERTY_LIST_IDS, + GetContactDetails.JSON_PROPERTY_LIST_UNSUBSCRIBED, + GetContactDetails.JSON_PROPERTY_ATTRIBUTES +}) +@JsonTypeName("getContactDetails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactDetails { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted"; + private Boolean emailBlacklisted; + + public static final String JSON_PROPERTY_SMS_BLACKLISTED = "smsBlacklisted"; + private Boolean smsBlacklisted; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_UNSUBSCRIBED = "listUnsubscribed"; + private List listUnsubscribed; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public GetContactDetails() { + } + + public GetContactDetails email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the contact for which you requested the details + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public GetContactDetails id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the contact for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetContactDetails emailBlacklisted(Boolean emailBlacklisted) { + + this.emailBlacklisted = emailBlacklisted; + return this; + } + + /** + * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + * @return emailBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getEmailBlacklisted() { + return emailBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailBlacklisted(Boolean emailBlacklisted) { + this.emailBlacklisted = emailBlacklisted; + } + + + public GetContactDetails smsBlacklisted(Boolean smsBlacklisted) { + + this.smsBlacklisted = smsBlacklisted; + return this; + } + + /** + * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + * @return smsBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getSmsBlacklisted() { + return smsBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSmsBlacklisted(Boolean smsBlacklisted) { + this.smsBlacklisted = smsBlacklisted; + } + + + public GetContactDetails createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetContactDetails modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetContactDetails listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public GetContactDetails addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Get listIds + * @return listIds + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public GetContactDetails listUnsubscribed(List listUnsubscribed) { + + this.listUnsubscribed = listUnsubscribed; + return this; + } + + public GetContactDetails addListUnsubscribedItem(Long listUnsubscribedItem) { + if (this.listUnsubscribed == null) { + this.listUnsubscribed = new ArrayList<>(); + } + this.listUnsubscribed.add(listUnsubscribedItem); + return this; + } + + /** + * Get listUnsubscribed + * @return listUnsubscribed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListUnsubscribed() { + return listUnsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_LIST_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListUnsubscribed(List listUnsubscribed) { + this.listUnsubscribed = listUnsubscribed; + } + + + public GetContactDetails attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Set of attributes of the contact + * @return attributes + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContactDetails getContactDetails = (GetContactDetails) o; + return Objects.equals(this.email, getContactDetails.email) && + Objects.equals(this.id, getContactDetails.id) && + Objects.equals(this.emailBlacklisted, getContactDetails.emailBlacklisted) && + Objects.equals(this.smsBlacklisted, getContactDetails.smsBlacklisted) && + Objects.equals(this.createdAt, getContactDetails.createdAt) && + Objects.equals(this.modifiedAt, getContactDetails.modifiedAt) && + Objects.equals(this.listIds, getContactDetails.listIds) && + Objects.equals(this.listUnsubscribed, getContactDetails.listUnsubscribed) && + Objects.equals(this.attributes, getContactDetails.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(email, id, emailBlacklisted, smsBlacklisted, createdAt, modifiedAt, listIds, listUnsubscribed, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactDetails {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" emailBlacklisted: ").append(toIndentedString(emailBlacklisted)).append("\n"); + sb.append(" smsBlacklisted: ").append(toIndentedString(smsBlacklisted)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" listUnsubscribed: ").append(toIndentedString(listUnsubscribed)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emailBlacklisted` to the URL query string + if (getEmailBlacklisted() != null) { + try { + joiner.add(String.format("%semailBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklisted` to the URL query string + if (getSmsBlacklisted() != null) { + try { + joiner.add(String.format("%ssmsBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `listUnsubscribed` to the URL query string + if (getListUnsubscribed() != null) { + for (int i = 0; i < getListUnsubscribed().size(); i++) { + try { + joiner.add(String.format("%slistUnsubscribed%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListUnsubscribed().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactInfoIdentifierParameter.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactInfoIdentifierParameter.java new file mode 100644 index 0000000..408d3f8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContactInfoIdentifierParameter.java @@ -0,0 +1,106 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContactInfoIdentifierParameter + */ +@JsonPropertyOrder({ +}) +@JsonTypeName("getContactInfo_identifier_parameter") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContactInfoIdentifierParameter { + public GetContactInfoIdentifierParameter() { + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContactInfoIdentifierParameter {\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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContacts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContacts.java new file mode 100644 index 0000000..2a49a8a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetContacts.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetContactDetails; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetContacts + */ +@JsonPropertyOrder({ + GetContacts.JSON_PROPERTY_CONTACTS, + GetContacts.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getContacts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetContacts { + public static final String JSON_PROPERTY_CONTACTS = "contacts"; + private List contacts = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetContacts() { + } + + public GetContacts contacts(List contacts) { + + this.contacts = contacts; + return this; + } + + public GetContacts addContactsItem(GetContactDetails contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * Get contacts + * @return contacts + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContacts() { + return contacts; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContacts(List contacts) { + this.contacts = contacts; + } + + + public GetContacts count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of contacts + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetContacts getContacts = (GetContacts) o; + return Objects.equals(this.contacts, getContacts.contacts) && + Objects.equals(this.count, getContacts.count); + } + + @Override + public int hashCode() { + return Objects.hash(contacts, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetContacts {\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `contacts` to the URL query string + if (getContacts() != null) { + for (int i = 0; i < getContacts().size(); i++) { + if (getContacts().get(i) != null) { + joiner.add(getContacts().get(i).toUrlQueryString(String.format("%scontacts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersList.java new file mode 100644 index 0000000..9702ec6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersList.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetCorporateInvitedUsersListUsersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCorporateInvitedUsersList + */ +@JsonPropertyOrder({ + GetCorporateInvitedUsersList.JSON_PROPERTY_USERS +}) +@JsonTypeName("getCorporateInvitedUsersList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCorporateInvitedUsersList { + public static final String JSON_PROPERTY_USERS = "users"; + private List users; + + public GetCorporateInvitedUsersList() { + } + + public GetCorporateInvitedUsersList users(List users) { + + this.users = users; + return this; + } + + public GetCorporateInvitedUsersList addUsersItem(GetCorporateInvitedUsersListUsersInner usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get invited users list + * @return users + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCorporateInvitedUsersList getCorporateInvitedUsersList = (GetCorporateInvitedUsersList) o; + return Objects.equals(this.users, getCorporateInvitedUsersList.users); + } + + @Override + public int hashCode() { + return Objects.hash(users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCorporateInvitedUsersList {\n"); + sb.append(" users: ").append(toIndentedString(users)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `users` to the URL query string + if (getUsers() != null) { + for (int i = 0; i < getUsers().size(); i++) { + if (getUsers().get(i) != null) { + joiner.add(getUsers().get(i).toUrlQueryString(String.format("%susers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInner.java new file mode 100644 index 0000000..04704f1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInner.java @@ -0,0 +1,312 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCorporateInvitedUsersListUsersInnerFeatureAccess; +import software.xdev.brevo.model.GetCorporateInvitedUsersListUsersInnerGroups; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCorporateInvitedUsersListUsersInner + */ +@JsonPropertyOrder({ + GetCorporateInvitedUsersListUsersInner.JSON_PROPERTY_GROUPS, + GetCorporateInvitedUsersListUsersInner.JSON_PROPERTY_EMAIL, + GetCorporateInvitedUsersListUsersInner.JSON_PROPERTY_IS_OWNER, + GetCorporateInvitedUsersListUsersInner.JSON_PROPERTY_STATUS, + GetCorporateInvitedUsersListUsersInner.JSON_PROPERTY_FEATURE_ACCESS +}) +@JsonTypeName("getCorporateInvitedUsersList_users_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCorporateInvitedUsersListUsersInner { + public static final String JSON_PROPERTY_GROUPS = "groups"; + private GetCorporateInvitedUsersListUsersInnerGroups groups; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_IS_OWNER = "is_owner"; + private String isOwner; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_FEATURE_ACCESS = "feature_access"; + private GetCorporateInvitedUsersListUsersInnerFeatureAccess featureAccess; + + public GetCorporateInvitedUsersListUsersInner() { + } + + public GetCorporateInvitedUsersListUsersInner groups(GetCorporateInvitedUsersListUsersInnerGroups groups) { + + this.groups = groups; + return this; + } + + /** + * Get groups + * @return groups + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetCorporateInvitedUsersListUsersInnerGroups getGroups() { + return groups; + } + + + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroups(GetCorporateInvitedUsersListUsersInnerGroups groups) { + this.groups = groups; + } + + + public GetCorporateInvitedUsersListUsersInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetCorporateInvitedUsersListUsersInner isOwner(String isOwner) { + + this.isOwner = isOwner; + return this; + } + + /** + * Flag for indicating is user owner of the organization. + * @return isOwner + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_OWNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIsOwner() { + return isOwner; + } + + + @JsonProperty(JSON_PROPERTY_IS_OWNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsOwner(String isOwner) { + this.isOwner = isOwner; + } + + + public GetCorporateInvitedUsersListUsersInner status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the invited user. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public GetCorporateInvitedUsersListUsersInner featureAccess(GetCorporateInvitedUsersListUsersInnerFeatureAccess featureAccess) { + + this.featureAccess = featureAccess; + return this; + } + + /** + * Get featureAccess + * @return featureAccess + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FEATURE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess getFeatureAccess() { + return featureAccess; + } + + + @JsonProperty(JSON_PROPERTY_FEATURE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFeatureAccess(GetCorporateInvitedUsersListUsersInnerFeatureAccess featureAccess) { + this.featureAccess = featureAccess; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCorporateInvitedUsersListUsersInner getCorporateInvitedUsersListUsersInner = (GetCorporateInvitedUsersListUsersInner) o; + return Objects.equals(this.groups, getCorporateInvitedUsersListUsersInner.groups) && + Objects.equals(this.email, getCorporateInvitedUsersListUsersInner.email) && + Objects.equals(this.isOwner, getCorporateInvitedUsersListUsersInner.isOwner) && + Objects.equals(this.status, getCorporateInvitedUsersListUsersInner.status) && + Objects.equals(this.featureAccess, getCorporateInvitedUsersListUsersInner.featureAccess); + } + + @Override + public int hashCode() { + return Objects.hash(groups, email, isOwner, status, featureAccess); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCorporateInvitedUsersListUsersInner {\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" featureAccess: ").append(toIndentedString(featureAccess)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `groups` to the URL query string + if (getGroups() != null) { + joiner.add(getGroups().toUrlQueryString(prefix + "groups" + suffix)); + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `is_owner` to the URL query string + if (getIsOwner() != null) { + try { + joiner.add(String.format("%sis_owner%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsOwner()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `feature_access` to the URL query string + if (getFeatureAccess() != null) { + joiner.add(getFeatureAccess().toUrlQueryString(prefix + "feature_access" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.java new file mode 100644 index 0000000..89d4991 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerFeatureAccess.java @@ -0,0 +1,329 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Feature accessiblity given to the user. (Required only if status is active) + */ +@JsonPropertyOrder({ + GetCorporateInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_USER_MANAGEMENT, + GetCorporateInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_API_KEYS, + GetCorporateInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_MY_PLAN, + GetCorporateInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_APPS_MANAGEMENT +}) +@JsonTypeName("getCorporateInvitedUsersList_users_inner_feature_access") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCorporateInvitedUsersListUsersInnerFeatureAccess { + public static final String JSON_PROPERTY_USER_MANAGEMENT = "user_management"; + private List userManagement; + + public static final String JSON_PROPERTY_API_KEYS = "api_keys"; + private List apiKeys; + + public static final String JSON_PROPERTY_MY_PLAN = "my_plan"; + private List myPlan; + + public static final String JSON_PROPERTY_APPS_MANAGEMENT = "apps_management"; + private List appsManagement; + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess() { + } + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess userManagement(List userManagement) { + + this.userManagement = userManagement; + return this; + } + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess addUserManagementItem(String userManagementItem) { + if (this.userManagement == null) { + this.userManagement = new ArrayList<>(); + } + this.userManagement.add(userManagementItem); + return this; + } + + /** + * User management accessiblity. + * @return userManagement + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUserManagement() { + return userManagement; + } + + + @JsonProperty(JSON_PROPERTY_USER_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserManagement(List userManagement) { + this.userManagement = userManagement; + } + + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess apiKeys(List apiKeys) { + + this.apiKeys = apiKeys; + return this; + } + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess addApiKeysItem(String apiKeysItem) { + if (this.apiKeys == null) { + this.apiKeys = new ArrayList<>(); + } + this.apiKeys.add(apiKeysItem); + return this; + } + + /** + * Api keys accessiblity. + * @return apiKeys + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getApiKeys() { + return apiKeys; + } + + + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKeys(List apiKeys) { + this.apiKeys = apiKeys; + } + + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess myPlan(List myPlan) { + + this.myPlan = myPlan; + return this; + } + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess addMyPlanItem(String myPlanItem) { + if (this.myPlan == null) { + this.myPlan = new ArrayList<>(); + } + this.myPlan.add(myPlanItem); + return this; + } + + /** + * My plan accessiblity. + * @return myPlan + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMyPlan() { + return myPlan; + } + + + @JsonProperty(JSON_PROPERTY_MY_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyPlan(List myPlan) { + this.myPlan = myPlan; + } + + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess appsManagement(List appsManagement) { + + this.appsManagement = appsManagement; + return this; + } + + public GetCorporateInvitedUsersListUsersInnerFeatureAccess addAppsManagementItem(String appsManagementItem) { + if (this.appsManagement == null) { + this.appsManagement = new ArrayList<>(); + } + this.appsManagement.add(appsManagementItem); + return this; + } + + /** + * Apps management accessiblity | Not available in ENTv2 + * @return appsManagement + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPS_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAppsManagement() { + return appsManagement; + } + + + @JsonProperty(JSON_PROPERTY_APPS_MANAGEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAppsManagement(List appsManagement) { + this.appsManagement = appsManagement; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCorporateInvitedUsersListUsersInnerFeatureAccess getCorporateInvitedUsersListUsersInnerFeatureAccess = (GetCorporateInvitedUsersListUsersInnerFeatureAccess) o; + return Objects.equals(this.userManagement, getCorporateInvitedUsersListUsersInnerFeatureAccess.userManagement) && + Objects.equals(this.apiKeys, getCorporateInvitedUsersListUsersInnerFeatureAccess.apiKeys) && + Objects.equals(this.myPlan, getCorporateInvitedUsersListUsersInnerFeatureAccess.myPlan) && + Objects.equals(this.appsManagement, getCorporateInvitedUsersListUsersInnerFeatureAccess.appsManagement); + } + + @Override + public int hashCode() { + return Objects.hash(userManagement, apiKeys, myPlan, appsManagement); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCorporateInvitedUsersListUsersInnerFeatureAccess {\n"); + sb.append(" userManagement: ").append(toIndentedString(userManagement)).append("\n"); + sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).append("\n"); + sb.append(" myPlan: ").append(toIndentedString(myPlan)).append("\n"); + sb.append(" appsManagement: ").append(toIndentedString(appsManagement)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `user_management` to the URL query string + if (getUserManagement() != null) { + for (int i = 0; i < getUserManagement().size(); i++) { + try { + joiner.add(String.format("%suser_management%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUserManagement().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `api_keys` to the URL query string + if (getApiKeys() != null) { + for (int i = 0; i < getApiKeys().size(); i++) { + try { + joiner.add(String.format("%sapi_keys%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getApiKeys().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `my_plan` to the URL query string + if (getMyPlan() != null) { + for (int i = 0; i < getMyPlan().size(); i++) { + try { + joiner.add(String.format("%smy_plan%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getMyPlan().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `apps_management` to the URL query string + if (getAppsManagement() != null) { + for (int i = 0; i < getAppsManagement().size(); i++) { + try { + joiner.add(String.format("%sapps_management%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getAppsManagement().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerGroups.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerGroups.java new file mode 100644 index 0000000..6982d01 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCorporateInvitedUsersListUsersInnerGroups.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Admin user groups list + */ +@JsonPropertyOrder({ + GetCorporateInvitedUsersListUsersInnerGroups.JSON_PROPERTY_ID, + GetCorporateInvitedUsersListUsersInnerGroups.JSON_PROPERTY_NAME +}) +@JsonTypeName("getCorporateInvitedUsersList_users_inner_groups") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCorporateInvitedUsersListUsersInnerGroups { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public GetCorporateInvitedUsersListUsersInnerGroups() { + } + + public GetCorporateInvitedUsersListUsersInnerGroups id(String id) { + + this.id = id; + return this; + } + + /** + * group id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public GetCorporateInvitedUsersListUsersInnerGroups name(String name) { + + this.name = name; + return this; + } + + /** + * group name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCorporateInvitedUsersListUsersInnerGroups getCorporateInvitedUsersListUsersInnerGroups = (GetCorporateInvitedUsersListUsersInnerGroups) o; + return Objects.equals(this.id, getCorporateInvitedUsersListUsersInnerGroups.id) && + Objects.equals(this.name, getCorporateInvitedUsersListUsersInnerGroups.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCorporateInvitedUsersListUsersInnerGroups {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCouponCollection.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCouponCollection.java new file mode 100644 index 0000000..cb526b8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetCouponCollection.java @@ -0,0 +1,363 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetCouponCollection + */ +@JsonPropertyOrder({ + GetCouponCollection.JSON_PROPERTY_ID, + GetCouponCollection.JSON_PROPERTY_NAME, + GetCouponCollection.JSON_PROPERTY_DEFAULT_COUPON, + GetCouponCollection.JSON_PROPERTY_CREATED_AT, + GetCouponCollection.JSON_PROPERTY_TOTAL_COUPONS, + GetCouponCollection.JSON_PROPERTY_REMAINING_COUPONS +}) +@JsonTypeName("getCouponCollection") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCouponCollection { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DEFAULT_COUPON = "defaultCoupon"; + private String defaultCoupon; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_TOTAL_COUPONS = "totalCoupons"; + private Long totalCoupons; + + public static final String JSON_PROPERTY_REMAINING_COUPONS = "remainingCoupons"; + private Long remainingCoupons; + + public GetCouponCollection() { + } + + public GetCouponCollection id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the collection + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public GetCouponCollection name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the collection + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetCouponCollection defaultCoupon(String defaultCoupon) { + + this.defaultCoupon = defaultCoupon; + return this; + } + + /** + * The default coupon of the collection + * @return defaultCoupon + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDefaultCoupon() { + return defaultCoupon; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultCoupon(String defaultCoupon) { + this.defaultCoupon = defaultCoupon; + } + + + public GetCouponCollection createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the collection was created + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetCouponCollection totalCoupons(Long totalCoupons) { + + this.totalCoupons = totalCoupons; + return this; + } + + /** + * Total coupons in the collection + * @return totalCoupons + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalCoupons() { + return totalCoupons; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalCoupons(Long totalCoupons) { + this.totalCoupons = totalCoupons; + } + + + public GetCouponCollection remainingCoupons(Long remainingCoupons) { + + this.remainingCoupons = remainingCoupons; + return this; + } + + /** + * Not sent coupons in the collection + * @return remainingCoupons + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REMAINING_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getRemainingCoupons() { + return remainingCoupons; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING_COUPONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRemainingCoupons(Long remainingCoupons) { + this.remainingCoupons = remainingCoupons; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCouponCollection getCouponCollection = (GetCouponCollection) o; + return Objects.equals(this.id, getCouponCollection.id) && + Objects.equals(this.name, getCouponCollection.name) && + Objects.equals(this.defaultCoupon, getCouponCollection.defaultCoupon) && + Objects.equals(this.createdAt, getCouponCollection.createdAt) && + Objects.equals(this.totalCoupons, getCouponCollection.totalCoupons) && + Objects.equals(this.remainingCoupons, getCouponCollection.remainingCoupons); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, defaultCoupon, createdAt, totalCoupons, remainingCoupons); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCouponCollection {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" defaultCoupon: ").append(toIndentedString(defaultCoupon)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" totalCoupons: ").append(toIndentedString(totalCoupons)).append("\n"); + sb.append(" remainingCoupons: ").append(toIndentedString(remainingCoupons)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `defaultCoupon` to the URL query string + if (getDefaultCoupon() != null) { + try { + joiner.add(String.format("%sdefaultCoupon%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultCoupon()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalCoupons` to the URL query string + if (getTotalCoupons() != null) { + try { + joiner.add(String.format("%stotalCoupons%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalCoupons()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remainingCoupons` to the URL query string + if (getRemainingCoupons() != null) { + try { + joiner.add(String.format("%sremainingCoupons%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemainingCoupons()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDeviceBrowserStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDeviceBrowserStats.java new file mode 100644 index 0000000..5415fdd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDeviceBrowserStats.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetDeviceBrowserStats + */ +@JsonPropertyOrder({ + GetDeviceBrowserStats.JSON_PROPERTY_CLICKERS, + GetDeviceBrowserStats.JSON_PROPERTY_UNIQUE_CLICKS, + GetDeviceBrowserStats.JSON_PROPERTY_VIEWED, + GetDeviceBrowserStats.JSON_PROPERTY_UNIQUE_VIEWS +}) +@JsonTypeName("getDeviceBrowserStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetDeviceBrowserStats { + public static final String JSON_PROPERTY_CLICKERS = "clickers"; + private Long clickers; + + public static final String JSON_PROPERTY_UNIQUE_CLICKS = "uniqueClicks"; + private Long uniqueClicks; + + public static final String JSON_PROPERTY_VIEWED = "viewed"; + private Long viewed; + + public static final String JSON_PROPERTY_UNIQUE_VIEWS = "uniqueViews"; + private Long uniqueViews; + + public GetDeviceBrowserStats() { + } + + public GetDeviceBrowserStats clickers(Long clickers) { + + this.clickers = clickers; + return this; + } + + /** + * Number of total clicks for the campaign using the particular browser + * @return clickers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getClickers() { + return clickers; + } + + + @JsonProperty(JSON_PROPERTY_CLICKERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClickers(Long clickers) { + this.clickers = clickers; + } + + + public GetDeviceBrowserStats uniqueClicks(Long uniqueClicks) { + + this.uniqueClicks = uniqueClicks; + return this; + } + + /** + * Number of unique clicks for the campaign using the particular browser + * @return uniqueClicks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueClicks() { + return uniqueClicks; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueClicks(Long uniqueClicks) { + this.uniqueClicks = uniqueClicks; + } + + + public GetDeviceBrowserStats viewed(Long viewed) { + + this.viewed = viewed; + return this; + } + + /** + * Number of openings for the campaign using the particular browser + * @return viewed + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VIEWED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getViewed() { + return viewed; + } + + + @JsonProperty(JSON_PROPERTY_VIEWED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setViewed(Long viewed) { + this.viewed = viewed; + } + + + public GetDeviceBrowserStats uniqueViews(Long uniqueViews) { + + this.uniqueViews = uniqueViews; + return this; + } + + /** + * Number of unique openings for the campaign using the particular browser + * @return uniqueViews + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueViews() { + return uniqueViews; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_VIEWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueViews(Long uniqueViews) { + this.uniqueViews = uniqueViews; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDeviceBrowserStats getDeviceBrowserStats = (GetDeviceBrowserStats) o; + return Objects.equals(this.clickers, getDeviceBrowserStats.clickers) && + Objects.equals(this.uniqueClicks, getDeviceBrowserStats.uniqueClicks) && + Objects.equals(this.viewed, getDeviceBrowserStats.viewed) && + Objects.equals(this.uniqueViews, getDeviceBrowserStats.uniqueViews); + } + + @Override + public int hashCode() { + return Objects.hash(clickers, uniqueClicks, viewed, uniqueViews); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDeviceBrowserStats {\n"); + sb.append(" clickers: ").append(toIndentedString(clickers)).append("\n"); + sb.append(" uniqueClicks: ").append(toIndentedString(uniqueClicks)).append("\n"); + sb.append(" viewed: ").append(toIndentedString(viewed)).append("\n"); + sb.append(" uniqueViews: ").append(toIndentedString(uniqueViews)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `clickers` to the URL query string + if (getClickers() != null) { + try { + joiner.add(String.format("%sclickers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClickers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueClicks` to the URL query string + if (getUniqueClicks() != null) { + try { + joiner.add(String.format("%suniqueClicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `viewed` to the URL query string + if (getViewed() != null) { + try { + joiner.add(String.format("%sviewed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getViewed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueViews` to the URL query string + if (getUniqueViews() != null) { + try { + joiner.add(String.format("%suniqueViews%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueViews()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainConfigurationModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainConfigurationModel.java new file mode 100644 index 0000000..de0dbc4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainConfigurationModel.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateDomainModelDnsRecords; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetDomainConfigurationModel + */ +@JsonPropertyOrder({ + GetDomainConfigurationModel.JSON_PROPERTY_DOMAIN, + GetDomainConfigurationModel.JSON_PROPERTY_VERIFIED, + GetDomainConfigurationModel.JSON_PROPERTY_AUTHENTICATED, + GetDomainConfigurationModel.JSON_PROPERTY_DNS_RECORDS +}) +@JsonTypeName("getDomainConfigurationModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetDomainConfigurationModel { + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_VERIFIED = "verified"; + private Boolean verified; + + public static final String JSON_PROPERTY_AUTHENTICATED = "authenticated"; + private Boolean authenticated; + + public static final String JSON_PROPERTY_DNS_RECORDS = "dns_records"; + private CreateDomainModelDnsRecords dnsRecords; + + public GetDomainConfigurationModel() { + } + + public GetDomainConfigurationModel domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Domain + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public GetDomainConfigurationModel verified(Boolean verified) { + + this.verified = verified; + return this; + } + + /** + * Status of domain verification (true=verified, false=non verified) + * @return verified + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getVerified() { + return verified; + } + + + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVerified(Boolean verified) { + this.verified = verified; + } + + + public GetDomainConfigurationModel authenticated(Boolean authenticated) { + + this.authenticated = authenticated; + return this; + } + + /** + * Status of domain authentication (true=authenticated, false=non authenticated) + * @return authenticated + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getAuthenticated() { + return authenticated; + } + + + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthenticated(Boolean authenticated) { + this.authenticated = authenticated; + } + + + public GetDomainConfigurationModel dnsRecords(CreateDomainModelDnsRecords dnsRecords) { + + this.dnsRecords = dnsRecords; + return this; + } + + /** + * Get dnsRecords + * @return dnsRecords + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DNS_RECORDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CreateDomainModelDnsRecords getDnsRecords() { + return dnsRecords; + } + + + @JsonProperty(JSON_PROPERTY_DNS_RECORDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDnsRecords(CreateDomainModelDnsRecords dnsRecords) { + this.dnsRecords = dnsRecords; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDomainConfigurationModel getDomainConfigurationModel = (GetDomainConfigurationModel) o; + return Objects.equals(this.domain, getDomainConfigurationModel.domain) && + Objects.equals(this.verified, getDomainConfigurationModel.verified) && + Objects.equals(this.authenticated, getDomainConfigurationModel.authenticated) && + Objects.equals(this.dnsRecords, getDomainConfigurationModel.dnsRecords); + } + + @Override + public int hashCode() { + return Objects.hash(domain, verified, authenticated, dnsRecords); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDomainConfigurationModel {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" authenticated: ").append(toIndentedString(authenticated)).append("\n"); + sb.append(" dnsRecords: ").append(toIndentedString(dnsRecords)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `verified` to the URL query string + if (getVerified() != null) { + try { + joiner.add(String.format("%sverified%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVerified()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authenticated` to the URL query string + if (getAuthenticated() != null) { + try { + joiner.add(String.format("%sauthenticated%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthenticated()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `dns_records` to the URL query string + if (getDnsRecords() != null) { + joiner.add(getDnsRecords().toUrlQueryString(prefix + "dns_records" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsList.java new file mode 100644 index 0000000..a1df1bb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsList.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetDomainsListDomainsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetDomainsList + */ +@JsonPropertyOrder({ + GetDomainsList.JSON_PROPERTY_DOMAINS +}) +@JsonTypeName("getDomainsList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetDomainsList { + public static final String JSON_PROPERTY_DOMAINS = "domains"; + private List domains; + + public GetDomainsList() { + } + + public GetDomainsList domains(List domains) { + + this.domains = domains; + return this; + } + + public GetDomainsList addDomainsItem(GetDomainsListDomainsInner domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * List of the domains available in your account + * @return domains + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDomains() { + return domains; + } + + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomains(List domains) { + this.domains = domains; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDomainsList getDomainsList = (GetDomainsList) o; + return Objects.equals(this.domains, getDomainsList.domains); + } + + @Override + public int hashCode() { + return Objects.hash(domains); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDomainsList {\n"); + sb.append(" domains: ").append(toIndentedString(domains)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domains` to the URL query string + if (getDomains() != null) { + for (int i = 0; i < getDomains().size(); i++) { + if (getDomains().get(i) != null) { + joiner.add(getDomains().get(i).toUrlQueryString(String.format("%sdomains%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsListDomainsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsListDomainsInner.java new file mode 100644 index 0000000..c0618a5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetDomainsListDomainsInner.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetDomainsListDomainsInner + */ +@JsonPropertyOrder({ + GetDomainsListDomainsInner.JSON_PROPERTY_ID, + GetDomainsListDomainsInner.JSON_PROPERTY_DOMAIN_NAME, + GetDomainsListDomainsInner.JSON_PROPERTY_AUTHENTICATED, + GetDomainsListDomainsInner.JSON_PROPERTY_VERIFIED, + GetDomainsListDomainsInner.JSON_PROPERTY_IP +}) +@JsonTypeName("getDomainsList_domains_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetDomainsListDomainsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_DOMAIN_NAME = "domain_name"; + private String domainName; + + public static final String JSON_PROPERTY_AUTHENTICATED = "authenticated"; + private Boolean authenticated; + + public static final String JSON_PROPERTY_VERIFIED = "verified"; + private Boolean verified; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public GetDomainsListDomainsInner() { + } + + public GetDomainsListDomainsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the domain + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetDomainsListDomainsInner domainName(String domainName) { + + this.domainName = domainName; + return this; + } + + /** + * Domain name + * @return domainName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomainName() { + return domainName; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + + public GetDomainsListDomainsInner authenticated(Boolean authenticated) { + + this.authenticated = authenticated; + return this; + } + + /** + * Status of domain authentication (true=authenticated, false=non authenticated) + * @return authenticated + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getAuthenticated() { + return authenticated; + } + + + @JsonProperty(JSON_PROPERTY_AUTHENTICATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthenticated(Boolean authenticated) { + this.authenticated = authenticated; + } + + + public GetDomainsListDomainsInner verified(Boolean verified) { + + this.verified = verified; + return this; + } + + /** + * Status of domain verification (true=verified, false=non verified) + * @return verified + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getVerified() { + return verified; + } + + + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVerified(Boolean verified) { + this.verified = verified; + } + + + public GetDomainsListDomainsInner ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated IP associated with domain + * @return ip + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDomainsListDomainsInner getDomainsListDomainsInner = (GetDomainsListDomainsInner) o; + return Objects.equals(this.id, getDomainsListDomainsInner.id) && + Objects.equals(this.domainName, getDomainsListDomainsInner.domainName) && + Objects.equals(this.authenticated, getDomainsListDomainsInner.authenticated) && + Objects.equals(this.verified, getDomainsListDomainsInner.verified) && + Objects.equals(this.ip, getDomainsListDomainsInner.ip); + } + + @Override + public int hashCode() { + return Objects.hash(id, domainName, authenticated, verified, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDomainsListDomainsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" authenticated: ").append(toIndentedString(authenticated)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain_name` to the URL query string + if (getDomainName() != null) { + try { + joiner.add(String.format("%sdomain_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomainName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authenticated` to the URL query string + if (getAuthenticated() != null) { + try { + joiner.add(String.format("%sauthenticated%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthenticated()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `verified` to the URL query string + if (getVerified() != null) { + try { + joiner.add(String.format("%sverified%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVerified()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaign.java new file mode 100644 index 0000000..a0315aa --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaign.java @@ -0,0 +1,1520 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCampaignRecipients; +import software.xdev.brevo.model.GetExtendedCampaignOverviewAllOfSender; +import software.xdev.brevo.model.GetExtendedCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetEmailCampaign + */ +@JsonPropertyOrder({ + GetEmailCampaign.JSON_PROPERTY_ID, + GetEmailCampaign.JSON_PROPERTY_NAME, + GetEmailCampaign.JSON_PROPERTY_SUBJECT, + GetEmailCampaign.JSON_PROPERTY_PREVIEW_TEXT, + GetEmailCampaign.JSON_PROPERTY_TYPE, + GetEmailCampaign.JSON_PROPERTY_STATUS, + GetEmailCampaign.JSON_PROPERTY_SCHEDULED_AT, + GetEmailCampaign.JSON_PROPERTY_AB_TESTING, + GetEmailCampaign.JSON_PROPERTY_SUBJECT_A, + GetEmailCampaign.JSON_PROPERTY_SUBJECT_B, + GetEmailCampaign.JSON_PROPERTY_SPLIT_RULE, + GetEmailCampaign.JSON_PROPERTY_WINNER_CRITERIA, + GetEmailCampaign.JSON_PROPERTY_WINNER_DELAY, + GetEmailCampaign.JSON_PROPERTY_SEND_AT_BEST_TIME, + GetEmailCampaign.JSON_PROPERTY_TEST_SENT, + GetEmailCampaign.JSON_PROPERTY_HEADER, + GetEmailCampaign.JSON_PROPERTY_FOOTER, + GetEmailCampaign.JSON_PROPERTY_SENDER, + GetEmailCampaign.JSON_PROPERTY_REPLY_TO, + GetEmailCampaign.JSON_PROPERTY_TO_FIELD, + GetEmailCampaign.JSON_PROPERTY_HTML_CONTENT, + GetEmailCampaign.JSON_PROPERTY_SHARE_LINK, + GetEmailCampaign.JSON_PROPERTY_TAG, + GetEmailCampaign.JSON_PROPERTY_CREATED_AT, + GetEmailCampaign.JSON_PROPERTY_MODIFIED_AT, + GetEmailCampaign.JSON_PROPERTY_INLINE_IMAGE_ACTIVATION, + GetEmailCampaign.JSON_PROPERTY_MIRROR_ACTIVE, + GetEmailCampaign.JSON_PROPERTY_RECURRING, + GetEmailCampaign.JSON_PROPERTY_SENT_DATE, + GetEmailCampaign.JSON_PROPERTY_RETURN_BOUNCE, + GetEmailCampaign.JSON_PROPERTY_RECIPIENTS, + GetEmailCampaign.JSON_PROPERTY_STATISTICS +}) +@JsonTypeName("getEmailCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEmailCampaign { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + /** + * Type of campaign + */ + public enum TypeEnum { + CLASSIC("classic"), + + TRIGGER("trigger"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Status of the campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + IN_PROCESS("in_process"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Integer splitRule; + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private String winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Integer winnerDelay; + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime; + + public static final String JSON_PROPERTY_TEST_SENT = "testSent"; + private Boolean testSent; + + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_FOOTER = "footer"; + private String footer; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private GetExtendedCampaignOverviewAllOfSender sender; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_SHARE_LINK = "shareLink"; + private String shareLink; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_INLINE_IMAGE_ACTIVATION = "inlineImageActivation"; + private Boolean inlineImageActivation; + + public static final String JSON_PROPERTY_MIRROR_ACTIVE = "mirrorActive"; + private Boolean mirrorActive; + + public static final String JSON_PROPERTY_RECURRING = "recurring"; + private Boolean recurring; + + public static final String JSON_PROPERTY_SENT_DATE = "sentDate"; + private String sentDate; + + public static final String JSON_PROPERTY_RETURN_BOUNCE = "returnBounce"; + private Long returnBounce; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private GetCampaignRecipients recipients; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetExtendedCampaignStats statistics; + + public GetEmailCampaign() { + } + + public GetEmailCampaign id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetEmailCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetEmailCampaign subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetEmailCampaign previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public GetEmailCampaign type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of campaign + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetEmailCampaign status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetEmailCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetEmailCampaign abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public GetEmailCampaign subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public GetEmailCampaign subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public GetEmailCampaign splitRule(Integer splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Integer splitRule) { + this.splitRule = splitRule; + } + + + public GetEmailCampaign winnerCriteria(String winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(String winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public GetEmailCampaign winnerDelay(Integer winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Integer winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public GetEmailCampaign sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * It is true if you have chosen to send your campaign at best time, otherwise it is false + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + + public GetEmailCampaign testSent(Boolean testSent) { + + this.testSent = testSent; + return this; + } + + /** + * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * @return testSent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getTestSent() { + return testSent; + } + + + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestSent(Boolean testSent) { + this.testSent = testSent; + } + + + public GetEmailCampaign header(String header) { + + this.header = header; + return this; + } + + /** + * Header of the campaign + * @return header + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHeader() { + return header; + } + + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeader(String header) { + this.header = header; + } + + + public GetEmailCampaign footer(String footer) { + + this.footer = footer; + return this; + } + + /** + * Footer of the campaign + * @return footer + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFooter() { + return footer; + } + + + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFooter(String footer) { + this.footer = footer; + } + + + public GetEmailCampaign sender(GetExtendedCampaignOverviewAllOfSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedCampaignOverviewAllOfSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(GetExtendedCampaignOverviewAllOfSender sender) { + this.sender = sender; + } + + + public GetEmailCampaign replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email defined as the \"Reply to\" of the campaign + * @return replyTo + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public GetEmailCampaign toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * Customisation of the \"to\" field of the campaign + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public GetEmailCampaign htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * HTML content of the campaign + * @return htmlContent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public GetEmailCampaign shareLink(String shareLink) { + + this.shareLink = shareLink; + return this; + } + + /** + * Link to share the campaign on social medias + * @return shareLink + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getShareLink() { + return shareLink; + } + + + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShareLink(String shareLink) { + this.shareLink = shareLink; + } + + + public GetEmailCampaign tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the campaign + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public GetEmailCampaign createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetEmailCampaign modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetEmailCampaign inlineImageActivation(Boolean inlineImageActivation) { + + this.inlineImageActivation = inlineImageActivation; + return this; + } + + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * @return inlineImageActivation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInlineImageActivation() { + return inlineImageActivation; + } + + + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInlineImageActivation(Boolean inlineImageActivation) { + this.inlineImageActivation = inlineImageActivation; + } + + + public GetEmailCampaign mirrorActive(Boolean mirrorActive) { + + this.mirrorActive = mirrorActive; + return this; + } + + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * @return mirrorActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMirrorActive() { + return mirrorActive; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMirrorActive(Boolean mirrorActive) { + this.mirrorActive = mirrorActive; + } + + + public GetEmailCampaign recurring(Boolean recurring) { + + this.recurring = recurring; + return this; + } + + /** + * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * @return recurring + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRecurring() { + return recurring; + } + + + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurring(Boolean recurring) { + this.recurring = recurring; + } + + + public GetEmailCampaign sentDate(String sentDate) { + + this.sentDate = sentDate; + return this; + } + + /** + * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * @return sentDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSentDate() { + return sentDate; + } + + + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentDate(String sentDate) { + this.sentDate = sentDate; + } + + + public GetEmailCampaign returnBounce(Long returnBounce) { + + this.returnBounce = returnBounce; + return this; + } + + /** + * Total number of non-delivered campaigns for a particular campaign id. + * @return returnBounce + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReturnBounce() { + return returnBounce; + } + + + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturnBounce(Long returnBounce) { + this.returnBounce = returnBounce; + } + + + public GetEmailCampaign recipients(GetCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipients(GetCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public GetEmailCampaign statistics(GetExtendedCampaignStats statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedCampaignStats getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatistics(GetExtendedCampaignStats statistics) { + this.statistics = statistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailCampaign getEmailCampaign = (GetEmailCampaign) o; + return Objects.equals(this.id, getEmailCampaign.id) && + Objects.equals(this.name, getEmailCampaign.name) && + Objects.equals(this.subject, getEmailCampaign.subject) && + Objects.equals(this.previewText, getEmailCampaign.previewText) && + Objects.equals(this.type, getEmailCampaign.type) && + Objects.equals(this.status, getEmailCampaign.status) && + Objects.equals(this.scheduledAt, getEmailCampaign.scheduledAt) && + Objects.equals(this.abTesting, getEmailCampaign.abTesting) && + Objects.equals(this.subjectA, getEmailCampaign.subjectA) && + Objects.equals(this.subjectB, getEmailCampaign.subjectB) && + Objects.equals(this.splitRule, getEmailCampaign.splitRule) && + Objects.equals(this.winnerCriteria, getEmailCampaign.winnerCriteria) && + Objects.equals(this.winnerDelay, getEmailCampaign.winnerDelay) && + Objects.equals(this.sendAtBestTime, getEmailCampaign.sendAtBestTime) && + Objects.equals(this.testSent, getEmailCampaign.testSent) && + Objects.equals(this.header, getEmailCampaign.header) && + Objects.equals(this.footer, getEmailCampaign.footer) && + Objects.equals(this.sender, getEmailCampaign.sender) && + Objects.equals(this.replyTo, getEmailCampaign.replyTo) && + Objects.equals(this.toField, getEmailCampaign.toField) && + Objects.equals(this.htmlContent, getEmailCampaign.htmlContent) && + Objects.equals(this.shareLink, getEmailCampaign.shareLink) && + Objects.equals(this.tag, getEmailCampaign.tag) && + Objects.equals(this.createdAt, getEmailCampaign.createdAt) && + Objects.equals(this.modifiedAt, getEmailCampaign.modifiedAt) && + Objects.equals(this.inlineImageActivation, getEmailCampaign.inlineImageActivation) && + Objects.equals(this.mirrorActive, getEmailCampaign.mirrorActive) && + Objects.equals(this.recurring, getEmailCampaign.recurring) && + Objects.equals(this.sentDate, getEmailCampaign.sentDate) && + Objects.equals(this.returnBounce, getEmailCampaign.returnBounce) && + Objects.equals(this.recipients, getEmailCampaign.recipients) && + Objects.equals(this.statistics, getEmailCampaign.statistics); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, subject, previewText, type, status, scheduledAt, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, sendAtBestTime, testSent, header, footer, sender, replyTo, toField, htmlContent, shareLink, tag, createdAt, modifiedAt, inlineImageActivation, mirrorActive, recurring, sentDate, returnBounce, recipients, statistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailCampaign {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).append("\n"); + sb.append(" testSent: ").append(toIndentedString(testSent)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" footer: ").append(toIndentedString(footer)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" shareLink: ").append(toIndentedString(shareLink)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" inlineImageActivation: ").append(toIndentedString(inlineImageActivation)).append("\n"); + sb.append(" mirrorActive: ").append(toIndentedString(mirrorActive)).append("\n"); + sb.append(" recurring: ").append(toIndentedString(recurring)).append("\n"); + sb.append(" sentDate: ").append(toIndentedString(sentDate)).append("\n"); + sb.append(" returnBounce: ").append(toIndentedString(returnBounce)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `testSent` to the URL query string + if (getTestSent() != null) { + try { + joiner.add(String.format("%stestSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTestSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header` to the URL query string + if (getHeader() != null) { + try { + joiner.add(String.format("%sheader%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `footer` to the URL query string + if (getFooter() != null) { + try { + joiner.add(String.format("%sfooter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `shareLink` to the URL query string + if (getShareLink() != null) { + try { + joiner.add(String.format("%sshareLink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShareLink()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inlineImageActivation` to the URL query string + if (getInlineImageActivation() != null) { + try { + joiner.add(String.format("%sinlineImageActivation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInlineImageActivation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mirrorActive` to the URL query string + if (getMirrorActive() != null) { + try { + joiner.add(String.format("%smirrorActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recurring` to the URL query string + if (getRecurring() != null) { + try { + joiner.add(String.format("%srecurring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecurring()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sentDate` to the URL query string + if (getSentDate() != null) { + try { + joiner.add(String.format("%ssentDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSentDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `returnBounce` to the URL query string + if (getReturnBounce() != null) { + try { + joiner.add(String.format("%sreturnBounce%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturnBounce()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaigns.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaigns.java new file mode 100644 index 0000000..1b74ff6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaigns.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetEmailCampaignsCampaignsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetEmailCampaigns + */ +@JsonPropertyOrder({ + GetEmailCampaigns.JSON_PROPERTY_CAMPAIGNS, + GetEmailCampaigns.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getEmailCampaigns") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEmailCampaigns { + public static final String JSON_PROPERTY_CAMPAIGNS = "campaigns"; + private List campaigns; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetEmailCampaigns() { + } + + public GetEmailCampaigns campaigns(List campaigns) { + + this.campaigns = campaigns; + return this; + } + + public GetEmailCampaigns addCampaignsItem(GetEmailCampaignsCampaignsInner campaignsItem) { + if (this.campaigns == null) { + this.campaigns = new ArrayList<>(); + } + this.campaigns.add(campaignsItem); + return this; + } + + /** + * Get campaigns + * @return campaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCampaigns() { + return campaigns; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaigns(List campaigns) { + this.campaigns = campaigns; + } + + + public GetEmailCampaigns count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of Email campaigns retrieved + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailCampaigns getEmailCampaigns = (GetEmailCampaigns) o; + return Objects.equals(this.campaigns, getEmailCampaigns.campaigns) && + Objects.equals(this.count, getEmailCampaigns.count); + } + + @Override + public int hashCode() { + return Objects.hash(campaigns, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailCampaigns {\n"); + sb.append(" campaigns: ").append(toIndentedString(campaigns)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaigns` to the URL query string + if (getCampaigns() != null) { + for (int i = 0; i < getCampaigns().size(); i++) { + if (getCampaigns().get(i) != null) { + joiner.add(getCampaigns().get(i).toUrlQueryString(String.format("%scampaigns%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaignsCampaignsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaignsCampaignsInner.java new file mode 100644 index 0000000..c798fb6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailCampaignsCampaignsInner.java @@ -0,0 +1,1520 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCampaignRecipients; +import software.xdev.brevo.model.GetExtendedCampaignOverviewAllOfSender; +import software.xdev.brevo.model.GetExtendedCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetEmailCampaignsCampaignsInner + */ +@JsonPropertyOrder({ + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_ID, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_NAME, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SUBJECT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_PREVIEW_TEXT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_TYPE, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_STATUS, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SCHEDULED_AT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_AB_TESTING, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SUBJECT_A, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SUBJECT_B, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SPLIT_RULE, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_WINNER_CRITERIA, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_WINNER_DELAY, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SEND_AT_BEST_TIME, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_TEST_SENT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_HEADER, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_FOOTER, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SENDER, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_REPLY_TO, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_TO_FIELD, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_HTML_CONTENT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SHARE_LINK, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_TAG, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_CREATED_AT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_MODIFIED_AT, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_INLINE_IMAGE_ACTIVATION, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_MIRROR_ACTIVE, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_RECURRING, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_SENT_DATE, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_RETURN_BOUNCE, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_RECIPIENTS, + GetEmailCampaignsCampaignsInner.JSON_PROPERTY_STATISTICS +}) +@JsonTypeName("getEmailCampaigns_campaigns_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEmailCampaignsCampaignsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + /** + * Type of campaign + */ + public enum TypeEnum { + CLASSIC("classic"), + + TRIGGER("trigger"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Status of the campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + IN_PROCESS("in_process"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Integer splitRule; + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private String winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Integer winnerDelay; + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime; + + public static final String JSON_PROPERTY_TEST_SENT = "testSent"; + private Boolean testSent; + + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_FOOTER = "footer"; + private String footer; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private GetExtendedCampaignOverviewAllOfSender sender; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_SHARE_LINK = "shareLink"; + private String shareLink; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_INLINE_IMAGE_ACTIVATION = "inlineImageActivation"; + private Boolean inlineImageActivation; + + public static final String JSON_PROPERTY_MIRROR_ACTIVE = "mirrorActive"; + private Boolean mirrorActive; + + public static final String JSON_PROPERTY_RECURRING = "recurring"; + private Boolean recurring; + + public static final String JSON_PROPERTY_SENT_DATE = "sentDate"; + private String sentDate; + + public static final String JSON_PROPERTY_RETURN_BOUNCE = "returnBounce"; + private Long returnBounce; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private GetCampaignRecipients recipients; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetExtendedCampaignStats statistics; + + public GetEmailCampaignsCampaignsInner() { + } + + public GetEmailCampaignsCampaignsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetEmailCampaignsCampaignsInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetEmailCampaignsCampaignsInner subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetEmailCampaignsCampaignsInner previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public GetEmailCampaignsCampaignsInner type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of campaign + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetEmailCampaignsCampaignsInner status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetEmailCampaignsCampaignsInner scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetEmailCampaignsCampaignsInner abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public GetEmailCampaignsCampaignsInner subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public GetEmailCampaignsCampaignsInner subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public GetEmailCampaignsCampaignsInner splitRule(Integer splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Integer splitRule) { + this.splitRule = splitRule; + } + + + public GetEmailCampaignsCampaignsInner winnerCriteria(String winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(String winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public GetEmailCampaignsCampaignsInner winnerDelay(Integer winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Integer winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public GetEmailCampaignsCampaignsInner sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * It is true if you have chosen to send your campaign at best time, otherwise it is false + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + + public GetEmailCampaignsCampaignsInner testSent(Boolean testSent) { + + this.testSent = testSent; + return this; + } + + /** + * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * @return testSent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getTestSent() { + return testSent; + } + + + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestSent(Boolean testSent) { + this.testSent = testSent; + } + + + public GetEmailCampaignsCampaignsInner header(String header) { + + this.header = header; + return this; + } + + /** + * Header of the campaign + * @return header + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHeader() { + return header; + } + + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeader(String header) { + this.header = header; + } + + + public GetEmailCampaignsCampaignsInner footer(String footer) { + + this.footer = footer; + return this; + } + + /** + * Footer of the campaign + * @return footer + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFooter() { + return footer; + } + + + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFooter(String footer) { + this.footer = footer; + } + + + public GetEmailCampaignsCampaignsInner sender(GetExtendedCampaignOverviewAllOfSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedCampaignOverviewAllOfSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(GetExtendedCampaignOverviewAllOfSender sender) { + this.sender = sender; + } + + + public GetEmailCampaignsCampaignsInner replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email defined as the \"Reply to\" of the campaign + * @return replyTo + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public GetEmailCampaignsCampaignsInner toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * Customisation of the \"to\" field of the campaign + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public GetEmailCampaignsCampaignsInner htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * HTML content of the campaign + * @return htmlContent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public GetEmailCampaignsCampaignsInner shareLink(String shareLink) { + + this.shareLink = shareLink; + return this; + } + + /** + * Link to share the campaign on social medias + * @return shareLink + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getShareLink() { + return shareLink; + } + + + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShareLink(String shareLink) { + this.shareLink = shareLink; + } + + + public GetEmailCampaignsCampaignsInner tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the campaign + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public GetEmailCampaignsCampaignsInner createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetEmailCampaignsCampaignsInner modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetEmailCampaignsCampaignsInner inlineImageActivation(Boolean inlineImageActivation) { + + this.inlineImageActivation = inlineImageActivation; + return this; + } + + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * @return inlineImageActivation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInlineImageActivation() { + return inlineImageActivation; + } + + + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInlineImageActivation(Boolean inlineImageActivation) { + this.inlineImageActivation = inlineImageActivation; + } + + + public GetEmailCampaignsCampaignsInner mirrorActive(Boolean mirrorActive) { + + this.mirrorActive = mirrorActive; + return this; + } + + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * @return mirrorActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMirrorActive() { + return mirrorActive; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMirrorActive(Boolean mirrorActive) { + this.mirrorActive = mirrorActive; + } + + + public GetEmailCampaignsCampaignsInner recurring(Boolean recurring) { + + this.recurring = recurring; + return this; + } + + /** + * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * @return recurring + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRecurring() { + return recurring; + } + + + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurring(Boolean recurring) { + this.recurring = recurring; + } + + + public GetEmailCampaignsCampaignsInner sentDate(String sentDate) { + + this.sentDate = sentDate; + return this; + } + + /** + * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * @return sentDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSentDate() { + return sentDate; + } + + + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentDate(String sentDate) { + this.sentDate = sentDate; + } + + + public GetEmailCampaignsCampaignsInner returnBounce(Long returnBounce) { + + this.returnBounce = returnBounce; + return this; + } + + /** + * Total number of non-delivered campaigns for a particular campaign id. + * @return returnBounce + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReturnBounce() { + return returnBounce; + } + + + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturnBounce(Long returnBounce) { + this.returnBounce = returnBounce; + } + + + public GetEmailCampaignsCampaignsInner recipients(GetCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipients(GetCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public GetEmailCampaignsCampaignsInner statistics(GetExtendedCampaignStats statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedCampaignStats getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatistics(GetExtendedCampaignStats statistics) { + this.statistics = statistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailCampaignsCampaignsInner getEmailCampaignsCampaignsInner = (GetEmailCampaignsCampaignsInner) o; + return Objects.equals(this.id, getEmailCampaignsCampaignsInner.id) && + Objects.equals(this.name, getEmailCampaignsCampaignsInner.name) && + Objects.equals(this.subject, getEmailCampaignsCampaignsInner.subject) && + Objects.equals(this.previewText, getEmailCampaignsCampaignsInner.previewText) && + Objects.equals(this.type, getEmailCampaignsCampaignsInner.type) && + Objects.equals(this.status, getEmailCampaignsCampaignsInner.status) && + Objects.equals(this.scheduledAt, getEmailCampaignsCampaignsInner.scheduledAt) && + Objects.equals(this.abTesting, getEmailCampaignsCampaignsInner.abTesting) && + Objects.equals(this.subjectA, getEmailCampaignsCampaignsInner.subjectA) && + Objects.equals(this.subjectB, getEmailCampaignsCampaignsInner.subjectB) && + Objects.equals(this.splitRule, getEmailCampaignsCampaignsInner.splitRule) && + Objects.equals(this.winnerCriteria, getEmailCampaignsCampaignsInner.winnerCriteria) && + Objects.equals(this.winnerDelay, getEmailCampaignsCampaignsInner.winnerDelay) && + Objects.equals(this.sendAtBestTime, getEmailCampaignsCampaignsInner.sendAtBestTime) && + Objects.equals(this.testSent, getEmailCampaignsCampaignsInner.testSent) && + Objects.equals(this.header, getEmailCampaignsCampaignsInner.header) && + Objects.equals(this.footer, getEmailCampaignsCampaignsInner.footer) && + Objects.equals(this.sender, getEmailCampaignsCampaignsInner.sender) && + Objects.equals(this.replyTo, getEmailCampaignsCampaignsInner.replyTo) && + Objects.equals(this.toField, getEmailCampaignsCampaignsInner.toField) && + Objects.equals(this.htmlContent, getEmailCampaignsCampaignsInner.htmlContent) && + Objects.equals(this.shareLink, getEmailCampaignsCampaignsInner.shareLink) && + Objects.equals(this.tag, getEmailCampaignsCampaignsInner.tag) && + Objects.equals(this.createdAt, getEmailCampaignsCampaignsInner.createdAt) && + Objects.equals(this.modifiedAt, getEmailCampaignsCampaignsInner.modifiedAt) && + Objects.equals(this.inlineImageActivation, getEmailCampaignsCampaignsInner.inlineImageActivation) && + Objects.equals(this.mirrorActive, getEmailCampaignsCampaignsInner.mirrorActive) && + Objects.equals(this.recurring, getEmailCampaignsCampaignsInner.recurring) && + Objects.equals(this.sentDate, getEmailCampaignsCampaignsInner.sentDate) && + Objects.equals(this.returnBounce, getEmailCampaignsCampaignsInner.returnBounce) && + Objects.equals(this.recipients, getEmailCampaignsCampaignsInner.recipients) && + Objects.equals(this.statistics, getEmailCampaignsCampaignsInner.statistics); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, subject, previewText, type, status, scheduledAt, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, sendAtBestTime, testSent, header, footer, sender, replyTo, toField, htmlContent, shareLink, tag, createdAt, modifiedAt, inlineImageActivation, mirrorActive, recurring, sentDate, returnBounce, recipients, statistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailCampaignsCampaignsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).append("\n"); + sb.append(" testSent: ").append(toIndentedString(testSent)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" footer: ").append(toIndentedString(footer)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" shareLink: ").append(toIndentedString(shareLink)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" inlineImageActivation: ").append(toIndentedString(inlineImageActivation)).append("\n"); + sb.append(" mirrorActive: ").append(toIndentedString(mirrorActive)).append("\n"); + sb.append(" recurring: ").append(toIndentedString(recurring)).append("\n"); + sb.append(" sentDate: ").append(toIndentedString(sentDate)).append("\n"); + sb.append(" returnBounce: ").append(toIndentedString(returnBounce)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `testSent` to the URL query string + if (getTestSent() != null) { + try { + joiner.add(String.format("%stestSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTestSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header` to the URL query string + if (getHeader() != null) { + try { + joiner.add(String.format("%sheader%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `footer` to the URL query string + if (getFooter() != null) { + try { + joiner.add(String.format("%sfooter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `shareLink` to the URL query string + if (getShareLink() != null) { + try { + joiner.add(String.format("%sshareLink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShareLink()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inlineImageActivation` to the URL query string + if (getInlineImageActivation() != null) { + try { + joiner.add(String.format("%sinlineImageActivation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInlineImageActivation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mirrorActive` to the URL query string + if (getMirrorActive() != null) { + try { + joiner.add(String.format("%smirrorActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recurring` to the URL query string + if (getRecurring() != null) { + try { + joiner.add(String.format("%srecurring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecurring()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sentDate` to the URL query string + if (getSentDate() != null) { + try { + joiner.add(String.format("%ssentDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSentDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `returnBounce` to the URL query string + if (getReturnBounce() != null) { + try { + joiner.add(String.format("%sreturnBounce%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturnBounce()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReport.java new file mode 100644 index 0000000..a6cc2e6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReport.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetEmailEventReportEventsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetEmailEventReport + */ +@JsonPropertyOrder({ + GetEmailEventReport.JSON_PROPERTY_EVENTS +}) +@JsonTypeName("getEmailEventReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEmailEventReport { + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events; + + public GetEmailEventReport() { + } + + public GetEmailEventReport events(List events) { + + this.events = events; + return this; + } + + public GetEmailEventReport addEventsItem(GetEmailEventReportEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(List events) { + this.events = events; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailEventReport getEmailEventReport = (GetEmailEventReport) o; + return Objects.equals(this.events, getEmailEventReport.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailEventReport {\n"); + sb.append(" events: ").append(toIndentedString(events)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + if (getEvents().get(i) != null) { + joiner.add(getEvents().get(i).toUrlQueryString(String.format("%sevents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReportEventsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReportEventsInner.java new file mode 100644 index 0000000..6068ceb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetEmailEventReportEventsInner.java @@ -0,0 +1,631 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetEmailEventReportEventsInner + */ +@JsonPropertyOrder({ + GetEmailEventReportEventsInner.JSON_PROPERTY_EMAIL, + GetEmailEventReportEventsInner.JSON_PROPERTY_DATE, + GetEmailEventReportEventsInner.JSON_PROPERTY_SUBJECT, + GetEmailEventReportEventsInner.JSON_PROPERTY_MESSAGE_ID, + GetEmailEventReportEventsInner.JSON_PROPERTY_EVENT, + GetEmailEventReportEventsInner.JSON_PROPERTY_REASON, + GetEmailEventReportEventsInner.JSON_PROPERTY_TAG, + GetEmailEventReportEventsInner.JSON_PROPERTY_IP, + GetEmailEventReportEventsInner.JSON_PROPERTY_LINK, + GetEmailEventReportEventsInner.JSON_PROPERTY_FROM, + GetEmailEventReportEventsInner.JSON_PROPERTY_TEMPLATE_ID +}) +@JsonTypeName("getEmailEventReport_events_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEmailEventReportEventsInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + /** + * Event which occurred + */ + public enum EventEnum { + BOUNCES("bounces"), + + HARDBOUNCES("hardBounces"), + + SOFTBOUNCES("softBounces"), + + DELIVERED("delivered"), + + SPAM("spam"), + + REQUESTS("requests"), + + OPENED("opened"), + + CLICKS("clicks"), + + INVALID("invalid"), + + DEFERRED("deferred"), + + BLOCKED("blocked"), + + UNSUBSCRIBED("unsubscribed"), + + ERROR("error"), + + LOADEDBYPROXY("loadedByProxy"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENT = "event"; + private EventEnum event; + + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_LINK = "link"; + private String link; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public GetEmailEventReportEventsInner() { + } + + public GetEmailEventReportEventsInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address which generates the event + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetEmailEventReportEventsInner date(String date) { + + this.date = date; + return this; + } + + /** + * UTC date-time on which the event has been generated + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(String date) { + this.date = date; + } + + + public GetEmailEventReportEventsInner subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the event + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetEmailEventReportEventsInner messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message ID which generated the event + * @return messageId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetEmailEventReportEventsInner event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Event which occurred + * @return event + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventEnum getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(EventEnum event) { + this.event = event; + } + + + public GetEmailEventReportEventsInner reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason of bounce (only available if the event is hardbounce or softbounce) + * @return reason + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReason() { + return reason; + } + + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(String reason) { + this.reason = reason; + } + + + public GetEmailEventReportEventsInner tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the email which generated the event + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public GetEmailEventReportEventsInner ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) + * @return ip + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + + public GetEmailEventReportEventsInner link(String link) { + + this.link = link; + return this; + } + + /** + * The link which is sent to the user (only available if the event is requests or opened or clicks) + * @return link + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLink() { + return link; + } + + + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLink(String link) { + this.link = link; + } + + + public GetEmailEventReportEventsInner from(String from) { + + this.from = from; + return this; + } + + /** + * Sender email from which the emails are sent + * @return from + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFrom() { + return from; + } + + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + + public GetEmailEventReportEventsInner templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * ID of the template (only available if the email is template based) + * @return templateId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailEventReportEventsInner getEmailEventReportEventsInner = (GetEmailEventReportEventsInner) o; + return Objects.equals(this.email, getEmailEventReportEventsInner.email) && + Objects.equals(this.date, getEmailEventReportEventsInner.date) && + Objects.equals(this.subject, getEmailEventReportEventsInner.subject) && + Objects.equals(this.messageId, getEmailEventReportEventsInner.messageId) && + Objects.equals(this.event, getEmailEventReportEventsInner.event) && + Objects.equals(this.reason, getEmailEventReportEventsInner.reason) && + Objects.equals(this.tag, getEmailEventReportEventsInner.tag) && + Objects.equals(this.ip, getEmailEventReportEventsInner.ip) && + Objects.equals(this.link, getEmailEventReportEventsInner.link) && + Objects.equals(this.from, getEmailEventReportEventsInner.from) && + Objects.equals(this.templateId, getEmailEventReportEventsInner.templateId); + } + + @Override + public int hashCode() { + return Objects.hash(email, date, subject, messageId, event, reason, tag, ip, link, from, templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailEventReportEventsInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `event` to the URL query string + if (getEvent() != null) { + try { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEvent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `reason` to the URL query string + if (getReason() != null) { + try { + joiner.add(String.format("%sreason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReason()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `link` to the URL query string + if (getLink() != null) { + try { + joiner.add(String.format("%slink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLink()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `from` to the URL query string + if (getFrom() != null) { + try { + joiner.add(String.format("%sfrom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFrom()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverview.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverview.java new file mode 100644 index 0000000..1733f15 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverview.java @@ -0,0 +1,1444 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetExtendedCampaignOverviewAllOfSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedCampaignOverview + */ +@JsonPropertyOrder({ + GetExtendedCampaignOverview.JSON_PROPERTY_ID, + GetExtendedCampaignOverview.JSON_PROPERTY_NAME, + GetExtendedCampaignOverview.JSON_PROPERTY_SUBJECT, + GetExtendedCampaignOverview.JSON_PROPERTY_PREVIEW_TEXT, + GetExtendedCampaignOverview.JSON_PROPERTY_TYPE, + GetExtendedCampaignOverview.JSON_PROPERTY_STATUS, + GetExtendedCampaignOverview.JSON_PROPERTY_SCHEDULED_AT, + GetExtendedCampaignOverview.JSON_PROPERTY_AB_TESTING, + GetExtendedCampaignOverview.JSON_PROPERTY_SUBJECT_A, + GetExtendedCampaignOverview.JSON_PROPERTY_SUBJECT_B, + GetExtendedCampaignOverview.JSON_PROPERTY_SPLIT_RULE, + GetExtendedCampaignOverview.JSON_PROPERTY_WINNER_CRITERIA, + GetExtendedCampaignOverview.JSON_PROPERTY_WINNER_DELAY, + GetExtendedCampaignOverview.JSON_PROPERTY_SEND_AT_BEST_TIME, + GetExtendedCampaignOverview.JSON_PROPERTY_TEST_SENT, + GetExtendedCampaignOverview.JSON_PROPERTY_HEADER, + GetExtendedCampaignOverview.JSON_PROPERTY_FOOTER, + GetExtendedCampaignOverview.JSON_PROPERTY_SENDER, + GetExtendedCampaignOverview.JSON_PROPERTY_REPLY_TO, + GetExtendedCampaignOverview.JSON_PROPERTY_TO_FIELD, + GetExtendedCampaignOverview.JSON_PROPERTY_HTML_CONTENT, + GetExtendedCampaignOverview.JSON_PROPERTY_SHARE_LINK, + GetExtendedCampaignOverview.JSON_PROPERTY_TAG, + GetExtendedCampaignOverview.JSON_PROPERTY_CREATED_AT, + GetExtendedCampaignOverview.JSON_PROPERTY_MODIFIED_AT, + GetExtendedCampaignOverview.JSON_PROPERTY_INLINE_IMAGE_ACTIVATION, + GetExtendedCampaignOverview.JSON_PROPERTY_MIRROR_ACTIVE, + GetExtendedCampaignOverview.JSON_PROPERTY_RECURRING, + GetExtendedCampaignOverview.JSON_PROPERTY_SENT_DATE, + GetExtendedCampaignOverview.JSON_PROPERTY_RETURN_BOUNCE +}) +@JsonTypeName("getExtendedCampaignOverview") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedCampaignOverview { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + /** + * Type of campaign + */ + public enum TypeEnum { + CLASSIC("classic"), + + TRIGGER("trigger"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** + * Status of the campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + IN_PROCESS("in_process"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Integer splitRule; + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private String winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Integer winnerDelay; + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime; + + public static final String JSON_PROPERTY_TEST_SENT = "testSent"; + private Boolean testSent; + + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_FOOTER = "footer"; + private String footer; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private GetExtendedCampaignOverviewAllOfSender sender; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_SHARE_LINK = "shareLink"; + private String shareLink; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_INLINE_IMAGE_ACTIVATION = "inlineImageActivation"; + private Boolean inlineImageActivation; + + public static final String JSON_PROPERTY_MIRROR_ACTIVE = "mirrorActive"; + private Boolean mirrorActive; + + public static final String JSON_PROPERTY_RECURRING = "recurring"; + private Boolean recurring; + + public static final String JSON_PROPERTY_SENT_DATE = "sentDate"; + private String sentDate; + + public static final String JSON_PROPERTY_RETURN_BOUNCE = "returnBounce"; + private Long returnBounce; + + public GetExtendedCampaignOverview() { + } + + public GetExtendedCampaignOverview id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetExtendedCampaignOverview name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetExtendedCampaignOverview subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetExtendedCampaignOverview previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public GetExtendedCampaignOverview type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of campaign + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetExtendedCampaignOverview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetExtendedCampaignOverview scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetExtendedCampaignOverview abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public GetExtendedCampaignOverview subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public GetExtendedCampaignOverview subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public GetExtendedCampaignOverview splitRule(Integer splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Integer splitRule) { + this.splitRule = splitRule; + } + + + public GetExtendedCampaignOverview winnerCriteria(String winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(String winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public GetExtendedCampaignOverview winnerDelay(Integer winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Integer winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public GetExtendedCampaignOverview sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * It is true if you have chosen to send your campaign at best time, otherwise it is false + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + + public GetExtendedCampaignOverview testSent(Boolean testSent) { + + this.testSent = testSent; + return this; + } + + /** + * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * @return testSent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getTestSent() { + return testSent; + } + + + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestSent(Boolean testSent) { + this.testSent = testSent; + } + + + public GetExtendedCampaignOverview header(String header) { + + this.header = header; + return this; + } + + /** + * Header of the campaign + * @return header + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHeader() { + return header; + } + + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeader(String header) { + this.header = header; + } + + + public GetExtendedCampaignOverview footer(String footer) { + + this.footer = footer; + return this; + } + + /** + * Footer of the campaign + * @return footer + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFooter() { + return footer; + } + + + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFooter(String footer) { + this.footer = footer; + } + + + public GetExtendedCampaignOverview sender(GetExtendedCampaignOverviewAllOfSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedCampaignOverviewAllOfSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(GetExtendedCampaignOverviewAllOfSender sender) { + this.sender = sender; + } + + + public GetExtendedCampaignOverview replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email defined as the \"Reply to\" of the campaign + * @return replyTo + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public GetExtendedCampaignOverview toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * Customisation of the \"to\" field of the campaign + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public GetExtendedCampaignOverview htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * HTML content of the campaign + * @return htmlContent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public GetExtendedCampaignOverview shareLink(String shareLink) { + + this.shareLink = shareLink; + return this; + } + + /** + * Link to share the campaign on social medias + * @return shareLink + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getShareLink() { + return shareLink; + } + + + @JsonProperty(JSON_PROPERTY_SHARE_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShareLink(String shareLink) { + this.shareLink = shareLink; + } + + + public GetExtendedCampaignOverview tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the campaign + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public GetExtendedCampaignOverview createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetExtendedCampaignOverview modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetExtendedCampaignOverview inlineImageActivation(Boolean inlineImageActivation) { + + this.inlineImageActivation = inlineImageActivation; + return this; + } + + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * @return inlineImageActivation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInlineImageActivation() { + return inlineImageActivation; + } + + + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInlineImageActivation(Boolean inlineImageActivation) { + this.inlineImageActivation = inlineImageActivation; + } + + + public GetExtendedCampaignOverview mirrorActive(Boolean mirrorActive) { + + this.mirrorActive = mirrorActive; + return this; + } + + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * @return mirrorActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMirrorActive() { + return mirrorActive; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMirrorActive(Boolean mirrorActive) { + this.mirrorActive = mirrorActive; + } + + + public GetExtendedCampaignOverview recurring(Boolean recurring) { + + this.recurring = recurring; + return this; + } + + /** + * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * @return recurring + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRecurring() { + return recurring; + } + + + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurring(Boolean recurring) { + this.recurring = recurring; + } + + + public GetExtendedCampaignOverview sentDate(String sentDate) { + + this.sentDate = sentDate; + return this; + } + + /** + * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * @return sentDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSentDate() { + return sentDate; + } + + + @JsonProperty(JSON_PROPERTY_SENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentDate(String sentDate) { + this.sentDate = sentDate; + } + + + public GetExtendedCampaignOverview returnBounce(Long returnBounce) { + + this.returnBounce = returnBounce; + return this; + } + + /** + * Total number of non-delivered campaigns for a particular campaign id. + * @return returnBounce + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReturnBounce() { + return returnBounce; + } + + + @JsonProperty(JSON_PROPERTY_RETURN_BOUNCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturnBounce(Long returnBounce) { + this.returnBounce = returnBounce; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedCampaignOverview getExtendedCampaignOverview = (GetExtendedCampaignOverview) o; + return Objects.equals(this.id, getExtendedCampaignOverview.id) && + Objects.equals(this.name, getExtendedCampaignOverview.name) && + Objects.equals(this.subject, getExtendedCampaignOverview.subject) && + Objects.equals(this.previewText, getExtendedCampaignOverview.previewText) && + Objects.equals(this.type, getExtendedCampaignOverview.type) && + Objects.equals(this.status, getExtendedCampaignOverview.status) && + Objects.equals(this.scheduledAt, getExtendedCampaignOverview.scheduledAt) && + Objects.equals(this.abTesting, getExtendedCampaignOverview.abTesting) && + Objects.equals(this.subjectA, getExtendedCampaignOverview.subjectA) && + Objects.equals(this.subjectB, getExtendedCampaignOverview.subjectB) && + Objects.equals(this.splitRule, getExtendedCampaignOverview.splitRule) && + Objects.equals(this.winnerCriteria, getExtendedCampaignOverview.winnerCriteria) && + Objects.equals(this.winnerDelay, getExtendedCampaignOverview.winnerDelay) && + Objects.equals(this.sendAtBestTime, getExtendedCampaignOverview.sendAtBestTime) && + Objects.equals(this.testSent, getExtendedCampaignOverview.testSent) && + Objects.equals(this.header, getExtendedCampaignOverview.header) && + Objects.equals(this.footer, getExtendedCampaignOverview.footer) && + Objects.equals(this.sender, getExtendedCampaignOverview.sender) && + Objects.equals(this.replyTo, getExtendedCampaignOverview.replyTo) && + Objects.equals(this.toField, getExtendedCampaignOverview.toField) && + Objects.equals(this.htmlContent, getExtendedCampaignOverview.htmlContent) && + Objects.equals(this.shareLink, getExtendedCampaignOverview.shareLink) && + Objects.equals(this.tag, getExtendedCampaignOverview.tag) && + Objects.equals(this.createdAt, getExtendedCampaignOverview.createdAt) && + Objects.equals(this.modifiedAt, getExtendedCampaignOverview.modifiedAt) && + Objects.equals(this.inlineImageActivation, getExtendedCampaignOverview.inlineImageActivation) && + Objects.equals(this.mirrorActive, getExtendedCampaignOverview.mirrorActive) && + Objects.equals(this.recurring, getExtendedCampaignOverview.recurring) && + Objects.equals(this.sentDate, getExtendedCampaignOverview.sentDate) && + Objects.equals(this.returnBounce, getExtendedCampaignOverview.returnBounce); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, subject, previewText, type, status, scheduledAt, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, sendAtBestTime, testSent, header, footer, sender, replyTo, toField, htmlContent, shareLink, tag, createdAt, modifiedAt, inlineImageActivation, mirrorActive, recurring, sentDate, returnBounce); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedCampaignOverview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).append("\n"); + sb.append(" testSent: ").append(toIndentedString(testSent)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" footer: ").append(toIndentedString(footer)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" shareLink: ").append(toIndentedString(shareLink)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" inlineImageActivation: ").append(toIndentedString(inlineImageActivation)).append("\n"); + sb.append(" mirrorActive: ").append(toIndentedString(mirrorActive)).append("\n"); + sb.append(" recurring: ").append(toIndentedString(recurring)).append("\n"); + sb.append(" sentDate: ").append(toIndentedString(sentDate)).append("\n"); + sb.append(" returnBounce: ").append(toIndentedString(returnBounce)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `testSent` to the URL query string + if (getTestSent() != null) { + try { + joiner.add(String.format("%stestSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTestSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header` to the URL query string + if (getHeader() != null) { + try { + joiner.add(String.format("%sheader%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `footer` to the URL query string + if (getFooter() != null) { + try { + joiner.add(String.format("%sfooter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `shareLink` to the URL query string + if (getShareLink() != null) { + try { + joiner.add(String.format("%sshareLink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShareLink()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inlineImageActivation` to the URL query string + if (getInlineImageActivation() != null) { + try { + joiner.add(String.format("%sinlineImageActivation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInlineImageActivation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mirrorActive` to the URL query string + if (getMirrorActive() != null) { + try { + joiner.add(String.format("%smirrorActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recurring` to the URL query string + if (getRecurring() != null) { + try { + joiner.add(String.format("%srecurring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecurring()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sentDate` to the URL query string + if (getSentDate() != null) { + try { + joiner.add(String.format("%ssentDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSentDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `returnBounce` to the URL query string + if (getReturnBounce() != null) { + try { + joiner.add(String.format("%sreturnBounce%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturnBounce()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverviewAllOfSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverviewAllOfSender.java new file mode 100644 index 0000000..19c5664 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignOverviewAllOfSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedCampaignOverviewAllOfSender + */ +@JsonPropertyOrder({ + GetExtendedCampaignOverviewAllOfSender.JSON_PROPERTY_NAME, + GetExtendedCampaignOverviewAllOfSender.JSON_PROPERTY_EMAIL, + GetExtendedCampaignOverviewAllOfSender.JSON_PROPERTY_ID +}) +@JsonTypeName("getExtendedCampaignOverview_allOf_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedCampaignOverviewAllOfSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public GetExtendedCampaignOverviewAllOfSender() { + } + + public GetExtendedCampaignOverviewAllOfSender name(String name) { + + this.name = name; + return this; + } + + /** + * Sender name of the campaign + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public GetExtendedCampaignOverviewAllOfSender email(String email) { + + this.email = email; + return this; + } + + /** + * Sender email of the campaign + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public GetExtendedCampaignOverviewAllOfSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Sender id of the campaign + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedCampaignOverviewAllOfSender getExtendedCampaignOverviewAllOfSender = (GetExtendedCampaignOverviewAllOfSender) o; + return Objects.equals(this.name, getExtendedCampaignOverviewAllOfSender.name) && + Objects.equals(this.email, getExtendedCampaignOverviewAllOfSender.email) && + Objects.equals(this.id, getExtendedCampaignOverviewAllOfSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedCampaignOverviewAllOfSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignStats.java new file mode 100644 index 0000000..07be2a6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedCampaignStats.java @@ -0,0 +1,462 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import software.xdev.brevo.model.GetCampaignStats; +import software.xdev.brevo.model.GetDeviceBrowserStats; +import software.xdev.brevo.model.GetStatsByDevice; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedCampaignStats + */ +@JsonPropertyOrder({ + GetExtendedCampaignStats.JSON_PROPERTY_GLOBAL_STATS, + GetExtendedCampaignStats.JSON_PROPERTY_CAMPAIGN_STATS, + GetExtendedCampaignStats.JSON_PROPERTY_MIRROR_CLICK, + GetExtendedCampaignStats.JSON_PROPERTY_REMAINING, + GetExtendedCampaignStats.JSON_PROPERTY_LINKS_STATS, + GetExtendedCampaignStats.JSON_PROPERTY_STATS_BY_DOMAIN, + GetExtendedCampaignStats.JSON_PROPERTY_STATS_BY_DEVICE, + GetExtendedCampaignStats.JSON_PROPERTY_STATS_BY_BROWSER +}) +@JsonTypeName("getExtendedCampaignStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedCampaignStats { + public static final String JSON_PROPERTY_GLOBAL_STATS = "globalStats"; + private GetCampaignStats globalStats; + + public static final String JSON_PROPERTY_CAMPAIGN_STATS = "campaignStats"; + private List campaignStats = new ArrayList<>(); + + public static final String JSON_PROPERTY_MIRROR_CLICK = "mirrorClick"; + private Long mirrorClick; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public static final String JSON_PROPERTY_LINKS_STATS = "linksStats"; + private Object linksStats; + + public static final String JSON_PROPERTY_STATS_BY_DOMAIN = "statsByDomain"; + private Map statsByDomain = new HashMap<>(); + + public static final String JSON_PROPERTY_STATS_BY_DEVICE = "statsByDevice"; + private GetStatsByDevice statsByDevice; + + public static final String JSON_PROPERTY_STATS_BY_BROWSER = "statsByBrowser"; + private Map statsByBrowser = new HashMap<>(); + + public GetExtendedCampaignStats() { + } + + public GetExtendedCampaignStats globalStats(GetCampaignStats globalStats) { + + this.globalStats = globalStats; + return this; + } + + /** + * Overall statistics of the campaign + * @return globalStats + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GLOBAL_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignStats getGlobalStats() { + return globalStats; + } + + + @JsonProperty(JSON_PROPERTY_GLOBAL_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGlobalStats(GetCampaignStats globalStats) { + this.globalStats = globalStats; + } + + + public GetExtendedCampaignStats campaignStats(List campaignStats) { + + this.campaignStats = campaignStats; + return this; + } + + public GetExtendedCampaignStats addCampaignStatsItem(GetCampaignStats campaignStatsItem) { + if (this.campaignStats == null) { + this.campaignStats = new ArrayList<>(); + } + this.campaignStats.add(campaignStatsItem); + return this; + } + + /** + * List-wise statistics of the campaign. + * @return campaignStats + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCampaignStats() { + return campaignStats; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignStats(List campaignStats) { + this.campaignStats = campaignStats; + } + + + public GetExtendedCampaignStats mirrorClick(Long mirrorClick) { + + this.mirrorClick = mirrorClick; + return this; + } + + /** + * Number of clicks on mirror link + * @return mirrorClick + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MIRROR_CLICK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getMirrorClick() { + return mirrorClick; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_CLICK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMirrorClick(Long mirrorClick) { + this.mirrorClick = mirrorClick; + } + + + public GetExtendedCampaignStats remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Number of remaning emails to send + * @return remaining + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + + public GetExtendedCampaignStats linksStats(Object linksStats) { + + this.linksStats = linksStats; + return this; + } + + /** + * Statistics about the number of clicks for the links + * @return linksStats + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getLinksStats() { + return linksStats; + } + + + @JsonProperty(JSON_PROPERTY_LINKS_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinksStats(Object linksStats) { + this.linksStats = linksStats; + } + + + public GetExtendedCampaignStats statsByDomain(Map statsByDomain) { + + this.statsByDomain = statsByDomain; + return this; + } + + public GetExtendedCampaignStats putStatsByDomainItem(String key, GetCampaignStats statsByDomainItem) { + this.statsByDomain.put(key, statsByDomainItem); + return this; + } + + /** + * Get statsByDomain + * @return statsByDomain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATS_BY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getStatsByDomain() { + return statsByDomain; + } + + + @JsonProperty(JSON_PROPERTY_STATS_BY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatsByDomain(Map statsByDomain) { + this.statsByDomain = statsByDomain; + } + + + public GetExtendedCampaignStats statsByDevice(GetStatsByDevice statsByDevice) { + + this.statsByDevice = statsByDevice; + return this; + } + + /** + * Get statsByDevice + * @return statsByDevice + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATS_BY_DEVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetStatsByDevice getStatsByDevice() { + return statsByDevice; + } + + + @JsonProperty(JSON_PROPERTY_STATS_BY_DEVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatsByDevice(GetStatsByDevice statsByDevice) { + this.statsByDevice = statsByDevice; + } + + + public GetExtendedCampaignStats statsByBrowser(Map statsByBrowser) { + + this.statsByBrowser = statsByBrowser; + return this; + } + + public GetExtendedCampaignStats putStatsByBrowserItem(String key, GetDeviceBrowserStats statsByBrowserItem) { + this.statsByBrowser.put(key, statsByBrowserItem); + return this; + } + + /** + * Get statsByBrowser + * @return statsByBrowser + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATS_BY_BROWSER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getStatsByBrowser() { + return statsByBrowser; + } + + + @JsonProperty(JSON_PROPERTY_STATS_BY_BROWSER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatsByBrowser(Map statsByBrowser) { + this.statsByBrowser = statsByBrowser; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedCampaignStats getExtendedCampaignStats = (GetExtendedCampaignStats) o; + return Objects.equals(this.globalStats, getExtendedCampaignStats.globalStats) && + Objects.equals(this.campaignStats, getExtendedCampaignStats.campaignStats) && + Objects.equals(this.mirrorClick, getExtendedCampaignStats.mirrorClick) && + Objects.equals(this.remaining, getExtendedCampaignStats.remaining) && + Objects.equals(this.linksStats, getExtendedCampaignStats.linksStats) && + Objects.equals(this.statsByDomain, getExtendedCampaignStats.statsByDomain) && + Objects.equals(this.statsByDevice, getExtendedCampaignStats.statsByDevice) && + Objects.equals(this.statsByBrowser, getExtendedCampaignStats.statsByBrowser); + } + + @Override + public int hashCode() { + return Objects.hash(globalStats, campaignStats, mirrorClick, remaining, linksStats, statsByDomain, statsByDevice, statsByBrowser); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedCampaignStats {\n"); + sb.append(" globalStats: ").append(toIndentedString(globalStats)).append("\n"); + sb.append(" campaignStats: ").append(toIndentedString(campaignStats)).append("\n"); + sb.append(" mirrorClick: ").append(toIndentedString(mirrorClick)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).append("\n"); + sb.append(" linksStats: ").append(toIndentedString(linksStats)).append("\n"); + sb.append(" statsByDomain: ").append(toIndentedString(statsByDomain)).append("\n"); + sb.append(" statsByDevice: ").append(toIndentedString(statsByDevice)).append("\n"); + sb.append(" statsByBrowser: ").append(toIndentedString(statsByBrowser)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `globalStats` to the URL query string + if (getGlobalStats() != null) { + joiner.add(getGlobalStats().toUrlQueryString(prefix + "globalStats" + suffix)); + } + + // add `campaignStats` to the URL query string + if (getCampaignStats() != null) { + for (int i = 0; i < getCampaignStats().size(); i++) { + if (getCampaignStats().get(i) != null) { + joiner.add(getCampaignStats().get(i).toUrlQueryString(String.format("%scampaignStats%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `mirrorClick` to the URL query string + if (getMirrorClick() != null) { + try { + joiner.add(String.format("%smirrorClick%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorClick()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `linksStats` to the URL query string + if (getLinksStats() != null) { + try { + joiner.add(String.format("%slinksStats%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLinksStats()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `statsByDomain` to the URL query string + if (getStatsByDomain() != null) { + for (String _key : getStatsByDomain().keySet()) { + if (getStatsByDomain().get(_key) != null) { + joiner.add(getStatsByDomain().get(_key).toUrlQueryString(String.format("%sstatsByDomain%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `statsByDevice` to the URL query string + if (getStatsByDevice() != null) { + joiner.add(getStatsByDevice().toUrlQueryString(prefix + "statsByDevice" + suffix)); + } + + // add `statsByBrowser` to the URL query string + if (getStatsByBrowser() != null) { + for (String _key : getStatsByBrowser().keySet()) { + if (getStatsByBrowser().get(_key) != null) { + joiner.add(getStatsByBrowser().get(_key).toUrlQueryString(String.format("%sstatsByBrowser%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClient.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClient.java new file mode 100644 index 0000000..bffba9a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClient.java @@ -0,0 +1,316 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetExtendedClientAllOfAddress; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedClient + */ +@JsonPropertyOrder({ + GetExtendedClient.JSON_PROPERTY_EMAIL, + GetExtendedClient.JSON_PROPERTY_FIRST_NAME, + GetExtendedClient.JSON_PROPERTY_LAST_NAME, + GetExtendedClient.JSON_PROPERTY_COMPANY_NAME, + GetExtendedClient.JSON_PROPERTY_ADDRESS +}) +@JsonTypeName("getExtendedClient") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedClient { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + private GetExtendedClientAllOfAddress address; + + public GetExtendedClient() { + } + + public GetExtendedClient email(String email) { + + this.email = email; + return this; + } + + /** + * Login Email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetExtendedClient firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First Name + * @return firstName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public GetExtendedClient lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last Name + * @return lastName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public GetExtendedClient companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public GetExtendedClient address(GetExtendedClientAllOfAddress address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedClientAllOfAddress getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(GetExtendedClientAllOfAddress address) { + this.address = address; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedClient getExtendedClient = (GetExtendedClient) o; + return Objects.equals(this.email, getExtendedClient.email) && + Objects.equals(this.firstName, getExtendedClient.firstName) && + Objects.equals(this.lastName, getExtendedClient.lastName) && + Objects.equals(this.companyName, getExtendedClient.companyName) && + Objects.equals(this.address, getExtendedClient.address); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedClient {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(getAddress().toUrlQueryString(prefix + "address" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClientAllOfAddress.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClientAllOfAddress.java new file mode 100644 index 0000000..4205a41 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedClientAllOfAddress.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Address informations + */ +@JsonPropertyOrder({ + GetExtendedClientAllOfAddress.JSON_PROPERTY_STREET, + GetExtendedClientAllOfAddress.JSON_PROPERTY_CITY, + GetExtendedClientAllOfAddress.JSON_PROPERTY_ZIP_CODE, + GetExtendedClientAllOfAddress.JSON_PROPERTY_COUNTRY +}) +@JsonTypeName("getExtendedClient_allOf_address") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedClientAllOfAddress { + public static final String JSON_PROPERTY_STREET = "street"; + private String street; + + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_ZIP_CODE = "zipCode"; + private String zipCode; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + public GetExtendedClientAllOfAddress() { + } + + public GetExtendedClientAllOfAddress street(String street) { + + this.street = street; + return this; + } + + /** + * Street information + * @return street + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStreet() { + return street; + } + + + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStreet(String street) { + this.street = street; + } + + + public GetExtendedClientAllOfAddress city(String city) { + + this.city = city; + return this; + } + + /** + * City information + * @return city + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCity(String city) { + this.city = city; + } + + + public GetExtendedClientAllOfAddress zipCode(String zipCode) { + + this.zipCode = zipCode; + return this; + } + + /** + * Zip Code information + * @return zipCode + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getZipCode() { + return zipCode; + } + + + @JsonProperty(JSON_PROPERTY_ZIP_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + + public GetExtendedClientAllOfAddress country(String country) { + + this.country = country; + return this; + } + + /** + * Country information + * @return country + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCountry() { + return country; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(String country) { + this.country = country; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedClientAllOfAddress getExtendedClientAllOfAddress = (GetExtendedClientAllOfAddress) o; + return Objects.equals(this.street, getExtendedClientAllOfAddress.street) && + Objects.equals(this.city, getExtendedClientAllOfAddress.city) && + Objects.equals(this.zipCode, getExtendedClientAllOfAddress.zipCode) && + Objects.equals(this.country, getExtendedClientAllOfAddress.country); + } + + @Override + public int hashCode() { + return Objects.hash(street, city, zipCode, country); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedClientAllOfAddress {\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" zipCode: ").append(toIndentedString(zipCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `street` to the URL query string + if (getStreet() != null) { + try { + joiner.add(String.format("%sstreet%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStreet()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `city` to the URL query string + if (getCity() != null) { + try { + joiner.add(String.format("%scity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `zipCode` to the URL query string + if (getZipCode() != null) { + try { + joiner.add(String.format("%szipCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getZipCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `country` to the URL query string + if (getCountry() != null) { + try { + joiner.add(String.format("%scountry%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCountry()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetails.java new file mode 100644 index 0000000..5157680 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetails.java @@ -0,0 +1,553 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatistics; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetails + */ +@JsonPropertyOrder({ + GetExtendedContactDetails.JSON_PROPERTY_EMAIL, + GetExtendedContactDetails.JSON_PROPERTY_ID, + GetExtendedContactDetails.JSON_PROPERTY_EMAIL_BLACKLISTED, + GetExtendedContactDetails.JSON_PROPERTY_SMS_BLACKLISTED, + GetExtendedContactDetails.JSON_PROPERTY_CREATED_AT, + GetExtendedContactDetails.JSON_PROPERTY_MODIFIED_AT, + GetExtendedContactDetails.JSON_PROPERTY_LIST_IDS, + GetExtendedContactDetails.JSON_PROPERTY_LIST_UNSUBSCRIBED, + GetExtendedContactDetails.JSON_PROPERTY_ATTRIBUTES, + GetExtendedContactDetails.JSON_PROPERTY_STATISTICS +}) +@JsonTypeName("getExtendedContactDetails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetails { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted"; + private Boolean emailBlacklisted; + + public static final String JSON_PROPERTY_SMS_BLACKLISTED = "smsBlacklisted"; + private Boolean smsBlacklisted; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_UNSUBSCRIBED = "listUnsubscribed"; + private List listUnsubscribed; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetExtendedContactDetailsAllOfStatistics statistics; + + public GetExtendedContactDetails() { + } + + public GetExtendedContactDetails email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the contact for which you requested the details + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public GetExtendedContactDetails id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the contact for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetExtendedContactDetails emailBlacklisted(Boolean emailBlacklisted) { + + this.emailBlacklisted = emailBlacklisted; + return this; + } + + /** + * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + * @return emailBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getEmailBlacklisted() { + return emailBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailBlacklisted(Boolean emailBlacklisted) { + this.emailBlacklisted = emailBlacklisted; + } + + + public GetExtendedContactDetails smsBlacklisted(Boolean smsBlacklisted) { + + this.smsBlacklisted = smsBlacklisted; + return this; + } + + /** + * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + * @return smsBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getSmsBlacklisted() { + return smsBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSmsBlacklisted(Boolean smsBlacklisted) { + this.smsBlacklisted = smsBlacklisted; + } + + + public GetExtendedContactDetails createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetExtendedContactDetails modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetExtendedContactDetails listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public GetExtendedContactDetails addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Get listIds + * @return listIds + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public GetExtendedContactDetails listUnsubscribed(List listUnsubscribed) { + + this.listUnsubscribed = listUnsubscribed; + return this; + } + + public GetExtendedContactDetails addListUnsubscribedItem(Long listUnsubscribedItem) { + if (this.listUnsubscribed == null) { + this.listUnsubscribed = new ArrayList<>(); + } + this.listUnsubscribed.add(listUnsubscribedItem); + return this; + } + + /** + * Get listUnsubscribed + * @return listUnsubscribed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListUnsubscribed() { + return listUnsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_LIST_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListUnsubscribed(List listUnsubscribed) { + this.listUnsubscribed = listUnsubscribed; + } + + + public GetExtendedContactDetails attributes(Object attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Set of attributes of the contact + * @return attributes + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Object getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + + public GetExtendedContactDetails statistics(GetExtendedContactDetailsAllOfStatistics statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetExtendedContactDetailsAllOfStatistics getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatistics(GetExtendedContactDetailsAllOfStatistics statistics) { + this.statistics = statistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetails getExtendedContactDetails = (GetExtendedContactDetails) o; + return Objects.equals(this.email, getExtendedContactDetails.email) && + Objects.equals(this.id, getExtendedContactDetails.id) && + Objects.equals(this.emailBlacklisted, getExtendedContactDetails.emailBlacklisted) && + Objects.equals(this.smsBlacklisted, getExtendedContactDetails.smsBlacklisted) && + Objects.equals(this.createdAt, getExtendedContactDetails.createdAt) && + Objects.equals(this.modifiedAt, getExtendedContactDetails.modifiedAt) && + Objects.equals(this.listIds, getExtendedContactDetails.listIds) && + Objects.equals(this.listUnsubscribed, getExtendedContactDetails.listUnsubscribed) && + Objects.equals(this.attributes, getExtendedContactDetails.attributes) && + Objects.equals(this.statistics, getExtendedContactDetails.statistics); + } + + @Override + public int hashCode() { + return Objects.hash(email, id, emailBlacklisted, smsBlacklisted, createdAt, modifiedAt, listIds, listUnsubscribed, attributes, statistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetails {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" emailBlacklisted: ").append(toIndentedString(emailBlacklisted)).append("\n"); + sb.append(" smsBlacklisted: ").append(toIndentedString(smsBlacklisted)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" listUnsubscribed: ").append(toIndentedString(listUnsubscribed)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emailBlacklisted` to the URL query string + if (getEmailBlacklisted() != null) { + try { + joiner.add(String.format("%semailBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklisted` to the URL query string + if (getSmsBlacklisted() != null) { + try { + joiner.add(String.format("%ssmsBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `listUnsubscribed` to the URL query string + if (getListUnsubscribed() != null) { + for (int i = 0; i < getListUnsubscribed().size(); i++) { + try { + joiner.add(String.format("%slistUnsubscribed%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListUnsubscribed().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + try { + joiner.add(String.format("%sattributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatistics.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatistics.java new file mode 100644 index 0000000..b134d0f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatistics.java @@ -0,0 +1,558 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsClicked; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsMessagesSent; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsOpened; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsUnsubscriptions; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Campaign statistics of the contact + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_MESSAGES_SENT, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_HARD_BOUNCES, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_SOFT_BOUNCES, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_COMPLAINTS, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_UNSUBSCRIPTIONS, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_OPENED, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_CLICKED, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_TRANSAC_ATTRIBUTES, + GetExtendedContactDetailsAllOfStatistics.JSON_PROPERTY_DELIVERED +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatistics { + public static final String JSON_PROPERTY_MESSAGES_SENT = "messagesSent"; + private List messagesSent; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private List hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private List softBounces; + + public static final String JSON_PROPERTY_COMPLAINTS = "complaints"; + private List complaints; + + public static final String JSON_PROPERTY_UNSUBSCRIPTIONS = "unsubscriptions"; + private GetExtendedContactDetailsAllOfStatisticsUnsubscriptions unsubscriptions; + + public static final String JSON_PROPERTY_OPENED = "opened"; + private List opened; + + public static final String JSON_PROPERTY_CLICKED = "clicked"; + private List clicked; + + public static final String JSON_PROPERTY_TRANSAC_ATTRIBUTES = "transacAttributes"; + private List transacAttributes; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private List delivered; + + public GetExtendedContactDetailsAllOfStatistics() { + } + + public GetExtendedContactDetailsAllOfStatistics messagesSent(List messagesSent) { + + this.messagesSent = messagesSent; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addMessagesSentItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent messagesSentItem) { + if (this.messagesSent == null) { + this.messagesSent = new ArrayList<>(); + } + this.messagesSent.add(messagesSentItem); + return this; + } + + /** + * Listing of the sent campaign for the contact + * @return messagesSent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMessagesSent() { + return messagesSent; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessagesSent(List messagesSent) { + this.messagesSent = messagesSent; + } + + + public GetExtendedContactDetailsAllOfStatistics hardBounces(List hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addHardBouncesItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent hardBouncesItem) { + if (this.hardBounces == null) { + this.hardBounces = new ArrayList<>(); + } + this.hardBounces.add(hardBouncesItem); + return this; + } + + /** + * Listing of the hardbounes generated by the contact + * @return hardBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardBounces(List hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetExtendedContactDetailsAllOfStatistics softBounces(List softBounces) { + + this.softBounces = softBounces; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addSoftBouncesItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent softBouncesItem) { + if (this.softBounces == null) { + this.softBounces = new ArrayList<>(); + } + this.softBounces.add(softBouncesItem); + return this; + } + + /** + * Listing of the softbounes generated by the contact + * @return softBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftBounces(List softBounces) { + this.softBounces = softBounces; + } + + + public GetExtendedContactDetailsAllOfStatistics complaints(List complaints) { + + this.complaints = complaints; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addComplaintsItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent complaintsItem) { + if (this.complaints == null) { + this.complaints = new ArrayList<>(); + } + this.complaints.add(complaintsItem); + return this; + } + + /** + * Listing of the complaints generated by the contact + * @return complaints + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getComplaints() { + return complaints; + } + + + @JsonProperty(JSON_PROPERTY_COMPLAINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplaints(List complaints) { + this.complaints = complaints; + } + + + public GetExtendedContactDetailsAllOfStatistics unsubscriptions(GetExtendedContactDetailsAllOfStatisticsUnsubscriptions unsubscriptions) { + + this.unsubscriptions = unsubscriptions; + return this; + } + + /** + * Get unsubscriptions + * @return unsubscriptions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions getUnsubscriptions() { + return unsubscriptions; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscriptions(GetExtendedContactDetailsAllOfStatisticsUnsubscriptions unsubscriptions) { + this.unsubscriptions = unsubscriptions; + } + + + public GetExtendedContactDetailsAllOfStatistics opened(List opened) { + + this.opened = opened; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addOpenedItem(GetExtendedContactDetailsAllOfStatisticsOpened openedItem) { + if (this.opened == null) { + this.opened = new ArrayList<>(); + } + this.opened.add(openedItem); + return this; + } + + /** + * Listing of the openings generated by the contact + * @return opened + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPENED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getOpened() { + return opened; + } + + + @JsonProperty(JSON_PROPERTY_OPENED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpened(List opened) { + this.opened = opened; + } + + + public GetExtendedContactDetailsAllOfStatistics clicked(List clicked) { + + this.clicked = clicked; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addClickedItem(GetExtendedContactDetailsAllOfStatisticsClicked clickedItem) { + if (this.clicked == null) { + this.clicked = new ArrayList<>(); + } + this.clicked.add(clickedItem); + return this; + } + + /** + * Listing of the clicks generated by the contact + * @return clicked + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLICKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getClicked() { + return clicked; + } + + + @JsonProperty(JSON_PROPERTY_CLICKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClicked(List clicked) { + this.clicked = clicked; + } + + + public GetExtendedContactDetailsAllOfStatistics transacAttributes(List transacAttributes) { + + this.transacAttributes = transacAttributes; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addTransacAttributesItem(Object transacAttributesItem) { + if (this.transacAttributes == null) { + this.transacAttributes = new ArrayList<>(); + } + this.transacAttributes.add(transacAttributesItem); + return this; + } + + /** + * Listing of the transactional attributes for the contact + * @return transacAttributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSAC_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTransacAttributes() { + return transacAttributes; + } + + + @JsonProperty(JSON_PROPERTY_TRANSAC_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransacAttributes(List transacAttributes) { + this.transacAttributes = transacAttributes; + } + + + public GetExtendedContactDetailsAllOfStatistics delivered(List delivered) { + + this.delivered = delivered; + return this; + } + + public GetExtendedContactDetailsAllOfStatistics addDeliveredItem(GetExtendedContactDetailsAllOfStatisticsMessagesSent deliveredItem) { + if (this.delivered == null) { + this.delivered = new ArrayList<>(); + } + this.delivered.add(deliveredItem); + return this; + } + + /** + * Listing of the delivered campaign for the contact + * @return delivered + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelivered(List delivered) { + this.delivered = delivered; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatistics getExtendedContactDetailsAllOfStatistics = (GetExtendedContactDetailsAllOfStatistics) o; + return Objects.equals(this.messagesSent, getExtendedContactDetailsAllOfStatistics.messagesSent) && + Objects.equals(this.hardBounces, getExtendedContactDetailsAllOfStatistics.hardBounces) && + Objects.equals(this.softBounces, getExtendedContactDetailsAllOfStatistics.softBounces) && + Objects.equals(this.complaints, getExtendedContactDetailsAllOfStatistics.complaints) && + Objects.equals(this.unsubscriptions, getExtendedContactDetailsAllOfStatistics.unsubscriptions) && + Objects.equals(this.opened, getExtendedContactDetailsAllOfStatistics.opened) && + Objects.equals(this.clicked, getExtendedContactDetailsAllOfStatistics.clicked) && + Objects.equals(this.transacAttributes, getExtendedContactDetailsAllOfStatistics.transacAttributes) && + Objects.equals(this.delivered, getExtendedContactDetailsAllOfStatistics.delivered); + } + + @Override + public int hashCode() { + return Objects.hash(messagesSent, hardBounces, softBounces, complaints, unsubscriptions, opened, clicked, transacAttributes, delivered); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatistics {\n"); + sb.append(" messagesSent: ").append(toIndentedString(messagesSent)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" complaints: ").append(toIndentedString(complaints)).append("\n"); + sb.append(" unsubscriptions: ").append(toIndentedString(unsubscriptions)).append("\n"); + sb.append(" opened: ").append(toIndentedString(opened)).append("\n"); + sb.append(" clicked: ").append(toIndentedString(clicked)).append("\n"); + sb.append(" transacAttributes: ").append(toIndentedString(transacAttributes)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `messagesSent` to the URL query string + if (getMessagesSent() != null) { + for (int i = 0; i < getMessagesSent().size(); i++) { + if (getMessagesSent().get(i) != null) { + joiner.add(getMessagesSent().get(i).toUrlQueryString(String.format("%smessagesSent%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + for (int i = 0; i < getHardBounces().size(); i++) { + if (getHardBounces().get(i) != null) { + joiner.add(getHardBounces().get(i).toUrlQueryString(String.format("%shardBounces%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + for (int i = 0; i < getSoftBounces().size(); i++) { + if (getSoftBounces().get(i) != null) { + joiner.add(getSoftBounces().get(i).toUrlQueryString(String.format("%ssoftBounces%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `complaints` to the URL query string + if (getComplaints() != null) { + for (int i = 0; i < getComplaints().size(); i++) { + if (getComplaints().get(i) != null) { + joiner.add(getComplaints().get(i).toUrlQueryString(String.format("%scomplaints%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `unsubscriptions` to the URL query string + if (getUnsubscriptions() != null) { + joiner.add(getUnsubscriptions().toUrlQueryString(prefix + "unsubscriptions" + suffix)); + } + + // add `opened` to the URL query string + if (getOpened() != null) { + for (int i = 0; i < getOpened().size(); i++) { + if (getOpened().get(i) != null) { + joiner.add(getOpened().get(i).toUrlQueryString(String.format("%sopened%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `clicked` to the URL query string + if (getClicked() != null) { + for (int i = 0; i < getClicked().size(); i++) { + if (getClicked().get(i) != null) { + joiner.add(getClicked().get(i).toUrlQueryString(String.format("%sclicked%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `transacAttributes` to the URL query string + if (getTransacAttributes() != null) { + for (int i = 0; i < getTransacAttributes().size(); i++) { + try { + joiner.add(String.format("%stransacAttributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getTransacAttributes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + for (int i = 0; i < getDelivered().size(); i++) { + if (getDelivered().get(i) != null) { + joiner.add(getDelivered().get(i).toUrlQueryString(String.format("%sdelivered%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsClicked.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsClicked.java new file mode 100644 index 0000000..000f15b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsClicked.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsLinks; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsClicked + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsClicked.JSON_PROPERTY_CAMPAIGN_ID, + GetExtendedContactDetailsAllOfStatisticsClicked.JSON_PROPERTY_LINKS +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_clicked") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsClicked { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = new ArrayList<>(); + + public GetExtendedContactDetailsAllOfStatisticsClicked() { + } + + public GetExtendedContactDetailsAllOfStatisticsClicked campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetExtendedContactDetailsAllOfStatisticsClicked links(List links) { + + this.links = links; + return this; + } + + public GetExtendedContactDetailsAllOfStatisticsClicked addLinksItem(GetExtendedContactDetailsAllOfStatisticsLinks linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Listing of the clicked links for the campaign + * @return links + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getLinks() { + return links; + } + + + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLinks(List links) { + this.links = links; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsClicked getExtendedContactDetailsAllOfStatisticsClicked = (GetExtendedContactDetailsAllOfStatisticsClicked) o; + return Objects.equals(this.campaignId, getExtendedContactDetailsAllOfStatisticsClicked.campaignId) && + Objects.equals(this.links, getExtendedContactDetailsAllOfStatisticsClicked.links); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, links); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsClicked {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `links` to the URL query string + if (getLinks() != null) { + for (int i = 0; i < getLinks().size(); i++) { + if (getLinks().get(i) != null) { + joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsLinks.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsLinks.java new file mode 100644 index 0000000..849fafe --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsLinks.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsLinks + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsLinks.JSON_PROPERTY_COUNT, + GetExtendedContactDetailsAllOfStatisticsLinks.JSON_PROPERTY_EVENT_TIME, + GetExtendedContactDetailsAllOfStatisticsLinks.JSON_PROPERTY_IP, + GetExtendedContactDetailsAllOfStatisticsLinks.JSON_PROPERTY_URL +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_links") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsLinks { + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public GetExtendedContactDetailsAllOfStatisticsLinks() { + } + + public GetExtendedContactDetailsAllOfStatisticsLinks count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of clicks on this link for the campaign + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + + public GetExtendedContactDetailsAllOfStatisticsLinks eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + + public GetExtendedContactDetailsAllOfStatisticsLinks ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has clicked on the link + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + + public GetExtendedContactDetailsAllOfStatisticsLinks url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the clicked link + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsLinks getExtendedContactDetailsAllOfStatisticsLinks = (GetExtendedContactDetailsAllOfStatisticsLinks) o; + return Objects.equals(this.count, getExtendedContactDetailsAllOfStatisticsLinks.count) && + Objects.equals(this.eventTime, getExtendedContactDetailsAllOfStatisticsLinks.eventTime) && + Objects.equals(this.ip, getExtendedContactDetailsAllOfStatisticsLinks.ip) && + Objects.equals(this.url, getExtendedContactDetailsAllOfStatisticsLinks.url); + } + + @Override + public int hashCode() { + return Objects.hash(count, eventTime, ip, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsLinks {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.java new file mode 100644 index 0000000..3f3958c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsMessagesSent.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsMessagesSent + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsMessagesSent.JSON_PROPERTY_CAMPAIGN_ID, + GetExtendedContactDetailsAllOfStatisticsMessagesSent.JSON_PROPERTY_EVENT_TIME +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_messagesSent") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsMessagesSent { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public GetExtendedContactDetailsAllOfStatisticsMessagesSent() { + } + + public GetExtendedContactDetailsAllOfStatisticsMessagesSent campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetExtendedContactDetailsAllOfStatisticsMessagesSent eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsMessagesSent getExtendedContactDetailsAllOfStatisticsMessagesSent = (GetExtendedContactDetailsAllOfStatisticsMessagesSent) o; + return Objects.equals(this.campaignId, getExtendedContactDetailsAllOfStatisticsMessagesSent.campaignId) && + Objects.equals(this.eventTime, getExtendedContactDetailsAllOfStatisticsMessagesSent.eventTime); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, eventTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsMessagesSent {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsOpened.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsOpened.java new file mode 100644 index 0000000..a7220e5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsOpened.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsOpened + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsOpened.JSON_PROPERTY_CAMPAIGN_ID, + GetExtendedContactDetailsAllOfStatisticsOpened.JSON_PROPERTY_COUNT, + GetExtendedContactDetailsAllOfStatisticsOpened.JSON_PROPERTY_EVENT_TIME, + GetExtendedContactDetailsAllOfStatisticsOpened.JSON_PROPERTY_IP +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_opened") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsOpened { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public GetExtendedContactDetailsAllOfStatisticsOpened() { + } + + public GetExtendedContactDetailsAllOfStatisticsOpened campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetExtendedContactDetailsAllOfStatisticsOpened count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of openings for the campaign + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + + public GetExtendedContactDetailsAllOfStatisticsOpened eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + + public GetExtendedContactDetailsAllOfStatisticsOpened ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has opened the email + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsOpened getExtendedContactDetailsAllOfStatisticsOpened = (GetExtendedContactDetailsAllOfStatisticsOpened) o; + return Objects.equals(this.campaignId, getExtendedContactDetailsAllOfStatisticsOpened.campaignId) && + Objects.equals(this.count, getExtendedContactDetailsAllOfStatisticsOpened.count) && + Objects.equals(this.eventTime, getExtendedContactDetailsAllOfStatisticsOpened.eventTime) && + Objects.equals(this.ip, getExtendedContactDetailsAllOfStatisticsOpened.ip); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, count, eventTime, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsOpened {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.java new file mode 100644 index 0000000..091f3b2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.java @@ -0,0 +1,215 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription; +import software.xdev.brevo.model.GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Listing of the unsubscription for the contact + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.JSON_PROPERTY_USER_UNSUBSCRIPTION, + GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.JSON_PROPERTY_ADMIN_UNSUBSCRIPTION +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_unsubscriptions") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsUnsubscriptions { + public static final String JSON_PROPERTY_USER_UNSUBSCRIPTION = "userUnsubscription"; + private List userUnsubscription = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMIN_UNSUBSCRIPTION = "adminUnsubscription"; + private List adminUnsubscription = new ArrayList<>(); + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions() { + } + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions userUnsubscription(List userUnsubscription) { + + this.userUnsubscription = userUnsubscription; + return this; + } + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions addUserUnsubscriptionItem(GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription userUnsubscriptionItem) { + if (this.userUnsubscription == null) { + this.userUnsubscription = new ArrayList<>(); + } + this.userUnsubscription.add(userUnsubscriptionItem); + return this; + } + + /** + * Contact unsubscribe via unsubscription link in a campaign + * @return userUnsubscription + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USER_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getUserUnsubscription() { + return userUnsubscription; + } + + + @JsonProperty(JSON_PROPERTY_USER_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUserUnsubscription(List userUnsubscription) { + this.userUnsubscription = userUnsubscription; + } + + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions adminUnsubscription(List adminUnsubscription) { + + this.adminUnsubscription = adminUnsubscription; + return this; + } + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptions addAdminUnsubscriptionItem(GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription adminUnsubscriptionItem) { + if (this.adminUnsubscription == null) { + this.adminUnsubscription = new ArrayList<>(); + } + this.adminUnsubscription.add(adminUnsubscriptionItem); + return this; + } + + /** + * Contact has been unsubscribed from the administrator + * @return adminUnsubscription + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADMIN_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAdminUnsubscription() { + return adminUnsubscription; + } + + + @JsonProperty(JSON_PROPERTY_ADMIN_UNSUBSCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAdminUnsubscription(List adminUnsubscription) { + this.adminUnsubscription = adminUnsubscription; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsUnsubscriptions getExtendedContactDetailsAllOfStatisticsUnsubscriptions = (GetExtendedContactDetailsAllOfStatisticsUnsubscriptions) o; + return Objects.equals(this.userUnsubscription, getExtendedContactDetailsAllOfStatisticsUnsubscriptions.userUnsubscription) && + Objects.equals(this.adminUnsubscription, getExtendedContactDetailsAllOfStatisticsUnsubscriptions.adminUnsubscription); + } + + @Override + public int hashCode() { + return Objects.hash(userUnsubscription, adminUnsubscription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsUnsubscriptions {\n"); + sb.append(" userUnsubscription: ").append(toIndentedString(userUnsubscription)).append("\n"); + sb.append(" adminUnsubscription: ").append(toIndentedString(adminUnsubscription)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `userUnsubscription` to the URL query string + if (getUserUnsubscription() != null) { + for (int i = 0; i < getUserUnsubscription().size(); i++) { + if (getUserUnsubscription().get(i) != null) { + joiner.add(getUserUnsubscription().get(i).toUrlQueryString(String.format("%suserUnsubscription%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `adminUnsubscription` to the URL query string + if (getAdminUnsubscription() != null) { + for (int i = 0; i < getAdminUnsubscription().size(); i++) { + if (getAdminUnsubscription().get(i) != null) { + joiner.add(getAdminUnsubscription().get(i).toUrlQueryString(String.format("%sadminUnsubscription%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.java new file mode 100644 index 0000000..47ac977 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.JSON_PROPERTY_EVENT_TIME, + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.JSON_PROPERTY_IP +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_unsubscriptions_adminUnsubscription") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription { + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription() { + } + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has been unsubscribed + * @return ip + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription = (GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription) o; + return Objects.equals(this.eventTime, getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.eventTime) && + Objects.equals(this.ip, getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ip); + } + + @Override + public int hashCode() { + return Objects.hash(eventTime, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription {\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.java new file mode 100644 index 0000000..6b41370 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription + */ +@JsonPropertyOrder({ + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.JSON_PROPERTY_CAMPAIGN_ID, + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.JSON_PROPERTY_EVENT_TIME, + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.JSON_PROPERTY_IP +}) +@JsonTypeName("getExtendedContactDetails_allOf_statistics_unsubscriptions_userUnsubscription") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_EVENT_TIME = "eventTime"; + private String eventTime; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription() { + } + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign which generated the event + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription eventTime(String eventTime) { + + this.eventTime = eventTime; + return this; + } + + /** + * UTC date-time of the event + * @return eventTime + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; + } + + + public GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP from which the user has unsubscribed + * @return ip + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription = (GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription) o; + return Objects.equals(this.campaignId, getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.campaignId) && + Objects.equals(this.eventTime, getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.eventTime) && + Objects.equals(this.ip, getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ip); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, eventTime, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `eventTime` to the URL query string + if (getEventTime() != null) { + try { + joiner.add(String.format("%seventTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedList.java new file mode 100644 index 0000000..b6cbf1e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedList.java @@ -0,0 +1,500 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExtendedListAllOfCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedList + */ +@JsonPropertyOrder({ + GetExtendedList.JSON_PROPERTY_ID, + GetExtendedList.JSON_PROPERTY_NAME, + GetExtendedList.JSON_PROPERTY_TOTAL_BLACKLISTED, + GetExtendedList.JSON_PROPERTY_TOTAL_SUBSCRIBERS, + GetExtendedList.JSON_PROPERTY_UNIQUE_SUBSCRIBERS, + GetExtendedList.JSON_PROPERTY_FOLDER_ID, + GetExtendedList.JSON_PROPERTY_CREATED_AT, + GetExtendedList.JSON_PROPERTY_CAMPAIGN_STATS, + GetExtendedList.JSON_PROPERTY_DYNAMIC_LIST +}) +@JsonTypeName("getExtendedList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedList { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TOTAL_BLACKLISTED = "totalBlacklisted"; + private Long totalBlacklisted; + + public static final String JSON_PROPERTY_TOTAL_SUBSCRIBERS = "totalSubscribers"; + private Long totalSubscribers; + + public static final String JSON_PROPERTY_UNIQUE_SUBSCRIBERS = "uniqueSubscribers"; + private Long uniqueSubscribers; + + public static final String JSON_PROPERTY_FOLDER_ID = "folderId"; + private Long folderId; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_CAMPAIGN_STATS = "campaignStats"; + private List campaignStats; + + public static final String JSON_PROPERTY_DYNAMIC_LIST = "dynamicList"; + private Boolean dynamicList; + + public GetExtendedList() { + } + + public GetExtendedList id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the list + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetExtendedList name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the list + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetExtendedList totalBlacklisted(Long totalBlacklisted) { + + this.totalBlacklisted = totalBlacklisted; + return this; + } + + /** + * Number of blacklisted contacts in the list + * @return totalBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalBlacklisted() { + return totalBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalBlacklisted(Long totalBlacklisted) { + this.totalBlacklisted = totalBlacklisted; + } + + + public GetExtendedList totalSubscribers(Long totalSubscribers) { + + this.totalSubscribers = totalSubscribers; + return this; + } + + /** + * Number of contacts in the list + * @return totalSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalSubscribers() { + return totalSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalSubscribers(Long totalSubscribers) { + this.totalSubscribers = totalSubscribers; + } + + + public GetExtendedList uniqueSubscribers(Long uniqueSubscribers) { + + this.uniqueSubscribers = uniqueSubscribers; + return this; + } + + /** + * Number of unique contacts in the list + * @return uniqueSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueSubscribers() { + return uniqueSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueSubscribers(Long uniqueSubscribers) { + this.uniqueSubscribers = uniqueSubscribers; + } + + + public GetExtendedList folderId(Long folderId) { + + this.folderId = folderId; + return this; + } + + /** + * ID of the folder + * @return folderId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getFolderId() { + return folderId; + } + + + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + + public GetExtendedList createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetExtendedList campaignStats(List campaignStats) { + + this.campaignStats = campaignStats; + return this; + } + + public GetExtendedList addCampaignStatsItem(GetExtendedListAllOfCampaignStats campaignStatsItem) { + if (this.campaignStats == null) { + this.campaignStats = new ArrayList<>(); + } + this.campaignStats.add(campaignStatsItem); + return this; + } + + /** + * Get campaignStats + * @return campaignStats + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCampaignStats() { + return campaignStats; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaignStats(List campaignStats) { + this.campaignStats = campaignStats; + } + + + public GetExtendedList dynamicList(Boolean dynamicList) { + + this.dynamicList = dynamicList; + return this; + } + + /** + * Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) + * @return dynamicList + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DYNAMIC_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDynamicList() { + return dynamicList; + } + + + @JsonProperty(JSON_PROPERTY_DYNAMIC_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDynamicList(Boolean dynamicList) { + this.dynamicList = dynamicList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedList getExtendedList = (GetExtendedList) o; + return Objects.equals(this.id, getExtendedList.id) && + Objects.equals(this.name, getExtendedList.name) && + Objects.equals(this.totalBlacklisted, getExtendedList.totalBlacklisted) && + Objects.equals(this.totalSubscribers, getExtendedList.totalSubscribers) && + Objects.equals(this.uniqueSubscribers, getExtendedList.uniqueSubscribers) && + Objects.equals(this.folderId, getExtendedList.folderId) && + Objects.equals(this.createdAt, getExtendedList.createdAt) && + Objects.equals(this.campaignStats, getExtendedList.campaignStats) && + Objects.equals(this.dynamicList, getExtendedList.dynamicList); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, totalBlacklisted, totalSubscribers, uniqueSubscribers, folderId, createdAt, campaignStats, dynamicList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedList {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" totalBlacklisted: ").append(toIndentedString(totalBlacklisted)).append("\n"); + sb.append(" totalSubscribers: ").append(toIndentedString(totalSubscribers)).append("\n"); + sb.append(" uniqueSubscribers: ").append(toIndentedString(uniqueSubscribers)).append("\n"); + sb.append(" folderId: ").append(toIndentedString(folderId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" campaignStats: ").append(toIndentedString(campaignStats)).append("\n"); + sb.append(" dynamicList: ").append(toIndentedString(dynamicList)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalBlacklisted` to the URL query string + if (getTotalBlacklisted() != null) { + try { + joiner.add(String.format("%stotalBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalSubscribers` to the URL query string + if (getTotalSubscribers() != null) { + try { + joiner.add(String.format("%stotalSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueSubscribers` to the URL query string + if (getUniqueSubscribers() != null) { + try { + joiner.add(String.format("%suniqueSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `folderId` to the URL query string + if (getFolderId() != null) { + try { + joiner.add(String.format("%sfolderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFolderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignStats` to the URL query string + if (getCampaignStats() != null) { + for (int i = 0; i < getCampaignStats().size(); i++) { + if (getCampaignStats().get(i) != null) { + joiner.add(getCampaignStats().get(i).toUrlQueryString(String.format("%scampaignStats%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `dynamicList` to the URL query string + if (getDynamicList() != null) { + try { + joiner.add(String.format("%sdynamicList%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDynamicList()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedListAllOfCampaignStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedListAllOfCampaignStats.java new file mode 100644 index 0000000..36cbc06 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExtendedListAllOfCampaignStats.java @@ -0,0 +1,190 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExtendedListAllOfCampaignStats + */ +@JsonPropertyOrder({ + GetExtendedListAllOfCampaignStats.JSON_PROPERTY_CAMPAIGN_ID, + GetExtendedListAllOfCampaignStats.JSON_PROPERTY_STATS +}) +@JsonTypeName("getExtendedList_allOf_campaignStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExtendedListAllOfCampaignStats { + public static final String JSON_PROPERTY_CAMPAIGN_ID = "campaignId"; + private Long campaignId; + + public static final String JSON_PROPERTY_STATS = "stats"; + private GetCampaignStats stats; + + public GetExtendedListAllOfCampaignStats() { + } + + public GetExtendedListAllOfCampaignStats campaignId(Long campaignId) { + + this.campaignId = campaignId; + return this; + } + + /** + * ID of the campaign + * @return campaignId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCampaignId() { + return campaignId; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignId(Long campaignId) { + this.campaignId = campaignId; + } + + + public GetExtendedListAllOfCampaignStats stats(GetCampaignStats stats) { + + this.stats = stats; + return this; + } + + /** + * Get stats + * @return stats + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignStats getStats() { + return stats; + } + + + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStats(GetCampaignStats stats) { + this.stats = stats; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExtendedListAllOfCampaignStats getExtendedListAllOfCampaignStats = (GetExtendedListAllOfCampaignStats) o; + return Objects.equals(this.campaignId, getExtendedListAllOfCampaignStats.campaignId) && + Objects.equals(this.stats, getExtendedListAllOfCampaignStats.stats); + } + + @Override + public int hashCode() { + return Objects.hash(campaignId, stats); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExtendedListAllOfCampaignStats {\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignId` to the URL query string + if (getCampaignId() != null) { + try { + joiner.add(String.format("%scampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `stats` to the URL query string + if (getStats() != null) { + joiner.add(getStats().toUrlQueryString(prefix + "stats" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUID.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUID.java new file mode 100644 index 0000000..a7b00b9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUID.java @@ -0,0 +1,666 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExternalFeedByUUIDHeadersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExternalFeedByUUID + */ +@JsonPropertyOrder({ + GetExternalFeedByUUID.JSON_PROPERTY_ID, + GetExternalFeedByUUID.JSON_PROPERTY_NAME, + GetExternalFeedByUUID.JSON_PROPERTY_URL, + GetExternalFeedByUUID.JSON_PROPERTY_AUTH_TYPE, + GetExternalFeedByUUID.JSON_PROPERTY_USERNAME, + GetExternalFeedByUUID.JSON_PROPERTY_PASSWORD, + GetExternalFeedByUUID.JSON_PROPERTY_TOKEN, + GetExternalFeedByUUID.JSON_PROPERTY_HEADERS, + GetExternalFeedByUUID.JSON_PROPERTY_MAX_RETRIES, + GetExternalFeedByUUID.JSON_PROPERTY_CACHE, + GetExternalFeedByUUID.JSON_PROPERTY_CREATED_AT, + GetExternalFeedByUUID.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getExternalFeedByUUID") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExternalFeedByUUID { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + */ + public enum AuthTypeEnum { + BASIC("basic"), + + TOKEN("token"), + + NOAUTH("noAuth"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_AUTH_TYPE = "authType"; + private AuthTypeEnum authType; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_RETRIES = "maxRetries"; + private Integer maxRetries = 5; + + public static final String JSON_PROPERTY_CACHE = "cache"; + private Boolean cache; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private OffsetDateTime modifiedAt; + + public GetExternalFeedByUUID() { + } + + public GetExternalFeedByUUID id(String id) { + + this.id = id; + return this; + } + + /** + * ID of the feed + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public GetExternalFeedByUUID name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the feed + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetExternalFeedByUUID url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the feed + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + + public GetExternalFeedByUUID authType(AuthTypeEnum authType) { + + this.authType = authType; + return this; + } + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + * @return authType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AuthTypeEnum getAuthType() { + return authType; + } + + + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAuthType(AuthTypeEnum authType) { + this.authType = authType; + } + + + public GetExternalFeedByUUID username(String username) { + + this.username = username; + return this; + } + + /** + * Username for authType `basic` + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + + public GetExternalFeedByUUID password(String password) { + + this.password = password; + return this; + } + + /** + * Password for authType `basic` + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + + public GetExternalFeedByUUID token(String token) { + + this.token = token; + return this; + } + + /** + * Token for authType `token` + * @return token + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(String token) { + this.token = token; + } + + + public GetExternalFeedByUUID headers(List headers) { + + this.headers = headers; + return this; + } + + public GetExternalFeedByUUID addHeadersItem(GetExternalFeedByUUIDHeadersInner headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Custom headers for the feed + * @return headers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeaders(List headers) { + this.headers = headers; + } + + + public GetExternalFeedByUUID maxRetries(Integer maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Maximum number of retries on the feed url + * minimum: 0 + * maximum: 5 + * @return maxRetries + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getMaxRetries() { + return maxRetries; + } + + + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + + public GetExternalFeedByUUID cache(Boolean cache) { + + this.cache = cache; + return this; + } + + /** + * Toggle caching of feed url response + * @return cache + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getCache() { + return cache; + } + + + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCache(Boolean cache) { + this.cache = cache; + } + + + public GetExternalFeedByUUID createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the feed was created + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetExternalFeedByUUID modifiedAt(OffsetDateTime modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Datetime on which the feed was modified + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExternalFeedByUUID getExternalFeedByUUID = (GetExternalFeedByUUID) o; + return Objects.equals(this.id, getExternalFeedByUUID.id) && + Objects.equals(this.name, getExternalFeedByUUID.name) && + Objects.equals(this.url, getExternalFeedByUUID.url) && + Objects.equals(this.authType, getExternalFeedByUUID.authType) && + Objects.equals(this.username, getExternalFeedByUUID.username) && + Objects.equals(this.password, getExternalFeedByUUID.password) && + Objects.equals(this.token, getExternalFeedByUUID.token) && + Objects.equals(this.headers, getExternalFeedByUUID.headers) && + Objects.equals(this.maxRetries, getExternalFeedByUUID.maxRetries) && + Objects.equals(this.cache, getExternalFeedByUUID.cache) && + Objects.equals(this.createdAt, getExternalFeedByUUID.createdAt) && + Objects.equals(this.modifiedAt, getExternalFeedByUUID.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url, authType, username, password, token, headers, maxRetries, cache, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExternalFeedByUUID {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" cache: ").append(toIndentedString(cache)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authType` to the URL query string + if (getAuthType() != null) { + try { + joiner.add(String.format("%sauthType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `username` to the URL query string + if (getUsername() != null) { + try { + joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `token` to the URL query string + if (getToken() != null) { + try { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToken()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + if (getHeaders().get(i) != null) { + joiner.add(getHeaders().get(i).toUrlQueryString(String.format("%sheaders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `maxRetries` to the URL query string + if (getMaxRetries() != null) { + try { + joiner.add(String.format("%smaxRetries%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMaxRetries()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `cache` to the URL query string + if (getCache() != null) { + try { + joiner.add(String.format("%scache%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCache()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUIDHeadersInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUIDHeadersInner.java new file mode 100644 index 0000000..9c246e1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetExternalFeedByUUIDHeadersInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetExternalFeedByUUIDHeadersInner + */ +@JsonPropertyOrder({ + GetExternalFeedByUUIDHeadersInner.JSON_PROPERTY_NAME, + GetExternalFeedByUUIDHeadersInner.JSON_PROPERTY_VALUE +}) +@JsonTypeName("getExternalFeedByUUID_headers_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetExternalFeedByUUIDHeadersInner { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public GetExternalFeedByUUIDHeadersInner() { + } + + public GetExternalFeedByUUIDHeadersInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the header + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public GetExternalFeedByUUIDHeadersInner value(String value) { + + this.value = value; + return this; + } + + /** + * Value of the header + * @return value + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExternalFeedByUUIDHeadersInner getExternalFeedByUUIDHeadersInner = (GetExternalFeedByUUIDHeadersInner) o; + return Objects.equals(this.name, getExternalFeedByUUIDHeadersInner.name) && + Objects.equals(this.value, getExternalFeedByUUIDHeadersInner.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetExternalFeedByUUIDHeadersInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolder.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolder.java new file mode 100644 index 0000000..a9eb184 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolder.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetFolder + */ +@JsonPropertyOrder({ + GetFolder.JSON_PROPERTY_ID, + GetFolder.JSON_PROPERTY_NAME, + GetFolder.JSON_PROPERTY_TOTAL_BLACKLISTED, + GetFolder.JSON_PROPERTY_TOTAL_SUBSCRIBERS, + GetFolder.JSON_PROPERTY_UNIQUE_SUBSCRIBERS +}) +@JsonTypeName("getFolder") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetFolder { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TOTAL_BLACKLISTED = "totalBlacklisted"; + private Long totalBlacklisted; + + public static final String JSON_PROPERTY_TOTAL_SUBSCRIBERS = "totalSubscribers"; + private Long totalSubscribers; + + public static final String JSON_PROPERTY_UNIQUE_SUBSCRIBERS = "uniqueSubscribers"; + private Long uniqueSubscribers; + + public GetFolder() { + } + + public GetFolder id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the folder + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetFolder name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the folder + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetFolder totalBlacklisted(Long totalBlacklisted) { + + this.totalBlacklisted = totalBlacklisted; + return this; + } + + /** + * Number of blacklisted contacts in the folder + * @return totalBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalBlacklisted() { + return totalBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalBlacklisted(Long totalBlacklisted) { + this.totalBlacklisted = totalBlacklisted; + } + + + public GetFolder totalSubscribers(Long totalSubscribers) { + + this.totalSubscribers = totalSubscribers; + return this; + } + + /** + * Number of contacts in the folder + * @return totalSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalSubscribers() { + return totalSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalSubscribers(Long totalSubscribers) { + this.totalSubscribers = totalSubscribers; + } + + + public GetFolder uniqueSubscribers(Long uniqueSubscribers) { + + this.uniqueSubscribers = uniqueSubscribers; + return this; + } + + /** + * Number of unique contacts in the folder + * @return uniqueSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueSubscribers() { + return uniqueSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueSubscribers(Long uniqueSubscribers) { + this.uniqueSubscribers = uniqueSubscribers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFolder getFolder = (GetFolder) o; + return Objects.equals(this.id, getFolder.id) && + Objects.equals(this.name, getFolder.name) && + Objects.equals(this.totalBlacklisted, getFolder.totalBlacklisted) && + Objects.equals(this.totalSubscribers, getFolder.totalSubscribers) && + Objects.equals(this.uniqueSubscribers, getFolder.uniqueSubscribers); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, totalBlacklisted, totalSubscribers, uniqueSubscribers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFolder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" totalBlacklisted: ").append(toIndentedString(totalBlacklisted)).append("\n"); + sb.append(" totalSubscribers: ").append(toIndentedString(totalSubscribers)).append("\n"); + sb.append(" uniqueSubscribers: ").append(toIndentedString(uniqueSubscribers)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalBlacklisted` to the URL query string + if (getTotalBlacklisted() != null) { + try { + joiner.add(String.format("%stotalBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalSubscribers` to the URL query string + if (getTotalSubscribers() != null) { + try { + joiner.add(String.format("%stotalSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueSubscribers` to the URL query string + if (getUniqueSubscribers() != null) { + try { + joiner.add(String.format("%suniqueSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolderLists.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolderLists.java new file mode 100644 index 0000000..2dea488 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolderLists.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetList; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetFolderLists + */ +@JsonPropertyOrder({ + GetFolderLists.JSON_PROPERTY_LISTS, + GetFolderLists.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getFolderLists") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetFolderLists { + public static final String JSON_PROPERTY_LISTS = "lists"; + private List lists; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetFolderLists() { + } + + public GetFolderLists lists(List lists) { + + this.lists = lists; + return this; + } + + public GetFolderLists addListsItem(GetList listsItem) { + if (this.lists == null) { + this.lists = new ArrayList<>(); + } + this.lists.add(listsItem); + return this; + } + + /** + * Get lists + * @return lists + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLists() { + return lists; + } + + + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLists(List lists) { + this.lists = lists; + } + + + public GetFolderLists count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of lists in the folder + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFolderLists getFolderLists = (GetFolderLists) o; + return Objects.equals(this.lists, getFolderLists.lists) && + Objects.equals(this.count, getFolderLists.count); + } + + @Override + public int hashCode() { + return Objects.hash(lists, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFolderLists {\n"); + sb.append(" lists: ").append(toIndentedString(lists)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lists` to the URL query string + if (getLists() != null) { + for (int i = 0; i < getLists().size(); i++) { + if (getLists().get(i) != null) { + joiner.add(getLists().get(i).toUrlQueryString(String.format("%slists%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolders.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolders.java new file mode 100644 index 0000000..479e5be --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetFolders.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetFolder; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetFolders + */ +@JsonPropertyOrder({ + GetFolders.JSON_PROPERTY_FOLDERS, + GetFolders.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getFolders") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetFolders { + public static final String JSON_PROPERTY_FOLDERS = "folders"; + private List folders; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetFolders() { + } + + public GetFolders folders(List folders) { + + this.folders = folders; + return this; + } + + public GetFolders addFoldersItem(GetFolder foldersItem) { + if (this.folders == null) { + this.folders = new ArrayList<>(); + } + this.folders.add(foldersItem); + return this; + } + + /** + * Get folders + * @return folders + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFolders() { + return folders; + } + + + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolders(List folders) { + this.folders = folders; + } + + + public GetFolders count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of folders available in your account + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFolders getFolders = (GetFolders) o; + return Objects.equals(this.folders, getFolders.folders) && + Objects.equals(this.count, getFolders.count); + } + + @Override + public int hashCode() { + return Objects.hash(folders, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFolders {\n"); + sb.append(" folders: ").append(toIndentedString(folders)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `folders` to the URL query string + if (getFolders() != null) { + for (int i = 0; i < getFolders().size(); i++) { + if (getFolders().get(i) != null) { + joiner.add(getFolders().get(i).toUrlQueryString(String.format("%sfolders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEvents.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEvents.java new file mode 100644 index 0000000..1eb8be1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEvents.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetInboundEmailEventsEventsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInboundEmailEvents + */ +@JsonPropertyOrder({ + GetInboundEmailEvents.JSON_PROPERTY_EVENTS +}) +@JsonTypeName("getInboundEmailEvents") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInboundEmailEvents { + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events; + + public GetInboundEmailEvents() { + } + + public GetInboundEmailEvents events(List events) { + + this.events = events; + return this; + } + + public GetInboundEmailEvents addEventsItem(GetInboundEmailEventsEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(List events) { + this.events = events; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInboundEmailEvents getInboundEmailEvents = (GetInboundEmailEvents) o; + return Objects.equals(this.events, getInboundEmailEvents.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInboundEmailEvents {\n"); + sb.append(" events: ").append(toIndentedString(events)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + if (getEvents().get(i) != null) { + joiner.add(getEvents().get(i).toUrlQueryString(String.format("%sevents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuid.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuid.java new file mode 100644 index 0000000..136d88a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuid.java @@ -0,0 +1,491 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import software.xdev.brevo.model.GetInboundEmailEventsByUuidAttachmentsInner; +import software.xdev.brevo.model.GetInboundEmailEventsByUuidLogsInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInboundEmailEventsByUuid + */ +@JsonPropertyOrder({ + GetInboundEmailEventsByUuid.JSON_PROPERTY_RECEIVED_AT, + GetInboundEmailEventsByUuid.JSON_PROPERTY_DELIVERED_AT, + GetInboundEmailEventsByUuid.JSON_PROPERTY_RECIPIENT, + GetInboundEmailEventsByUuid.JSON_PROPERTY_SENDER, + GetInboundEmailEventsByUuid.JSON_PROPERTY_MESSAGE_ID, + GetInboundEmailEventsByUuid.JSON_PROPERTY_SUBJECT, + GetInboundEmailEventsByUuid.JSON_PROPERTY_ATTACHMENTS, + GetInboundEmailEventsByUuid.JSON_PROPERTY_LOGS +}) +@JsonTypeName("getInboundEmailEventsByUuid") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInboundEmailEventsByUuid { + public static final String JSON_PROPERTY_RECEIVED_AT = "receivedAt"; + private OffsetDateTime receivedAt; + + public static final String JSON_PROPERTY_DELIVERED_AT = "deliveredAt"; + private JsonNullable deliveredAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments; + + public static final String JSON_PROPERTY_LOGS = "logs"; + private List logs; + + public GetInboundEmailEventsByUuid() { + } + + public GetInboundEmailEventsByUuid receivedAt(OffsetDateTime receivedAt) { + + this.receivedAt = receivedAt; + return this; + } + + /** + * Date when email was received on SMTP relay + * @return receivedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECEIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getReceivedAt() { + return receivedAt; + } + + + @JsonProperty(JSON_PROPERTY_RECEIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReceivedAt(OffsetDateTime receivedAt) { + this.receivedAt = receivedAt; + } + + + public GetInboundEmailEventsByUuid deliveredAt(OffsetDateTime deliveredAt) { + this.deliveredAt = JsonNullable.of(deliveredAt); + + return this; + } + + /** + * Date when email was delivered successfully to client’s webhook + * @return deliveredAt + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public OffsetDateTime getDeliveredAt() { + return deliveredAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DELIVERED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDeliveredAt_JsonNullable() { + return deliveredAt; + } + + @JsonProperty(JSON_PROPERTY_DELIVERED_AT) + public void setDeliveredAt_JsonNullable(JsonNullable deliveredAt) { + this.deliveredAt = deliveredAt; + } + + public void setDeliveredAt(OffsetDateTime deliveredAt) { + this.deliveredAt = JsonNullable.of(deliveredAt); + } + + + public GetInboundEmailEventsByUuid recipient(String recipient) { + + this.recipient = recipient; + return this; + } + + /** + * Recipient’s email address + * @return recipient + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + + public GetInboundEmailEventsByUuid sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Sender’s email address + * @return sender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(String sender) { + this.sender = sender; + } + + + public GetInboundEmailEventsByUuid messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Value of the Message-ID header. This will be present only after the processing is done. + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetInboundEmailEventsByUuid subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Value of the Subject header. This will be present only after the processing is done. + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetInboundEmailEventsByUuid attachments(List attachments) { + + this.attachments = attachments; + return this; + } + + public GetInboundEmailEventsByUuid addAttachmentsItem(GetInboundEmailEventsByUuidAttachmentsInner attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * List of attachments of the email. This will be present only after the processing is done. + * @return attachments + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + + public GetInboundEmailEventsByUuid logs(List logs) { + + this.logs = logs; + return this; + } + + public GetInboundEmailEventsByUuid addLogsItem(GetInboundEmailEventsByUuidLogsInner logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * List of events/logs that describe the lifecycle of the email on SIB platform + * @return logs + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLogs() { + return logs; + } + + + @JsonProperty(JSON_PROPERTY_LOGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogs(List logs) { + this.logs = logs; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInboundEmailEventsByUuid getInboundEmailEventsByUuid = (GetInboundEmailEventsByUuid) o; + return Objects.equals(this.receivedAt, getInboundEmailEventsByUuid.receivedAt) && + equalsNullable(this.deliveredAt, getInboundEmailEventsByUuid.deliveredAt) && + Objects.equals(this.recipient, getInboundEmailEventsByUuid.recipient) && + Objects.equals(this.sender, getInboundEmailEventsByUuid.sender) && + Objects.equals(this.messageId, getInboundEmailEventsByUuid.messageId) && + Objects.equals(this.subject, getInboundEmailEventsByUuid.subject) && + Objects.equals(this.attachments, getInboundEmailEventsByUuid.attachments) && + Objects.equals(this.logs, getInboundEmailEventsByUuid.logs); + } + + 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(receivedAt, hashCodeNullable(deliveredAt), recipient, sender, messageId, subject, attachments, logs); + } + + 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 GetInboundEmailEventsByUuid {\n"); + sb.append(" receivedAt: ").append(toIndentedString(receivedAt)).append("\n"); + sb.append(" deliveredAt: ").append(toIndentedString(deliveredAt)).append("\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `receivedAt` to the URL query string + if (getReceivedAt() != null) { + try { + joiner.add(String.format("%sreceivedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReceivedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `deliveredAt` to the URL query string + if (getDeliveredAt() != null) { + try { + joiner.add(String.format("%sdeliveredAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeliveredAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipient` to the URL query string + if (getRecipient() != null) { + try { + joiner.add(String.format("%srecipient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecipient()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attachments` to the URL query string + if (getAttachments() != null) { + for (int i = 0; i < getAttachments().size(); i++) { + if (getAttachments().get(i) != null) { + joiner.add(getAttachments().get(i).toUrlQueryString(String.format("%sattachments%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `logs` to the URL query string + if (getLogs() != null) { + for (int i = 0; i < getLogs().size(); i++) { + if (getLogs().get(i) != null) { + joiner.add(getLogs().get(i).toUrlQueryString(String.format("%slogs%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidAttachmentsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidAttachmentsInner.java new file mode 100644 index 0000000..e883e19 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidAttachmentsInner.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInboundEmailEventsByUuidAttachmentsInner + */ +@JsonPropertyOrder({ + GetInboundEmailEventsByUuidAttachmentsInner.JSON_PROPERTY_NAME, + GetInboundEmailEventsByUuidAttachmentsInner.JSON_PROPERTY_CONTENT_TYPE, + GetInboundEmailEventsByUuidAttachmentsInner.JSON_PROPERTY_CONTENT_ID, + GetInboundEmailEventsByUuidAttachmentsInner.JSON_PROPERTY_CONTENT_LENGTH +}) +@JsonTypeName("getInboundEmailEventsByUuid_attachments_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInboundEmailEventsByUuidAttachmentsInner { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType"; + private String contentType; + + public static final String JSON_PROPERTY_CONTENT_ID = "contentId"; + private String contentId; + + public static final String JSON_PROPERTY_CONTENT_LENGTH = "contentLength"; + private Integer contentLength; + + public GetInboundEmailEventsByUuidAttachmentsInner() { + } + + public GetInboundEmailEventsByUuidAttachmentsInner name(String name) { + + this.name = name; + return this; + } + + /** + * filename specified in the Content-Disposition header of the attachment + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public GetInboundEmailEventsByUuidAttachmentsInner contentType(String contentType) { + + this.contentType = contentType; + return this; + } + + /** + * value of the Content-Type header of the attachment + * @return contentType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContentType() { + return contentType; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(String contentType) { + this.contentType = contentType; + } + + + public GetInboundEmailEventsByUuidAttachmentsInner contentId(String contentId) { + + this.contentId = contentId; + return this; + } + + /** + * value of the Content-ID header of the attachment. + * @return contentId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContentId() { + return contentId; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentId(String contentId) { + this.contentId = contentId; + } + + + public GetInboundEmailEventsByUuidAttachmentsInner contentLength(Integer contentLength) { + + this.contentLength = contentLength; + return this; + } + + /** + * size of the attachment in bytes + * @return contentLength + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getContentLength() { + return contentLength; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentLength(Integer contentLength) { + this.contentLength = contentLength; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInboundEmailEventsByUuidAttachmentsInner getInboundEmailEventsByUuidAttachmentsInner = (GetInboundEmailEventsByUuidAttachmentsInner) o; + return Objects.equals(this.name, getInboundEmailEventsByUuidAttachmentsInner.name) && + Objects.equals(this.contentType, getInboundEmailEventsByUuidAttachmentsInner.contentType) && + Objects.equals(this.contentId, getInboundEmailEventsByUuidAttachmentsInner.contentId) && + Objects.equals(this.contentLength, getInboundEmailEventsByUuidAttachmentsInner.contentLength); + } + + @Override + public int hashCode() { + return Objects.hash(name, contentType, contentId, contentLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInboundEmailEventsByUuidAttachmentsInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" contentId: ").append(toIndentedString(contentId)).append("\n"); + sb.append(" contentLength: ").append(toIndentedString(contentLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contentType` to the URL query string + if (getContentType() != null) { + try { + joiner.add(String.format("%scontentType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContentType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contentId` to the URL query string + if (getContentId() != null) { + try { + joiner.add(String.format("%scontentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contentLength` to the URL query string + if (getContentLength() != null) { + try { + joiner.add(String.format("%scontentLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContentLength()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidLogsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidLogsInner.java new file mode 100644 index 0000000..b35962e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsByUuidLogsInner.java @@ -0,0 +1,234 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInboundEmailEventsByUuidLogsInner + */ +@JsonPropertyOrder({ + GetInboundEmailEventsByUuidLogsInner.JSON_PROPERTY_DATE, + GetInboundEmailEventsByUuidLogsInner.JSON_PROPERTY_TYPE +}) +@JsonTypeName("getInboundEmailEventsByUuid_logs_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInboundEmailEventsByUuidLogsInner { + public static final String JSON_PROPERTY_DATE = "date"; + private OffsetDateTime date; + + /** + * Type of the event + */ + public enum TypeEnum { + RECEIVED("received"), + + PROCESSED("processed"), + + WEBHOOKFAILED("webhookFailed"), + + WEBHOOKDELIVERED("webhookDelivered"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public GetInboundEmailEventsByUuidLogsInner() { + } + + public GetInboundEmailEventsByUuidLogsInner date(OffsetDateTime date) { + + this.date = date; + return this; + } + + /** + * Date of the event + * @return date + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(OffsetDateTime date) { + this.date = date; + } + + + public GetInboundEmailEventsByUuidLogsInner type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of the event + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInboundEmailEventsByUuidLogsInner getInboundEmailEventsByUuidLogsInner = (GetInboundEmailEventsByUuidLogsInner) o; + return Objects.equals(this.date, getInboundEmailEventsByUuidLogsInner.date) && + Objects.equals(this.type, getInboundEmailEventsByUuidLogsInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(date, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInboundEmailEventsByUuidLogsInner {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsEventsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsEventsInner.java new file mode 100644 index 0000000..770d793 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInboundEmailEventsEventsInner.java @@ -0,0 +1,280 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInboundEmailEventsEventsInner + */ +@JsonPropertyOrder({ + GetInboundEmailEventsEventsInner.JSON_PROPERTY_UUID, + GetInboundEmailEventsEventsInner.JSON_PROPERTY_DATE, + GetInboundEmailEventsEventsInner.JSON_PROPERTY_SENDER, + GetInboundEmailEventsEventsInner.JSON_PROPERTY_RECIPIENT +}) +@JsonTypeName("getInboundEmailEvents_events_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInboundEmailEventsEventsInner { + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_DATE = "date"; + private OffsetDateTime date; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + public GetInboundEmailEventsEventsInner() { + } + + public GetInboundEmailEventsEventsInner uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * UUID that can be used to fetch additional data + * @return uuid + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public GetInboundEmailEventsEventsInner date(OffsetDateTime date) { + + this.date = date; + return this; + } + + /** + * Date when email was received on SMTP relay + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(OffsetDateTime date) { + this.date = date; + } + + + public GetInboundEmailEventsEventsInner sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Sender’s email address + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public GetInboundEmailEventsEventsInner recipient(String recipient) { + + this.recipient = recipient; + return this; + } + + /** + * Recipient’s email address + * @return recipient + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInboundEmailEventsEventsInner getInboundEmailEventsEventsInner = (GetInboundEmailEventsEventsInner) o; + return Objects.equals(this.uuid, getInboundEmailEventsEventsInner.uuid) && + Objects.equals(this.date, getInboundEmailEventsEventsInner.date) && + Objects.equals(this.sender, getInboundEmailEventsEventsInner.sender) && + Objects.equals(this.recipient, getInboundEmailEventsEventsInner.recipient); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, date, sender, recipient); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInboundEmailEventsEventsInner {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uuid` to the URL query string + if (getUuid() != null) { + try { + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipient` to the URL query string + if (getRecipient() != null) { + try { + joiner.add(String.format("%srecipient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecipient()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersList.java new file mode 100644 index 0000000..ff8c480 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersList.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetInvitedUsersListUsersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInvitedUsersList + */ +@JsonPropertyOrder({ + GetInvitedUsersList.JSON_PROPERTY_USERS +}) +@JsonTypeName("getInvitedUsersList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInvitedUsersList { + public static final String JSON_PROPERTY_USERS = "users"; + private List users; + + public GetInvitedUsersList() { + } + + public GetInvitedUsersList users(List users) { + + this.users = users; + return this; + } + + public GetInvitedUsersList addUsersItem(GetInvitedUsersListUsersInner usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get invited users list + * @return users + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvitedUsersList getInvitedUsersList = (GetInvitedUsersList) o; + return Objects.equals(this.users, getInvitedUsersList.users); + } + + @Override + public int hashCode() { + return Objects.hash(users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvitedUsersList {\n"); + sb.append(" users: ").append(toIndentedString(users)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `users` to the URL query string + if (getUsers() != null) { + for (int i = 0; i < getUsers().size(); i++) { + if (getUsers().get(i) != null) { + joiner.add(getUsers().get(i).toUrlQueryString(String.format("%susers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInner.java new file mode 100644 index 0000000..0999463 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInner.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetInvitedUsersListUsersInnerFeatureAccess; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetInvitedUsersListUsersInner + */ +@JsonPropertyOrder({ + GetInvitedUsersListUsersInner.JSON_PROPERTY_EMAIL, + GetInvitedUsersListUsersInner.JSON_PROPERTY_IS_OWNER, + GetInvitedUsersListUsersInner.JSON_PROPERTY_STATUS, + GetInvitedUsersListUsersInner.JSON_PROPERTY_FEATURE_ACCESS +}) +@JsonTypeName("getInvitedUsersList_users_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInvitedUsersListUsersInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_IS_OWNER = "is_owner"; + private String isOwner; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_FEATURE_ACCESS = "feature_access"; + private GetInvitedUsersListUsersInnerFeatureAccess featureAccess; + + public GetInvitedUsersListUsersInner() { + } + + public GetInvitedUsersListUsersInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetInvitedUsersListUsersInner isOwner(String isOwner) { + + this.isOwner = isOwner; + return this; + } + + /** + * Flag for indicating is user owner of the organization. + * @return isOwner + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_OWNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIsOwner() { + return isOwner; + } + + + @JsonProperty(JSON_PROPERTY_IS_OWNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsOwner(String isOwner) { + this.isOwner = isOwner; + } + + + public GetInvitedUsersListUsersInner status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the invited user. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public GetInvitedUsersListUsersInner featureAccess(GetInvitedUsersListUsersInnerFeatureAccess featureAccess) { + + this.featureAccess = featureAccess; + return this; + } + + /** + * Get featureAccess + * @return featureAccess + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FEATURE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetInvitedUsersListUsersInnerFeatureAccess getFeatureAccess() { + return featureAccess; + } + + + @JsonProperty(JSON_PROPERTY_FEATURE_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFeatureAccess(GetInvitedUsersListUsersInnerFeatureAccess featureAccess) { + this.featureAccess = featureAccess; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvitedUsersListUsersInner getInvitedUsersListUsersInner = (GetInvitedUsersListUsersInner) o; + return Objects.equals(this.email, getInvitedUsersListUsersInner.email) && + Objects.equals(this.isOwner, getInvitedUsersListUsersInner.isOwner) && + Objects.equals(this.status, getInvitedUsersListUsersInner.status) && + Objects.equals(this.featureAccess, getInvitedUsersListUsersInner.featureAccess); + } + + @Override + public int hashCode() { + return Objects.hash(email, isOwner, status, featureAccess); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvitedUsersListUsersInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" featureAccess: ").append(toIndentedString(featureAccess)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `is_owner` to the URL query string + if (getIsOwner() != null) { + try { + joiner.add(String.format("%sis_owner%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsOwner()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `feature_access` to the URL query string + if (getFeatureAccess() != null) { + joiner.add(getFeatureAccess().toUrlQueryString(prefix + "feature_access" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInnerFeatureAccess.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInnerFeatureAccess.java new file mode 100644 index 0000000..f69dfec --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetInvitedUsersListUsersInnerFeatureAccess.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Feature accessiblity given to the user. + */ +@JsonPropertyOrder({ + GetInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_MARKETING, + GetInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_CONVERSATIONS, + GetInvitedUsersListUsersInnerFeatureAccess.JSON_PROPERTY_CRM +}) +@JsonTypeName("getInvitedUsersList_users_inner_feature_access") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetInvitedUsersListUsersInnerFeatureAccess { + public static final String JSON_PROPERTY_MARKETING = "marketing"; + private String marketing; + + public static final String JSON_PROPERTY_CONVERSATIONS = "conversations"; + private String conversations; + + public static final String JSON_PROPERTY_CRM = "crm"; + private String crm; + + public GetInvitedUsersListUsersInnerFeatureAccess() { + } + + public GetInvitedUsersListUsersInnerFeatureAccess marketing(String marketing) { + + this.marketing = marketing; + return this; + } + + /** + * Marketing features accessiblity. + * @return marketing + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MARKETING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMarketing() { + return marketing; + } + + + @JsonProperty(JSON_PROPERTY_MARKETING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMarketing(String marketing) { + this.marketing = marketing; + } + + + public GetInvitedUsersListUsersInnerFeatureAccess conversations(String conversations) { + + this.conversations = conversations; + return this; + } + + /** + * Conversations features accessiblity. + * @return conversations + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONVERSATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConversations() { + return conversations; + } + + + @JsonProperty(JSON_PROPERTY_CONVERSATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConversations(String conversations) { + this.conversations = conversations; + } + + + public GetInvitedUsersListUsersInnerFeatureAccess crm(String crm) { + + this.crm = crm; + return this; + } + + /** + * CRM features accessiblity. + * @return crm + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CRM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCrm() { + return crm; + } + + + @JsonProperty(JSON_PROPERTY_CRM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrm(String crm) { + this.crm = crm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvitedUsersListUsersInnerFeatureAccess getInvitedUsersListUsersInnerFeatureAccess = (GetInvitedUsersListUsersInnerFeatureAccess) o; + return Objects.equals(this.marketing, getInvitedUsersListUsersInnerFeatureAccess.marketing) && + Objects.equals(this.conversations, getInvitedUsersListUsersInnerFeatureAccess.conversations) && + Objects.equals(this.crm, getInvitedUsersListUsersInnerFeatureAccess.crm); + } + + @Override + public int hashCode() { + return Objects.hash(marketing, conversations, crm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvitedUsersListUsersInnerFeatureAccess {\n"); + sb.append(" marketing: ").append(toIndentedString(marketing)).append("\n"); + sb.append(" conversations: ").append(toIndentedString(conversations)).append("\n"); + sb.append(" crm: ").append(toIndentedString(crm)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `marketing` to the URL query string + if (getMarketing() != null) { + try { + joiner.add(String.format("%smarketing%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMarketing()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `conversations` to the URL query string + if (getConversations() != null) { + try { + joiner.add(String.format("%sconversations%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getConversations()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `crm` to the URL query string + if (getCrm() != null) { + try { + joiner.add(String.format("%scrm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCrm()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIp.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIp.java new file mode 100644 index 0000000..7e0b3eb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIp.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetIp + */ +@JsonPropertyOrder({ + GetIp.JSON_PROPERTY_ID, + GetIp.JSON_PROPERTY_IP, + GetIp.JSON_PROPERTY_ACTIVE, + GetIp.JSON_PROPERTY_DOMAIN +}) +@JsonTypeName("getIp") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetIp { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_ACTIVE = "active"; + private Boolean active; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public GetIp() { + } + + public GetIp id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the dedicated IP + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetIp ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated IP + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + + public GetIp active(Boolean active) { + + this.active = active; + return this; + } + + /** + * Status of the IP (true=active, false=inactive) + * @return active + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getActive() { + return active; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActive(Boolean active) { + this.active = active; + } + + + public GetIp domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Domain associated to the IP + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIp getIp = (GetIp) o; + return Objects.equals(this.id, getIp.id) && + Objects.equals(this.ip, getIp.ip) && + Objects.equals(this.active, getIp.active) && + Objects.equals(this.domain, getIp.domain); + } + + @Override + public int hashCode() { + return Objects.hash(id, ip, active, domain); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIp {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `active` to the URL query string + if (getActive() != null) { + try { + joiner.add(String.format("%sactive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpFromSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpFromSender.java new file mode 100644 index 0000000..e89e236 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpFromSender.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetIpFromSender + */ +@JsonPropertyOrder({ + GetIpFromSender.JSON_PROPERTY_ID, + GetIpFromSender.JSON_PROPERTY_IP, + GetIpFromSender.JSON_PROPERTY_DOMAIN, + GetIpFromSender.JSON_PROPERTY_WEIGHT +}) +@JsonTypeName("getIpFromSender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetIpFromSender { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_WEIGHT = "weight"; + private Long weight; + + public GetIpFromSender() { + } + + public GetIpFromSender id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the dedicated IP + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetIpFromSender ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated IP + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + + public GetIpFromSender domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Domain associated to the IP + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public GetIpFromSender weight(Long weight) { + + this.weight = weight; + return this; + } + + /** + * Weight of the IP + * @return weight + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getWeight() { + return weight; + } + + + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWeight(Long weight) { + this.weight = weight; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIpFromSender getIpFromSender = (GetIpFromSender) o; + return Objects.equals(this.id, getIpFromSender.id) && + Objects.equals(this.ip, getIpFromSender.ip) && + Objects.equals(this.domain, getIpFromSender.domain) && + Objects.equals(this.weight, getIpFromSender.weight); + } + + @Override + public int hashCode() { + return Objects.hash(id, ip, domain, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIpFromSender {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `weight` to the URL query string + if (getWeight() != null) { + try { + joiner.add(String.format("%sweight%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWeight()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIps.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIps.java new file mode 100644 index 0000000..aed9259 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIps.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetIp; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetIps + */ +@JsonPropertyOrder({ + GetIps.JSON_PROPERTY_IPS +}) +@JsonTypeName("getIps") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetIps { + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips = new ArrayList<>(); + + public GetIps() { + } + + public GetIps ips(List ips) { + + this.ips = ips; + return this; + } + + public GetIps addIpsItem(GetIp ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * Dedicated IP(s) available on your account + * @return ips + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIps(List ips) { + this.ips = ips; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIps getIps = (GetIps) o; + return Objects.equals(this.ips, getIps.ips); + } + + @Override + public int hashCode() { + return Objects.hash(ips); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIps {\n"); + sb.append(" ips: ").append(toIndentedString(ips)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + if (getIps().get(i) != null) { + joiner.add(getIps().get(i).toUrlQueryString(String.format("%sips%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpsFromSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpsFromSender.java new file mode 100644 index 0000000..d1c4103 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetIpsFromSender.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetIpFromSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetIpsFromSender + */ +@JsonPropertyOrder({ + GetIpsFromSender.JSON_PROPERTY_IPS +}) +@JsonTypeName("getIpsFromSender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetIpsFromSender { + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips = new ArrayList<>(); + + public GetIpsFromSender() { + } + + public GetIpsFromSender ips(List ips) { + + this.ips = ips; + return this; + } + + public GetIpsFromSender addIpsItem(GetIpFromSender ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * Dedicated IP(s) linked to a sender + * @return ips + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIps(List ips) { + this.ips = ips; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIpsFromSender getIpsFromSender = (GetIpsFromSender) o; + return Objects.equals(this.ips, getIpsFromSender.ips); + } + + @Override + public int hashCode() { + return Objects.hash(ips); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIpsFromSender {\n"); + sb.append(" ips: ").append(toIndentedString(ips)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + if (getIps().get(i) != null) { + joiner.add(getIps().get(i).toUrlQueryString(String.format("%sips%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetList.java new file mode 100644 index 0000000..9168966 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetList.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetList + */ +@JsonPropertyOrder({ + GetList.JSON_PROPERTY_ID, + GetList.JSON_PROPERTY_NAME, + GetList.JSON_PROPERTY_TOTAL_BLACKLISTED, + GetList.JSON_PROPERTY_TOTAL_SUBSCRIBERS, + GetList.JSON_PROPERTY_UNIQUE_SUBSCRIBERS +}) +@JsonTypeName("getList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetList { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TOTAL_BLACKLISTED = "totalBlacklisted"; + private Long totalBlacklisted; + + public static final String JSON_PROPERTY_TOTAL_SUBSCRIBERS = "totalSubscribers"; + private Long totalSubscribers; + + public static final String JSON_PROPERTY_UNIQUE_SUBSCRIBERS = "uniqueSubscribers"; + private Long uniqueSubscribers; + + public GetList() { + } + + public GetList id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the list + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetList name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the list + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetList totalBlacklisted(Long totalBlacklisted) { + + this.totalBlacklisted = totalBlacklisted; + return this; + } + + /** + * Number of blacklisted contacts in the list + * @return totalBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalBlacklisted() { + return totalBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalBlacklisted(Long totalBlacklisted) { + this.totalBlacklisted = totalBlacklisted; + } + + + public GetList totalSubscribers(Long totalSubscribers) { + + this.totalSubscribers = totalSubscribers; + return this; + } + + /** + * Number of contacts in the list + * @return totalSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalSubscribers() { + return totalSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalSubscribers(Long totalSubscribers) { + this.totalSubscribers = totalSubscribers; + } + + + public GetList uniqueSubscribers(Long uniqueSubscribers) { + + this.uniqueSubscribers = uniqueSubscribers; + return this; + } + + /** + * Number of unique contacts in the list + * @return uniqueSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueSubscribers() { + return uniqueSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueSubscribers(Long uniqueSubscribers) { + this.uniqueSubscribers = uniqueSubscribers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetList getList = (GetList) o; + return Objects.equals(this.id, getList.id) && + Objects.equals(this.name, getList.name) && + Objects.equals(this.totalBlacklisted, getList.totalBlacklisted) && + Objects.equals(this.totalSubscribers, getList.totalSubscribers) && + Objects.equals(this.uniqueSubscribers, getList.uniqueSubscribers); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, totalBlacklisted, totalSubscribers, uniqueSubscribers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetList {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" totalBlacklisted: ").append(toIndentedString(totalBlacklisted)).append("\n"); + sb.append(" totalSubscribers: ").append(toIndentedString(totalSubscribers)).append("\n"); + sb.append(" uniqueSubscribers: ").append(toIndentedString(uniqueSubscribers)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalBlacklisted` to the URL query string + if (getTotalBlacklisted() != null) { + try { + joiner.add(String.format("%stotalBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalSubscribers` to the URL query string + if (getTotalSubscribers() != null) { + try { + joiner.add(String.format("%stotalSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueSubscribers` to the URL query string + if (getUniqueSubscribers() != null) { + try { + joiner.add(String.format("%suniqueSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetLists.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetLists.java new file mode 100644 index 0000000..bea0eb7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetLists.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetListsListsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetLists + */ +@JsonPropertyOrder({ + GetLists.JSON_PROPERTY_LISTS, + GetLists.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getLists") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetLists { + public static final String JSON_PROPERTY_LISTS = "lists"; + private List lists; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetLists() { + } + + public GetLists lists(List lists) { + + this.lists = lists; + return this; + } + + public GetLists addListsItem(GetListsListsInner listsItem) { + if (this.lists == null) { + this.lists = new ArrayList<>(); + } + this.lists.add(listsItem); + return this; + } + + /** + * Listing of all the lists available in your account + * @return lists + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getLists() { + return lists; + } + + + @JsonProperty(JSON_PROPERTY_LISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLists(List lists) { + this.lists = lists; + } + + + public GetLists count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of lists in your account + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLists getLists = (GetLists) o; + return Objects.equals(this.lists, getLists.lists) && + Objects.equals(this.count, getLists.count); + } + + @Override + public int hashCode() { + return Objects.hash(lists, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLists {\n"); + sb.append(" lists: ").append(toIndentedString(lists)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lists` to the URL query string + if (getLists() != null) { + for (int i = 0; i < getLists().size(); i++) { + if (getLists().get(i) != null) { + joiner.add(getLists().get(i).toUrlQueryString(String.format("%slists%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetListsListsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetListsListsInner.java new file mode 100644 index 0000000..64c219e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetListsListsInner.java @@ -0,0 +1,362 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetListsListsInner + */ +@JsonPropertyOrder({ + GetListsListsInner.JSON_PROPERTY_ID, + GetListsListsInner.JSON_PROPERTY_NAME, + GetListsListsInner.JSON_PROPERTY_TOTAL_BLACKLISTED, + GetListsListsInner.JSON_PROPERTY_TOTAL_SUBSCRIBERS, + GetListsListsInner.JSON_PROPERTY_UNIQUE_SUBSCRIBERS, + GetListsListsInner.JSON_PROPERTY_FOLDER_ID +}) +@JsonTypeName("getLists_lists_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetListsListsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TOTAL_BLACKLISTED = "totalBlacklisted"; + private Long totalBlacklisted; + + public static final String JSON_PROPERTY_TOTAL_SUBSCRIBERS = "totalSubscribers"; + private Long totalSubscribers; + + public static final String JSON_PROPERTY_UNIQUE_SUBSCRIBERS = "uniqueSubscribers"; + private Long uniqueSubscribers; + + public static final String JSON_PROPERTY_FOLDER_ID = "folderId"; + private Long folderId; + + public GetListsListsInner() { + } + + public GetListsListsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the list + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetListsListsInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the list + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetListsListsInner totalBlacklisted(Long totalBlacklisted) { + + this.totalBlacklisted = totalBlacklisted; + return this; + } + + /** + * Number of blacklisted contacts in the list + * @return totalBlacklisted + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalBlacklisted() { + return totalBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalBlacklisted(Long totalBlacklisted) { + this.totalBlacklisted = totalBlacklisted; + } + + + public GetListsListsInner totalSubscribers(Long totalSubscribers) { + + this.totalSubscribers = totalSubscribers; + return this; + } + + /** + * Number of contacts in the list + * @return totalSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getTotalSubscribers() { + return totalSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalSubscribers(Long totalSubscribers) { + this.totalSubscribers = totalSubscribers; + } + + + public GetListsListsInner uniqueSubscribers(Long uniqueSubscribers) { + + this.uniqueSubscribers = uniqueSubscribers; + return this; + } + + /** + * Number of unique contacts in the list + * @return uniqueSubscribers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueSubscribers() { + return uniqueSubscribers; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_SUBSCRIBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueSubscribers(Long uniqueSubscribers) { + this.uniqueSubscribers = uniqueSubscribers; + } + + + public GetListsListsInner folderId(Long folderId) { + + this.folderId = folderId; + return this; + } + + /** + * ID of the folder + * @return folderId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getFolderId() { + return folderId; + } + + + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetListsListsInner getListsListsInner = (GetListsListsInner) o; + return Objects.equals(this.id, getListsListsInner.id) && + Objects.equals(this.name, getListsListsInner.name) && + Objects.equals(this.totalBlacklisted, getListsListsInner.totalBlacklisted) && + Objects.equals(this.totalSubscribers, getListsListsInner.totalSubscribers) && + Objects.equals(this.uniqueSubscribers, getListsListsInner.uniqueSubscribers) && + Objects.equals(this.folderId, getListsListsInner.folderId); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, totalBlacklisted, totalSubscribers, uniqueSubscribers, folderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetListsListsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" totalBlacklisted: ").append(toIndentedString(totalBlacklisted)).append("\n"); + sb.append(" totalSubscribers: ").append(toIndentedString(totalSubscribers)).append("\n"); + sb.append(" uniqueSubscribers: ").append(toIndentedString(uniqueSubscribers)).append("\n"); + sb.append(" folderId: ").append(toIndentedString(folderId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalBlacklisted` to the URL query string + if (getTotalBlacklisted() != null) { + try { + joiner.add(String.format("%stotalBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `totalSubscribers` to the URL query string + if (getTotalSubscribers() != null) { + try { + joiner.add(String.format("%stotalSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotalSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueSubscribers` to the URL query string + if (getUniqueSubscribers() != null) { + try { + joiner.add(String.format("%suniqueSubscribers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueSubscribers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `folderId` to the URL query string + if (getFolderId() != null) { + try { + joiner.add(String.format("%sfolderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFolderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcess.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcess.java new file mode 100644 index 0000000..8d19d28 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcess.java @@ -0,0 +1,315 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetProcess + */ +@JsonPropertyOrder({ + GetProcess.JSON_PROPERTY_ID, + GetProcess.JSON_PROPERTY_STATUS, + GetProcess.JSON_PROPERTY_NAME, + GetProcess.JSON_PROPERTY_EXPORT_URL +}) +@JsonTypeName("getProcess") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetProcess { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + /** + * Status of the process + */ + public enum StatusEnum { + QUEUED("queued"), + + IN_PROCESS("in_process"), + + COMPLETED("completed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EXPORT_URL = "export_url"; + private String exportUrl; + + public GetProcess() { + } + + public GetProcess id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the process + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetProcess status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the process + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetProcess name(String name) { + + this.name = name; + return this; + } + + /** + * Process name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetProcess exportUrl(String exportUrl) { + + this.exportUrl = exportUrl; + return this; + } + + /** + * URL on which send export the of contacts once the process is completed + * @return exportUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPORT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExportUrl() { + return exportUrl; + } + + + @JsonProperty(JSON_PROPERTY_EXPORT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExportUrl(String exportUrl) { + this.exportUrl = exportUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProcess getProcess = (GetProcess) o; + return Objects.equals(this.id, getProcess.id) && + Objects.equals(this.status, getProcess.status) && + Objects.equals(this.name, getProcess.name) && + Objects.equals(this.exportUrl, getProcess.exportUrl); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, name, exportUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProcess {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" exportUrl: ").append(toIndentedString(exportUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `export_url` to the URL query string + if (getExportUrl() != null) { + try { + joiner.add(String.format("%sexport_url%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExportUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcesses.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcesses.java new file mode 100644 index 0000000..b1b313e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProcesses.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetProcess; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetProcesses + */ +@JsonPropertyOrder({ + GetProcesses.JSON_PROPERTY_PROCESSES, + GetProcesses.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getProcesses") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetProcesses { + public static final String JSON_PROPERTY_PROCESSES = "processes"; + private List processes; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetProcesses() { + } + + public GetProcesses processes(List processes) { + + this.processes = processes; + return this; + } + + public GetProcesses addProcessesItem(GetProcess processesItem) { + if (this.processes == null) { + this.processes = new ArrayList<>(); + } + this.processes.add(processesItem); + return this; + } + + /** + * List of processes available on your account + * @return processes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROCESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProcesses() { + return processes; + } + + + @JsonProperty(JSON_PROPERTY_PROCESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcesses(List processes) { + this.processes = processes; + } + + + public GetProcesses count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of processes available on your account + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProcesses getProcesses = (GetProcesses) o; + return Objects.equals(this.processes, getProcesses.processes) && + Objects.equals(this.count, getProcesses.count); + } + + @Override + public int hashCode() { + return Objects.hash(processes, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProcesses {\n"); + sb.append(" processes: ").append(toIndentedString(processes)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `processes` to the URL query string + if (getProcesses() != null) { + for (int i = 0; i < getProcesses().size(); i++) { + if (getProcesses().get(i) != null) { + joiner.add(getProcesses().get(i).toUrlQueryString(String.format("%sprocesses%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProductDetails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProductDetails.java new file mode 100644 index 0000000..041ff8b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProductDetails.java @@ -0,0 +1,755 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetProductDetails + */ +@JsonPropertyOrder({ + GetProductDetails.JSON_PROPERTY_ID, + GetProductDetails.JSON_PROPERTY_NAME, + GetProductDetails.JSON_PROPERTY_CREATED_AT, + GetProductDetails.JSON_PROPERTY_MODIFIED_AT, + GetProductDetails.JSON_PROPERTY_URL, + GetProductDetails.JSON_PROPERTY_IMAGE_URL, + GetProductDetails.JSON_PROPERTY_SKU, + GetProductDetails.JSON_PROPERTY_PRICE, + GetProductDetails.JSON_PROPERTY_CATEGORIES, + GetProductDetails.JSON_PROPERTY_PARENT_ID, + GetProductDetails.JSON_PROPERTY_S3_ORIGINAL, + GetProductDetails.JSON_PROPERTY_S3_THUMB_ANALYTICS, + GetProductDetails.JSON_PROPERTY_S3_THUMB_EDITOR, + GetProductDetails.JSON_PROPERTY_META_INFO, + GetProductDetails.JSON_PROPERTY_IS_DELETED +}) +@JsonTypeName("getProductDetails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetProductDetails { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + private String imageUrl; + + public static final String JSON_PROPERTY_SKU = "sku"; + private String sku; + + public static final String JSON_PROPERTY_PRICE = "price"; + private Float price; + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories; + + public static final String JSON_PROPERTY_PARENT_ID = "parentId"; + private String parentId; + + public static final String JSON_PROPERTY_S3_ORIGINAL = "s3Original"; + private String s3Original; + + public static final String JSON_PROPERTY_S3_THUMB_ANALYTICS = "s3ThumbAnalytics"; + private String s3ThumbAnalytics; + + public static final String JSON_PROPERTY_S3_THUMB_EDITOR = "s3ThumbEditor"; + private String s3ThumbEditor; + + public static final String JSON_PROPERTY_META_INFO = "metaInfo"; + private Object metaInfo; + + public static final String JSON_PROPERTY_IS_DELETED = "isDeleted"; + private Boolean isDeleted; + + public GetProductDetails() { + } + + public GetProductDetails id(String id) { + + this.id = id; + return this; + } + + /** + * Product ID for which you requested the details + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public GetProductDetails name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the product for which you requested the details + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetProductDetails createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetProductDetails modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetProductDetails url(String url) { + + this.url = url; + return this; + } + + /** + * URL to the product + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public GetProductDetails imageUrl(String imageUrl) { + + this.imageUrl = imageUrl; + return this; + } + + /** + * Absolute URL to the cover image of the product + * @return imageUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getImageUrl() { + return imageUrl; + } + + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + + public GetProductDetails sku(String sku) { + + this.sku = sku; + return this; + } + + /** + * Product identifier from the shop + * @return sku + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSku() { + return sku; + } + + + @JsonProperty(JSON_PROPERTY_SKU) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSku(String sku) { + this.sku = sku; + } + + + public GetProductDetails price(Float price) { + + this.price = price; + return this; + } + + /** + * Price of the product + * @return price + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getPrice() { + return price; + } + + + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrice(Float price) { + this.price = price; + } + + + public GetProductDetails categories(List categories) { + + this.categories = categories; + return this; + } + + public GetProductDetails addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Category ID-s of the product + * @return categories + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCategories() { + return categories; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategories(List categories) { + this.categories = categories; + } + + + public GetProductDetails parentId(String parentId) { + + this.parentId = parentId; + return this; + } + + /** + * Parent product id of the product + * @return parentId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getParentId() { + return parentId; + } + + + @JsonProperty(JSON_PROPERTY_PARENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParentId(String parentId) { + this.parentId = parentId; + } + + + public GetProductDetails s3Original(String s3Original) { + + this.s3Original = s3Original; + return this; + } + + /** + * S3 url of original image + * @return s3Original + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_S3_ORIGINAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getS3Original() { + return s3Original; + } + + + @JsonProperty(JSON_PROPERTY_S3_ORIGINAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setS3Original(String s3Original) { + this.s3Original = s3Original; + } + + + public GetProductDetails s3ThumbAnalytics(String s3ThumbAnalytics) { + + this.s3ThumbAnalytics = s3ThumbAnalytics; + return this; + } + + /** + * S3 thumbnail url of original image in 120x120 dimension for analytics section + * @return s3ThumbAnalytics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_S3_THUMB_ANALYTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getS3ThumbAnalytics() { + return s3ThumbAnalytics; + } + + + @JsonProperty(JSON_PROPERTY_S3_THUMB_ANALYTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setS3ThumbAnalytics(String s3ThumbAnalytics) { + this.s3ThumbAnalytics = s3ThumbAnalytics; + } + + + public GetProductDetails s3ThumbEditor(String s3ThumbEditor) { + + this.s3ThumbEditor = s3ThumbEditor; + return this; + } + + /** + * S3 thumbnail url of original image in 600x400 dimension for editor section + * @return s3ThumbEditor + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_S3_THUMB_EDITOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getS3ThumbEditor() { + return s3ThumbEditor; + } + + + @JsonProperty(JSON_PROPERTY_S3_THUMB_EDITOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setS3ThumbEditor(String s3ThumbEditor) { + this.s3ThumbEditor = s3ThumbEditor; + } + + + public GetProductDetails metaInfo(Object metaInfo) { + + this.metaInfo = metaInfo; + return this; + } + + /** + * Meta data of product such as description, vendor, producer, stock level, etc. + * @return metaInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getMetaInfo() { + return metaInfo; + } + + + @JsonProperty(JSON_PROPERTY_META_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetaInfo(Object metaInfo) { + this.metaInfo = metaInfo; + } + + + public GetProductDetails isDeleted(Boolean isDeleted) { + + this.isDeleted = isDeleted; + return this; + } + + /** + * product deleted from the shop's database + * @return isDeleted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DELETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsDeleted() { + return isDeleted; + } + + + @JsonProperty(JSON_PROPERTY_IS_DELETED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeleted(Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProductDetails getProductDetails = (GetProductDetails) o; + return Objects.equals(this.id, getProductDetails.id) && + Objects.equals(this.name, getProductDetails.name) && + Objects.equals(this.createdAt, getProductDetails.createdAt) && + Objects.equals(this.modifiedAt, getProductDetails.modifiedAt) && + Objects.equals(this.url, getProductDetails.url) && + Objects.equals(this.imageUrl, getProductDetails.imageUrl) && + Objects.equals(this.sku, getProductDetails.sku) && + Objects.equals(this.price, getProductDetails.price) && + Objects.equals(this.categories, getProductDetails.categories) && + Objects.equals(this.parentId, getProductDetails.parentId) && + Objects.equals(this.s3Original, getProductDetails.s3Original) && + Objects.equals(this.s3ThumbAnalytics, getProductDetails.s3ThumbAnalytics) && + Objects.equals(this.s3ThumbEditor, getProductDetails.s3ThumbEditor) && + Objects.equals(this.metaInfo, getProductDetails.metaInfo) && + Objects.equals(this.isDeleted, getProductDetails.isDeleted); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, createdAt, modifiedAt, url, imageUrl, sku, price, categories, parentId, s3Original, s3ThumbAnalytics, s3ThumbEditor, metaInfo, isDeleted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProductDetails {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" sku: ").append(toIndentedString(sku)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n"); + sb.append(" s3Original: ").append(toIndentedString(s3Original)).append("\n"); + sb.append(" s3ThumbAnalytics: ").append(toIndentedString(s3ThumbAnalytics)).append("\n"); + sb.append(" s3ThumbEditor: ").append(toIndentedString(s3ThumbEditor)).append("\n"); + sb.append(" metaInfo: ").append(toIndentedString(metaInfo)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + try { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getImageUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sku` to the URL query string + if (getSku() != null) { + try { + joiner.add(String.format("%ssku%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSku()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `price` to the URL query string + if (getPrice() != null) { + try { + joiner.add(String.format("%sprice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `categories` to the URL query string + if (getCategories() != null) { + for (int i = 0; i < getCategories().size(); i++) { + try { + joiner.add(String.format("%scategories%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCategories().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `parentId` to the URL query string + if (getParentId() != null) { + try { + joiner.add(String.format("%sparentId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getParentId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `s3Original` to the URL query string + if (getS3Original() != null) { + try { + joiner.add(String.format("%ss3Original%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getS3Original()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `s3ThumbAnalytics` to the URL query string + if (getS3ThumbAnalytics() != null) { + try { + joiner.add(String.format("%ss3ThumbAnalytics%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getS3ThumbAnalytics()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `s3ThumbEditor` to the URL query string + if (getS3ThumbEditor() != null) { + try { + joiner.add(String.format("%ss3ThumbEditor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getS3ThumbEditor()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `metaInfo` to the URL query string + if (getMetaInfo() != null) { + try { + joiner.add(String.format("%smetaInfo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMetaInfo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isDeleted` to the URL query string + if (getIsDeleted() != null) { + try { + joiner.add(String.format("%sisDeleted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsDeleted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProducts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProducts.java new file mode 100644 index 0000000..fddee6d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetProducts.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetProductDetails; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetProducts + */ +@JsonPropertyOrder({ + GetProducts.JSON_PROPERTY_PRODUCTS, + GetProducts.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getProducts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetProducts { + public static final String JSON_PROPERTY_PRODUCTS = "products"; + private List products = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetProducts() { + } + + public GetProducts products(List products) { + + this.products = products; + return this; + } + + public GetProducts addProductsItem(GetProductDetails productsItem) { + if (this.products == null) { + this.products = new ArrayList<>(); + } + this.products.add(productsItem); + return this; + } + + /** + * Get products + * @return products + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getProducts() { + return products; + } + + + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProducts(List products) { + this.products = products; + } + + + public GetProducts count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of products + * @return count + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProducts getProducts = (GetProducts) o; + return Objects.equals(this.products, getProducts.products) && + Objects.equals(this.count, getProducts.count); + } + + @Override + public int hashCode() { + return Objects.hash(products, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProducts {\n"); + sb.append(" products: ").append(toIndentedString(products)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `products` to the URL query string + if (getProducts() != null) { + for (int i = 0; i < getProducts().size(); i++) { + if (getProducts().get(i) != null) { + joiner.add(getProducts().get(i).toUrlQueryString(String.format("%sproducts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReports.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReports.java new file mode 100644 index 0000000..a1b93c8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReports.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetReportsReportsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetReports + */ +@JsonPropertyOrder({ + GetReports.JSON_PROPERTY_REPORTS +}) +@JsonTypeName("getReports") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetReports { + public static final String JSON_PROPERTY_REPORTS = "reports"; + private List reports; + + public GetReports() { + } + + public GetReports reports(List reports) { + + this.reports = reports; + return this; + } + + public GetReports addReportsItem(GetReportsReportsInner reportsItem) { + if (this.reports == null) { + this.reports = new ArrayList<>(); + } + this.reports.add(reportsItem); + return this; + } + + /** + * Get reports + * @return reports + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getReports() { + return reports; + } + + + @JsonProperty(JSON_PROPERTY_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReports(List reports) { + this.reports = reports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReports getReports = (GetReports) o; + return Objects.equals(this.reports, getReports.reports); + } + + @Override + public int hashCode() { + return Objects.hash(reports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReports {\n"); + sb.append(" reports: ").append(toIndentedString(reports)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `reports` to the URL query string + if (getReports() != null) { + for (int i = 0; i < getReports().size(); i++) { + if (getReports().get(i) != null) { + joiner.add(getReports().get(i).toUrlQueryString(String.format("%sreports%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReportsReportsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReportsReportsInner.java new file mode 100644 index 0000000..9c78386 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetReportsReportsInner.java @@ -0,0 +1,657 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetReportsReportsInner + */ +@JsonPropertyOrder({ + GetReportsReportsInner.JSON_PROPERTY_DATE, + GetReportsReportsInner.JSON_PROPERTY_REQUESTS, + GetReportsReportsInner.JSON_PROPERTY_DELIVERED, + GetReportsReportsInner.JSON_PROPERTY_HARD_BOUNCES, + GetReportsReportsInner.JSON_PROPERTY_SOFT_BOUNCES, + GetReportsReportsInner.JSON_PROPERTY_CLICKS, + GetReportsReportsInner.JSON_PROPERTY_UNIQUE_CLICKS, + GetReportsReportsInner.JSON_PROPERTY_OPENS, + GetReportsReportsInner.JSON_PROPERTY_UNIQUE_OPENS, + GetReportsReportsInner.JSON_PROPERTY_SPAM_REPORTS, + GetReportsReportsInner.JSON_PROPERTY_BLOCKED, + GetReportsReportsInner.JSON_PROPERTY_INVALID, + GetReportsReportsInner.JSON_PROPERTY_UNSUBSCRIBED +}) +@JsonTypeName("getReports_reports_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetReportsReportsInner { + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private Long requests; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_CLICKS = "clicks"; + private Long clicks; + + public static final String JSON_PROPERTY_UNIQUE_CLICKS = "uniqueClicks"; + private Long uniqueClicks; + + public static final String JSON_PROPERTY_OPENS = "opens"; + private Long opens; + + public static final String JSON_PROPERTY_UNIQUE_OPENS = "uniqueOpens"; + private Long uniqueOpens; + + public static final String JSON_PROPERTY_SPAM_REPORTS = "spamReports"; + private Long spamReports; + + public static final String JSON_PROPERTY_BLOCKED = "blocked"; + private Long blocked; + + public static final String JSON_PROPERTY_INVALID = "invalid"; + private Long invalid; + + public static final String JSON_PROPERTY_UNSUBSCRIBED = "unsubscribed"; + private Long unsubscribed; + + public GetReportsReportsInner() { + } + + public GetReportsReportsInner date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Date of the statistics + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(LocalDate date) { + this.date = date; + } + + + public GetReportsReportsInner requests(Long requests) { + + this.requests = requests; + return this; + } + + /** + * Number of requests for the date + * @return requests + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getRequests() { + return requests; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequests(Long requests) { + this.requests = requests; + } + + + public GetReportsReportsInner delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered emails for the date + * @return delivered + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetReportsReportsInner hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of hardbounces for the date + * @return hardBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetReportsReportsInner softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounces for the date + * @return softBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetReportsReportsInner clicks(Long clicks) { + + this.clicks = clicks; + return this; + } + + /** + * Number of clicks for the date + * @return clicks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getClicks() { + return clicks; + } + + + @JsonProperty(JSON_PROPERTY_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClicks(Long clicks) { + this.clicks = clicks; + } + + + public GetReportsReportsInner uniqueClicks(Long uniqueClicks) { + + this.uniqueClicks = uniqueClicks; + return this; + } + + /** + * Number of unique clicks for the date + * @return uniqueClicks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueClicks() { + return uniqueClicks; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_CLICKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueClicks(Long uniqueClicks) { + this.uniqueClicks = uniqueClicks; + } + + + public GetReportsReportsInner opens(Long opens) { + + this.opens = opens; + return this; + } + + /** + * Number of openings for the date + * @return opens + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getOpens() { + return opens; + } + + + @JsonProperty(JSON_PROPERTY_OPENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOpens(Long opens) { + this.opens = opens; + } + + + public GetReportsReportsInner uniqueOpens(Long uniqueOpens) { + + this.uniqueOpens = uniqueOpens; + return this; + } + + /** + * Number of unique openings for the date + * @return uniqueOpens + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIQUE_OPENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUniqueOpens() { + return uniqueOpens; + } + + + @JsonProperty(JSON_PROPERTY_UNIQUE_OPENS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUniqueOpens(Long uniqueOpens) { + this.uniqueOpens = uniqueOpens; + } + + + public GetReportsReportsInner spamReports(Long spamReports) { + + this.spamReports = spamReports; + return this; + } + + /** + * Number of complaints (spam reports) for the date + * @return spamReports + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SPAM_REPORTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSpamReports() { + return spamReports; + } + + + @JsonProperty(JSON_PROPERTY_SPAM_REPORTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSpamReports(Long spamReports) { + this.spamReports = spamReports; + } + + + public GetReportsReportsInner blocked(Long blocked) { + + this.blocked = blocked; + return this; + } + + /** + * Number of blocked emails for the date + * @return blocked + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getBlocked() { + return blocked; + } + + + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBlocked(Long blocked) { + this.blocked = blocked; + } + + + public GetReportsReportsInner invalid(Long invalid) { + + this.invalid = invalid; + return this; + } + + /** + * Number of invalid emails for the date + * @return invalid + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INVALID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getInvalid() { + return invalid; + } + + + @JsonProperty(JSON_PROPERTY_INVALID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInvalid(Long invalid) { + this.invalid = invalid; + } + + + public GetReportsReportsInner unsubscribed(Long unsubscribed) { + + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Number of unsubscribed emails for the date + * @return unsubscribed + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUnsubscribed() { + return unsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnsubscribed(Long unsubscribed) { + this.unsubscribed = unsubscribed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReportsReportsInner getReportsReportsInner = (GetReportsReportsInner) o; + return Objects.equals(this.date, getReportsReportsInner.date) && + Objects.equals(this.requests, getReportsReportsInner.requests) && + Objects.equals(this.delivered, getReportsReportsInner.delivered) && + Objects.equals(this.hardBounces, getReportsReportsInner.hardBounces) && + Objects.equals(this.softBounces, getReportsReportsInner.softBounces) && + Objects.equals(this.clicks, getReportsReportsInner.clicks) && + Objects.equals(this.uniqueClicks, getReportsReportsInner.uniqueClicks) && + Objects.equals(this.opens, getReportsReportsInner.opens) && + Objects.equals(this.uniqueOpens, getReportsReportsInner.uniqueOpens) && + Objects.equals(this.spamReports, getReportsReportsInner.spamReports) && + Objects.equals(this.blocked, getReportsReportsInner.blocked) && + Objects.equals(this.invalid, getReportsReportsInner.invalid) && + Objects.equals(this.unsubscribed, getReportsReportsInner.unsubscribed); + } + + @Override + public int hashCode() { + return Objects.hash(date, requests, delivered, hardBounces, softBounces, clicks, uniqueClicks, opens, uniqueOpens, spamReports, blocked, invalid, unsubscribed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReportsReportsInner {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" clicks: ").append(toIndentedString(clicks)).append("\n"); + sb.append(" uniqueClicks: ").append(toIndentedString(uniqueClicks)).append("\n"); + sb.append(" opens: ").append(toIndentedString(opens)).append("\n"); + sb.append(" uniqueOpens: ").append(toIndentedString(uniqueOpens)).append("\n"); + sb.append(" spamReports: ").append(toIndentedString(spamReports)).append("\n"); + sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); + sb.append(" invalid: ").append(toIndentedString(invalid)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `requests` to the URL query string + if (getRequests() != null) { + try { + joiner.add(String.format("%srequests%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRequests()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `clicks` to the URL query string + if (getClicks() != null) { + try { + joiner.add(String.format("%sclicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueClicks` to the URL query string + if (getUniqueClicks() != null) { + try { + joiner.add(String.format("%suniqueClicks%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueClicks()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `opens` to the URL query string + if (getOpens() != null) { + try { + joiner.add(String.format("%sopens%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOpens()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uniqueOpens` to the URL query string + if (getUniqueOpens() != null) { + try { + joiner.add(String.format("%suniqueOpens%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUniqueOpens()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `spamReports` to the URL query string + if (getSpamReports() != null) { + try { + joiner.add(String.format("%sspamReports%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpamReports()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `blocked` to the URL query string + if (getBlocked() != null) { + try { + joiner.add(String.format("%sblocked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBlocked()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `invalid` to the URL query string + if (getInvalid() != null) { + try { + joiner.add(String.format("%sinvalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInvalid()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribed` to the URL query string + if (getUnsubscribed() != null) { + try { + joiner.add(String.format("%sunsubscribed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchId.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchId.java new file mode 100644 index 0000000..7339b01 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchId.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetScheduledEmailByBatchIdBatchesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetScheduledEmailByBatchId + */ +@JsonPropertyOrder({ + GetScheduledEmailByBatchId.JSON_PROPERTY_COUNT, + GetScheduledEmailByBatchId.JSON_PROPERTY_BATCHES +}) +@JsonTypeName("getScheduledEmailByBatchId") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetScheduledEmailByBatchId { + public static final String JSON_PROPERTY_COUNT = "count"; + private Integer count; + + public static final String JSON_PROPERTY_BATCHES = "batches"; + private List batches; + + public GetScheduledEmailByBatchId() { + } + + public GetScheduledEmailByBatchId count(Integer count) { + + this.count = count; + return this; + } + + /** + * Total number of batches + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Integer count) { + this.count = count; + } + + + public GetScheduledEmailByBatchId batches(List batches) { + + this.batches = batches; + return this; + } + + public GetScheduledEmailByBatchId addBatchesItem(GetScheduledEmailByBatchIdBatchesInner batchesItem) { + if (this.batches == null) { + this.batches = new ArrayList<>(); + } + this.batches.add(batchesItem); + return this; + } + + /** + * Get batches + * @return batches + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBatches() { + return batches; + } + + + @JsonProperty(JSON_PROPERTY_BATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatches(List batches) { + this.batches = batches; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetScheduledEmailByBatchId getScheduledEmailByBatchId = (GetScheduledEmailByBatchId) o; + return Objects.equals(this.count, getScheduledEmailByBatchId.count) && + Objects.equals(this.batches, getScheduledEmailByBatchId.batches); + } + + @Override + public int hashCode() { + return Objects.hash(count, batches); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetScheduledEmailByBatchId {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" batches: ").append(toIndentedString(batches)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batches` to the URL query string + if (getBatches() != null) { + for (int i = 0; i < getBatches().size(); i++) { + if (getBatches().get(i) != null) { + joiner.add(getBatches().get(i).toUrlQueryString(String.format("%sbatches%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchIdBatchesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchIdBatchesInner.java new file mode 100644 index 0000000..2b49934 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByBatchIdBatchesInner.java @@ -0,0 +1,276 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetScheduledEmailByBatchIdBatchesInner + */ +@JsonPropertyOrder({ + GetScheduledEmailByBatchIdBatchesInner.JSON_PROPERTY_SCHEDULED_AT, + GetScheduledEmailByBatchIdBatchesInner.JSON_PROPERTY_CREATED_AT, + GetScheduledEmailByBatchIdBatchesInner.JSON_PROPERTY_STATUS +}) +@JsonTypeName("getScheduledEmailByBatchId_batches_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetScheduledEmailByBatchIdBatchesInner { + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private OffsetDateTime scheduledAt; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + /** + * Current status of the scheduled batch + */ + public enum StatusEnum { + INPROGRESS("inProgress"), + + QUEUED("queued"), + + PROCESSED("processed"), + + ERROR("error"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public GetScheduledEmailByBatchIdBatchesInner() { + } + + public GetScheduledEmailByBatchIdBatchesInner scheduledAt(OffsetDateTime scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * Datetime for which the batch was scheduled + * @return scheduledAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScheduledAt(OffsetDateTime scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetScheduledEmailByBatchIdBatchesInner createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the batch was scheduled + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetScheduledEmailByBatchIdBatchesInner status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Current status of the scheduled batch + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetScheduledEmailByBatchIdBatchesInner getScheduledEmailByBatchIdBatchesInner = (GetScheduledEmailByBatchIdBatchesInner) o; + return Objects.equals(this.scheduledAt, getScheduledEmailByBatchIdBatchesInner.scheduledAt) && + Objects.equals(this.createdAt, getScheduledEmailByBatchIdBatchesInner.createdAt) && + Objects.equals(this.status, getScheduledEmailByBatchIdBatchesInner.status); + } + + @Override + public int hashCode() { + return Objects.hash(scheduledAt, createdAt, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetScheduledEmailByBatchIdBatchesInner {\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailById200Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailById200Response.java new file mode 100644 index 0000000..dd865f9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailById200Response.java @@ -0,0 +1,374 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetScheduledEmailByBatchId; +import software.xdev.brevo.model.GetScheduledEmailByBatchIdBatchesInner; +import software.xdev.brevo.model.GetScheduledEmailByMessageId; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetScheduledEmailById200Response + */ +@JsonPropertyOrder({ + GetScheduledEmailById200Response.JSON_PROPERTY_COUNT, + GetScheduledEmailById200Response.JSON_PROPERTY_BATCHES, + GetScheduledEmailById200Response.JSON_PROPERTY_SCHEDULED_AT, + GetScheduledEmailById200Response.JSON_PROPERTY_CREATED_AT, + GetScheduledEmailById200Response.JSON_PROPERTY_STATUS +}) +@JsonTypeName("getScheduledEmailById_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetScheduledEmailById200Response { + public static final String JSON_PROPERTY_COUNT = "count"; + private Integer count; + + public static final String JSON_PROPERTY_BATCHES = "batches"; + private List batches; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private OffsetDateTime scheduledAt; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + /** + * Current status of the scheduled email + */ + public enum StatusEnum { + INPROGRESS("inProgress"), + + QUEUED("queued"), + + PROCESSED("processed"), + + ERROR("error"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public GetScheduledEmailById200Response() { + } + + public GetScheduledEmailById200Response count(Integer count) { + + this.count = count; + return this; + } + + /** + * Total number of batches + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Integer count) { + this.count = count; + } + + + public GetScheduledEmailById200Response batches(List batches) { + + this.batches = batches; + return this; + } + + public GetScheduledEmailById200Response addBatchesItem(GetScheduledEmailByBatchIdBatchesInner batchesItem) { + if (this.batches == null) { + this.batches = new ArrayList<>(); + } + this.batches.add(batchesItem); + return this; + } + + /** + * Get batches + * @return batches + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBatches() { + return batches; + } + + + @JsonProperty(JSON_PROPERTY_BATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatches(List batches) { + this.batches = batches; + } + + + public GetScheduledEmailById200Response scheduledAt(OffsetDateTime scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * Datetime for which the email was scheduled + * @return scheduledAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScheduledAt(OffsetDateTime scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetScheduledEmailById200Response createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the email was scheduled + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetScheduledEmailById200Response status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Current status of the scheduled email + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetScheduledEmailById200Response getScheduledEmailById200Response = (GetScheduledEmailById200Response) o; + return Objects.equals(this.count, getScheduledEmailById200Response.count) && + Objects.equals(this.batches, getScheduledEmailById200Response.batches) && + Objects.equals(this.scheduledAt, getScheduledEmailById200Response.scheduledAt) && + Objects.equals(this.createdAt, getScheduledEmailById200Response.createdAt) && + Objects.equals(this.status, getScheduledEmailById200Response.status); + } + + @Override + public int hashCode() { + return Objects.hash(count, batches, scheduledAt, createdAt, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetScheduledEmailById200Response {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" batches: ").append(toIndentedString(batches)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batches` to the URL query string + if (getBatches() != null) { + for (int i = 0; i < getBatches().size(); i++) { + if (getBatches().get(i) != null) { + joiner.add(getBatches().get(i).toUrlQueryString(String.format("%sbatches%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByMessageId.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByMessageId.java new file mode 100644 index 0000000..fd71821 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetScheduledEmailByMessageId.java @@ -0,0 +1,276 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetScheduledEmailByMessageId + */ +@JsonPropertyOrder({ + GetScheduledEmailByMessageId.JSON_PROPERTY_SCHEDULED_AT, + GetScheduledEmailByMessageId.JSON_PROPERTY_CREATED_AT, + GetScheduledEmailByMessageId.JSON_PROPERTY_STATUS +}) +@JsonTypeName("getScheduledEmailByMessageId") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetScheduledEmailByMessageId { + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private OffsetDateTime scheduledAt; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + /** + * Current status of the scheduled email + */ + public enum StatusEnum { + INPROGRESS("inProgress"), + + QUEUED("queued"), + + PROCESSED("processed"), + + ERROR("error"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public GetScheduledEmailByMessageId() { + } + + public GetScheduledEmailByMessageId scheduledAt(OffsetDateTime scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * Datetime for which the email was scheduled + * @return scheduledAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScheduledAt(OffsetDateTime scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetScheduledEmailByMessageId createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Datetime on which the email was scheduled + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetScheduledEmailByMessageId status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Current status of the scheduled email + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetScheduledEmailByMessageId getScheduledEmailByMessageId = (GetScheduledEmailByMessageId) o; + return Objects.equals(this.scheduledAt, getScheduledEmailByMessageId.scheduledAt) && + Objects.equals(this.createdAt, getScheduledEmailByMessageId.createdAt) && + Objects.equals(this.status, getScheduledEmailByMessageId.status); + } + + @Override + public int hashCode() { + return Objects.hash(scheduledAt, createdAt, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetScheduledEmailByMessageId {\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSegments.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSegments.java new file mode 100644 index 0000000..40215db --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSegments.java @@ -0,0 +1,197 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSegments + */ +@JsonPropertyOrder({ + GetSegments.JSON_PROPERTY_SEGMENTS, + GetSegments.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getSegments") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSegments { + public static final String JSON_PROPERTY_SEGMENTS = "segments"; + private List segments; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetSegments() { + } + + public GetSegments segments(List segments) { + + this.segments = segments; + return this; + } + + /** + * Listing of all the segments available in your account + * @return segments + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSegments() { + return segments; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegments(List segments) { + this.segments = segments; + } + + + public GetSegments count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of Segments in your account + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSegments getSegments = (GetSegments) o; + return Objects.equals(this.segments, getSegments.segments) && + Objects.equals(this.count, getSegments.count); + } + + @Override + public int hashCode() { + return Objects.hash(segments, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSegments {\n"); + sb.append(" segments: ").append(toIndentedString(segments)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `segments` to the URL query string + if (getSegments() != null) { + try { + joiner.add(String.format("%ssegments%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegments()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersList.java new file mode 100644 index 0000000..e706be3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersList.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetSendersListSendersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSendersList + */ +@JsonPropertyOrder({ + GetSendersList.JSON_PROPERTY_SENDERS +}) +@JsonTypeName("getSendersList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSendersList { + public static final String JSON_PROPERTY_SENDERS = "senders"; + private List senders; + + public GetSendersList() { + } + + public GetSendersList senders(List senders) { + + this.senders = senders; + return this; + } + + public GetSendersList addSendersItem(GetSendersListSendersInner sendersItem) { + if (this.senders == null) { + this.senders = new ArrayList<>(); + } + this.senders.add(sendersItem); + return this; + } + + /** + * List of the senders available in your account + * @return senders + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSenders() { + return senders; + } + + + @JsonProperty(JSON_PROPERTY_SENDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSenders(List senders) { + this.senders = senders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSendersList getSendersList = (GetSendersList) o; + return Objects.equals(this.senders, getSendersList.senders); + } + + @Override + public int hashCode() { + return Objects.hash(senders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSendersList {\n"); + sb.append(" senders: ").append(toIndentedString(senders)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `senders` to the URL query string + if (getSenders() != null) { + for (int i = 0; i < getSenders().size(); i++) { + if (getSenders().get(i) != null) { + joiner.add(getSenders().get(i).toUrlQueryString(String.format("%ssenders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInner.java new file mode 100644 index 0000000..3bd4be3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInner.java @@ -0,0 +1,332 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetSendersListSendersInnerIpsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSendersListSendersInner + */ +@JsonPropertyOrder({ + GetSendersListSendersInner.JSON_PROPERTY_ID, + GetSendersListSendersInner.JSON_PROPERTY_NAME, + GetSendersListSendersInner.JSON_PROPERTY_EMAIL, + GetSendersListSendersInner.JSON_PROPERTY_ACTIVE, + GetSendersListSendersInner.JSON_PROPERTY_IPS +}) +@JsonTypeName("getSendersList_senders_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSendersListSendersInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ACTIVE = "active"; + private Boolean active; + + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips; + + public GetSendersListSendersInner() { + } + + public GetSendersListSendersInner id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the sender + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetSendersListSendersInner name(String name) { + + this.name = name; + return this; + } + + /** + * From Name associated to the sender + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetSendersListSendersInner email(String email) { + + this.email = email; + return this; + } + + /** + * From Email associated to the sender + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetSendersListSendersInner active(Boolean active) { + + this.active = active; + return this; + } + + /** + * Status of sender (true=activated, false=deactivated) + * @return active + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getActive() { + return active; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActive(Boolean active) { + this.active = active; + } + + + public GetSendersListSendersInner ips(List ips) { + + this.ips = ips; + return this; + } + + public GetSendersListSendersInner addIpsItem(GetSendersListSendersInnerIpsInner ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs + * @return ips + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIps(List ips) { + this.ips = ips; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSendersListSendersInner getSendersListSendersInner = (GetSendersListSendersInner) o; + return Objects.equals(this.id, getSendersListSendersInner.id) && + Objects.equals(this.name, getSendersListSendersInner.name) && + Objects.equals(this.email, getSendersListSendersInner.email) && + Objects.equals(this.active, getSendersListSendersInner.active) && + Objects.equals(this.ips, getSendersListSendersInner.ips); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, email, active, ips); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSendersListSendersInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" ips: ").append(toIndentedString(ips)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `active` to the URL query string + if (getActive() != null) { + try { + joiner.add(String.format("%sactive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + if (getIps().get(i) != null) { + joiner.add(getIps().get(i).toUrlQueryString(String.format("%sips%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInnerIpsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInnerIpsInner.java new file mode 100644 index 0000000..1c7377b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSendersListSendersInnerIpsInner.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSendersListSendersInnerIpsInner + */ +@JsonPropertyOrder({ + GetSendersListSendersInnerIpsInner.JSON_PROPERTY_IP, + GetSendersListSendersInnerIpsInner.JSON_PROPERTY_DOMAIN, + GetSendersListSendersInnerIpsInner.JSON_PROPERTY_WEIGHT +}) +@JsonTypeName("getSendersList_senders_inner_ips_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSendersListSendersInnerIpsInner { + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_WEIGHT = "weight"; + private Long weight; + + public GetSendersListSendersInnerIpsInner() { + } + + public GetSendersListSendersInnerIpsInner ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated IP available in your account + * @return ip + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIp(String ip) { + this.ip = ip; + } + + + public GetSendersListSendersInnerIpsInner domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Domain of the IP + * @return domain + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public GetSendersListSendersInnerIpsInner weight(Long weight) { + + this.weight = weight; + return this; + } + + /** + * Weight of the IP for this sender + * @return weight + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getWeight() { + return weight; + } + + + @JsonProperty(JSON_PROPERTY_WEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWeight(Long weight) { + this.weight = weight; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSendersListSendersInnerIpsInner getSendersListSendersInnerIpsInner = (GetSendersListSendersInnerIpsInner) o; + return Objects.equals(this.ip, getSendersListSendersInnerIpsInner.ip) && + Objects.equals(this.domain, getSendersListSendersInnerIpsInner.domain) && + Objects.equals(this.weight, getSendersListSendersInnerIpsInner.weight); + } + + @Override + public int hashCode() { + return Objects.hash(ip, domain, weight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSendersListSendersInnerIpsInner {\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `weight` to the URL query string + if (getWeight() != null) { + try { + joiner.add(String.format("%sweight%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWeight()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSharedTemplateUrl.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSharedTemplateUrl.java new file mode 100644 index 0000000..80e2449 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSharedTemplateUrl.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSharedTemplateUrl + */ +@JsonPropertyOrder({ + GetSharedTemplateUrl.JSON_PROPERTY_SHARED_URL +}) +@JsonTypeName("getSharedTemplateUrl") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSharedTemplateUrl { + public static final String JSON_PROPERTY_SHARED_URL = "sharedUrl"; + private String sharedUrl; + + public GetSharedTemplateUrl() { + } + + public GetSharedTemplateUrl sharedUrl(String sharedUrl) { + + this.sharedUrl = sharedUrl; + return this; + } + + /** + * A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users. + * @return sharedUrl + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHARED_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSharedUrl() { + return sharedUrl; + } + + + @JsonProperty(JSON_PROPERTY_SHARED_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSharedUrl(String sharedUrl) { + this.sharedUrl = sharedUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSharedTemplateUrl getSharedTemplateUrl = (GetSharedTemplateUrl) o; + return Objects.equals(this.sharedUrl, getSharedTemplateUrl.sharedUrl); + } + + @Override + public int hashCode() { + return Objects.hash(sharedUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSharedTemplateUrl {\n"); + sb.append(" sharedUrl: ").append(toIndentedString(sharedUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sharedUrl` to the URL query string + if (getSharedUrl() != null) { + try { + joiner.add(String.format("%ssharedUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSharedUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaign.java new file mode 100644 index 0000000..7ec3ea6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaign.java @@ -0,0 +1,565 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCampaignRecipients; +import software.xdev.brevo.model.GetSmsCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsCampaign + */ +@JsonPropertyOrder({ + GetSmsCampaign.JSON_PROPERTY_ID, + GetSmsCampaign.JSON_PROPERTY_NAME, + GetSmsCampaign.JSON_PROPERTY_STATUS, + GetSmsCampaign.JSON_PROPERTY_CONTENT, + GetSmsCampaign.JSON_PROPERTY_SCHEDULED_AT, + GetSmsCampaign.JSON_PROPERTY_SENDER, + GetSmsCampaign.JSON_PROPERTY_CREATED_AT, + GetSmsCampaign.JSON_PROPERTY_MODIFIED_AT, + GetSmsCampaign.JSON_PROPERTY_RECIPIENTS, + GetSmsCampaign.JSON_PROPERTY_STATISTICS +}) +@JsonTypeName("getSmsCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsCampaign { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * Status of the SMS Campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + INPROCESS("inProcess"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private GetCampaignRecipients recipients; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetSmsCampaignStats statistics; + + public GetSmsCampaign() { + } + + public GetSmsCampaign id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the SMS Campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetSmsCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the SMS Campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetSmsCampaign status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the SMS Campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetSmsCampaign content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the SMS Campaign + * @return content + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; + } + + + public GetSmsCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetSmsCampaign sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Sender of the SMS Campaign + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public GetSmsCampaign createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetSmsCampaign modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetSmsCampaign recipients(GetCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipients(GetCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public GetSmsCampaign statistics(GetSmsCampaignStats statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetSmsCampaignStats getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatistics(GetSmsCampaignStats statistics) { + this.statistics = statistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsCampaign getSmsCampaign = (GetSmsCampaign) o; + return Objects.equals(this.id, getSmsCampaign.id) && + Objects.equals(this.name, getSmsCampaign.name) && + Objects.equals(this.status, getSmsCampaign.status) && + Objects.equals(this.content, getSmsCampaign.content) && + Objects.equals(this.scheduledAt, getSmsCampaign.scheduledAt) && + Objects.equals(this.sender, getSmsCampaign.sender) && + Objects.equals(this.createdAt, getSmsCampaign.createdAt) && + Objects.equals(this.modifiedAt, getSmsCampaign.modifiedAt) && + Objects.equals(this.recipients, getSmsCampaign.recipients) && + Objects.equals(this.statistics, getSmsCampaign.statistics); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, content, scheduledAt, sender, createdAt, modifiedAt, recipients, statistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsCampaign {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignOverview.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignOverview.java new file mode 100644 index 0000000..47e6c99 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignOverview.java @@ -0,0 +1,489 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsCampaignOverview + */ +@JsonPropertyOrder({ + GetSmsCampaignOverview.JSON_PROPERTY_ID, + GetSmsCampaignOverview.JSON_PROPERTY_NAME, + GetSmsCampaignOverview.JSON_PROPERTY_STATUS, + GetSmsCampaignOverview.JSON_PROPERTY_CONTENT, + GetSmsCampaignOverview.JSON_PROPERTY_SCHEDULED_AT, + GetSmsCampaignOverview.JSON_PROPERTY_SENDER, + GetSmsCampaignOverview.JSON_PROPERTY_CREATED_AT, + GetSmsCampaignOverview.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getSmsCampaignOverview") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsCampaignOverview { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * Status of the SMS Campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + INPROCESS("inProcess"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public GetSmsCampaignOverview() { + } + + public GetSmsCampaignOverview id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the SMS Campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetSmsCampaignOverview name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the SMS Campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetSmsCampaignOverview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the SMS Campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetSmsCampaignOverview content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the SMS Campaign + * @return content + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; + } + + + public GetSmsCampaignOverview scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetSmsCampaignOverview sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Sender of the SMS Campaign + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public GetSmsCampaignOverview createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetSmsCampaignOverview modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsCampaignOverview getSmsCampaignOverview = (GetSmsCampaignOverview) o; + return Objects.equals(this.id, getSmsCampaignOverview.id) && + Objects.equals(this.name, getSmsCampaignOverview.name) && + Objects.equals(this.status, getSmsCampaignOverview.status) && + Objects.equals(this.content, getSmsCampaignOverview.content) && + Objects.equals(this.scheduledAt, getSmsCampaignOverview.scheduledAt) && + Objects.equals(this.sender, getSmsCampaignOverview.sender) && + Objects.equals(this.createdAt, getSmsCampaignOverview.createdAt) && + Objects.equals(this.modifiedAt, getSmsCampaignOverview.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, content, scheduledAt, sender, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsCampaignOverview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignStats.java new file mode 100644 index 0000000..b2387a6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignStats.java @@ -0,0 +1,404 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsCampaignStats + */ +@JsonPropertyOrder({ + GetSmsCampaignStats.JSON_PROPERTY_DELIVERED, + GetSmsCampaignStats.JSON_PROPERTY_SENT, + GetSmsCampaignStats.JSON_PROPERTY_PROCESSING, + GetSmsCampaignStats.JSON_PROPERTY_SOFT_BOUNCES, + GetSmsCampaignStats.JSON_PROPERTY_HARD_BOUNCES, + GetSmsCampaignStats.JSON_PROPERTY_UNSUBSCRIPTIONS, + GetSmsCampaignStats.JSON_PROPERTY_ANSWERED +}) +@JsonTypeName("getSmsCampaignStats") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsCampaignStats { + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_SENT = "sent"; + private Long sent; + + public static final String JSON_PROPERTY_PROCESSING = "processing"; + private Long processing; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_UNSUBSCRIPTIONS = "unsubscriptions"; + private Long unsubscriptions; + + public static final String JSON_PROPERTY_ANSWERED = "answered"; + private Long answered; + + public GetSmsCampaignStats() { + } + + public GetSmsCampaignStats delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered SMS + * @return delivered + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetSmsCampaignStats sent(Long sent) { + + this.sent = sent; + return this; + } + + /** + * Number of sent SMS + * @return sent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSent() { + return sent; + } + + + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSent(Long sent) { + this.sent = sent; + } + + + public GetSmsCampaignStats processing(Long processing) { + + this.processing = processing; + return this; + } + + /** + * Number of processing SMS + * @return processing + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROCESSING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getProcessing() { + return processing; + } + + + @JsonProperty(JSON_PROPERTY_PROCESSING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProcessing(Long processing) { + this.processing = processing; + } + + + public GetSmsCampaignStats softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounced SMS + * @return softBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetSmsCampaignStats hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of hardbounced SMS + * @return hardBounces + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetSmsCampaignStats unsubscriptions(Long unsubscriptions) { + + this.unsubscriptions = unsubscriptions; + return this; + } + + /** + * Number of unsubscription SMS + * @return unsubscriptions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getUnsubscriptions() { + return unsubscriptions; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnsubscriptions(Long unsubscriptions) { + this.unsubscriptions = unsubscriptions; + } + + + public GetSmsCampaignStats answered(Long answered) { + + this.answered = answered; + return this; + } + + /** + * Number of replies to the SMS + * @return answered + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ANSWERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getAnswered() { + return answered; + } + + + @JsonProperty(JSON_PROPERTY_ANSWERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAnswered(Long answered) { + this.answered = answered; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsCampaignStats getSmsCampaignStats = (GetSmsCampaignStats) o; + return Objects.equals(this.delivered, getSmsCampaignStats.delivered) && + Objects.equals(this.sent, getSmsCampaignStats.sent) && + Objects.equals(this.processing, getSmsCampaignStats.processing) && + Objects.equals(this.softBounces, getSmsCampaignStats.softBounces) && + Objects.equals(this.hardBounces, getSmsCampaignStats.hardBounces) && + Objects.equals(this.unsubscriptions, getSmsCampaignStats.unsubscriptions) && + Objects.equals(this.answered, getSmsCampaignStats.answered); + } + + @Override + public int hashCode() { + return Objects.hash(delivered, sent, processing, softBounces, hardBounces, unsubscriptions, answered); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsCampaignStats {\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" sent: ").append(toIndentedString(sent)).append("\n"); + sb.append(" processing: ").append(toIndentedString(processing)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" unsubscriptions: ").append(toIndentedString(unsubscriptions)).append("\n"); + sb.append(" answered: ").append(toIndentedString(answered)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sent` to the URL query string + if (getSent() != null) { + try { + joiner.add(String.format("%ssent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `processing` to the URL query string + if (getProcessing() != null) { + try { + joiner.add(String.format("%sprocessing%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProcessing()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscriptions` to the URL query string + if (getUnsubscriptions() != null) { + try { + joiner.add(String.format("%sunsubscriptions%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscriptions()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `answered` to the URL query string + if (getAnswered() != null) { + try { + joiner.add(String.format("%sanswered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnswered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaigns.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaigns.java new file mode 100644 index 0000000..87b630e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaigns.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetSmsCampaignsCampaignsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsCampaigns + */ +@JsonPropertyOrder({ + GetSmsCampaigns.JSON_PROPERTY_CAMPAIGNS, + GetSmsCampaigns.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getSmsCampaigns") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsCampaigns { + public static final String JSON_PROPERTY_CAMPAIGNS = "campaigns"; + private List campaigns; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetSmsCampaigns() { + } + + public GetSmsCampaigns campaigns(List campaigns) { + + this.campaigns = campaigns; + return this; + } + + public GetSmsCampaigns addCampaignsItem(GetSmsCampaignsCampaignsInner campaignsItem) { + if (this.campaigns == null) { + this.campaigns = new ArrayList<>(); + } + this.campaigns.add(campaignsItem); + return this; + } + + /** + * Get campaigns + * @return campaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCampaigns() { + return campaigns; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaigns(List campaigns) { + this.campaigns = campaigns; + } + + + public GetSmsCampaigns count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of SMS campaigns retrieved + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsCampaigns getSmsCampaigns = (GetSmsCampaigns) o; + return Objects.equals(this.campaigns, getSmsCampaigns.campaigns) && + Objects.equals(this.count, getSmsCampaigns.count); + } + + @Override + public int hashCode() { + return Objects.hash(campaigns, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsCampaigns {\n"); + sb.append(" campaigns: ").append(toIndentedString(campaigns)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaigns` to the URL query string + if (getCampaigns() != null) { + for (int i = 0; i < getCampaigns().size(); i++) { + if (getCampaigns().get(i) != null) { + joiner.add(getCampaigns().get(i).toUrlQueryString(String.format("%scampaigns%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignsCampaignsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignsCampaignsInner.java new file mode 100644 index 0000000..81cb890 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsCampaignsCampaignsInner.java @@ -0,0 +1,565 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetCampaignRecipients; +import software.xdev.brevo.model.GetSmsCampaignStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsCampaignsCampaignsInner + */ +@JsonPropertyOrder({ + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_ID, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_NAME, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_STATUS, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_CONTENT, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_SCHEDULED_AT, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_SENDER, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_CREATED_AT, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_MODIFIED_AT, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_RECIPIENTS, + GetSmsCampaignsCampaignsInner.JSON_PROPERTY_STATISTICS +}) +@JsonTypeName("getSmsCampaigns_campaigns_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsCampaignsCampaignsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * Status of the SMS Campaign + */ + public enum StatusEnum { + DRAFT("draft"), + + SENT("sent"), + + ARCHIVE("archive"), + + QUEUED("queued"), + + SUSPENDED("suspended"), + + INPROCESS("inProcess"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private GetCampaignRecipients recipients; + + public static final String JSON_PROPERTY_STATISTICS = "statistics"; + private GetSmsCampaignStats statistics; + + public GetSmsCampaignsCampaignsInner() { + } + + public GetSmsCampaignsCampaignsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the SMS Campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetSmsCampaignsCampaignsInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the SMS Campaign + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetSmsCampaignsCampaignsInner status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the SMS Campaign + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GetSmsCampaignsCampaignsInner content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the SMS Campaign + * @return content + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; + } + + + public GetSmsCampaignsCampaignsInner scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetSmsCampaignsCampaignsInner sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Sender of the SMS Campaign + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public GetSmsCampaignsCampaignsInner createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetSmsCampaignsCampaignsInner modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetSmsCampaignsCampaignsInner recipients(GetCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipients(GetCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public GetSmsCampaignsCampaignsInner statistics(GetSmsCampaignStats statistics) { + + this.statistics = statistics; + return this; + } + + /** + * Get statistics + * @return statistics + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetSmsCampaignStats getStatistics() { + return statistics; + } + + + @JsonProperty(JSON_PROPERTY_STATISTICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatistics(GetSmsCampaignStats statistics) { + this.statistics = statistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsCampaignsCampaignsInner getSmsCampaignsCampaignsInner = (GetSmsCampaignsCampaignsInner) o; + return Objects.equals(this.id, getSmsCampaignsCampaignsInner.id) && + Objects.equals(this.name, getSmsCampaignsCampaignsInner.name) && + Objects.equals(this.status, getSmsCampaignsCampaignsInner.status) && + Objects.equals(this.content, getSmsCampaignsCampaignsInner.content) && + Objects.equals(this.scheduledAt, getSmsCampaignsCampaignsInner.scheduledAt) && + Objects.equals(this.sender, getSmsCampaignsCampaignsInner.sender) && + Objects.equals(this.createdAt, getSmsCampaignsCampaignsInner.createdAt) && + Objects.equals(this.modifiedAt, getSmsCampaignsCampaignsInner.modifiedAt) && + Objects.equals(this.recipients, getSmsCampaignsCampaignsInner.recipients) && + Objects.equals(this.statistics, getSmsCampaignsCampaignsInner.statistics); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, content, scheduledAt, sender, createdAt, modifiedAt, recipients, statistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsCampaignsCampaignsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" statistics: ").append(toIndentedString(statistics)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `statistics` to the URL query string + if (getStatistics() != null) { + joiner.add(getStatistics().toUrlQueryString(prefix + "statistics" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReport.java new file mode 100644 index 0000000..38bba92 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReport.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetSmsEventReportEventsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsEventReport + */ +@JsonPropertyOrder({ + GetSmsEventReport.JSON_PROPERTY_EVENTS +}) +@JsonTypeName("getSmsEventReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsEventReport { + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events; + + public GetSmsEventReport() { + } + + public GetSmsEventReport events(List events) { + + this.events = events; + return this; + } + + public GetSmsEventReport addEventsItem(GetSmsEventReportEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(List events) { + this.events = events; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsEventReport getSmsEventReport = (GetSmsEventReport) o; + return Objects.equals(this.events, getSmsEventReport.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsEventReport {\n"); + sb.append(" events: ").append(toIndentedString(events)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + if (getEvents().get(i) != null) { + joiner.add(getEvents().get(i).toUrlQueryString(String.format("%sevents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReportEventsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReportEventsInner.java new file mode 100644 index 0000000..1aa4498 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmsEventReportEventsInner.java @@ -0,0 +1,455 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmsEventReportEventsInner + */ +@JsonPropertyOrder({ + GetSmsEventReportEventsInner.JSON_PROPERTY_PHONE_NUMBER, + GetSmsEventReportEventsInner.JSON_PROPERTY_DATE, + GetSmsEventReportEventsInner.JSON_PROPERTY_MESSAGE_ID, + GetSmsEventReportEventsInner.JSON_PROPERTY_EVENT, + GetSmsEventReportEventsInner.JSON_PROPERTY_REASON, + GetSmsEventReportEventsInner.JSON_PROPERTY_REPLY, + GetSmsEventReportEventsInner.JSON_PROPERTY_TAG +}) +@JsonTypeName("getSmsEventReport_events_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmsEventReportEventsInner { + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; + private String phoneNumber; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + /** + * Event which occurred + */ + public enum EventEnum { + BOUNCES("bounces"), + + HARDBOUNCES("hardBounces"), + + SOFTBOUNCES("softBounces"), + + DELIVERED("delivered"), + + SENT("sent"), + + ACCEPTED("accepted"), + + UNSUBSCRIPTION("unsubscription"), + + REPLIES("replies"), + + BLOCKED("blocked"), + + REJECTED("rejected"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENT = "event"; + private EventEnum event; + + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_REPLY = "reply"; + private String reply; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public GetSmsEventReportEventsInner() { + } + + public GetSmsEventReportEventsInner phoneNumber(String phoneNumber) { + + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Phone number which has generated the event + * @return phoneNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhoneNumber() { + return phoneNumber; + } + + + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public GetSmsEventReportEventsInner date(String date) { + + this.date = date; + return this; + } + + /** + * UTC date-time on which the event has been generated + * @return date + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(String date) { + this.date = date; + } + + + public GetSmsEventReportEventsInner messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message ID which generated the event + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetSmsEventReportEventsInner event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Event which occurred + * @return event + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventEnum getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvent(EventEnum event) { + this.event = event; + } + + + public GetSmsEventReportEventsInner reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason of bounce (only available if the event is hardbounce or softbounce) + * @return reason + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReason() { + return reason; + } + + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(String reason) { + this.reason = reason; + } + + + public GetSmsEventReportEventsInner reply(String reply) { + + this.reply = reply; + return this; + } + + /** + * Get reply + * @return reply + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReply() { + return reply; + } + + + @JsonProperty(JSON_PROPERTY_REPLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReply(String reply) { + this.reply = reply; + } + + + public GetSmsEventReportEventsInner tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the SMS which generated the event + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsEventReportEventsInner getSmsEventReportEventsInner = (GetSmsEventReportEventsInner) o; + return Objects.equals(this.phoneNumber, getSmsEventReportEventsInner.phoneNumber) && + Objects.equals(this.date, getSmsEventReportEventsInner.date) && + Objects.equals(this.messageId, getSmsEventReportEventsInner.messageId) && + Objects.equals(this.event, getSmsEventReportEventsInner.event) && + Objects.equals(this.reason, getSmsEventReportEventsInner.reason) && + Objects.equals(this.reply, getSmsEventReportEventsInner.reply) && + Objects.equals(this.tag, getSmsEventReportEventsInner.tag); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumber, date, messageId, event, reason, reply, tag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsEventReportEventsInner {\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" reply: ").append(toIndentedString(reply)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `phoneNumber` to the URL query string + if (getPhoneNumber() != null) { + try { + joiner.add(String.format("%sphoneNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhoneNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `event` to the URL query string + if (getEvent() != null) { + try { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEvent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `reason` to the URL query string + if (getReason() != null) { + try { + joiner.add(String.format("%sreason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReason()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `reply` to the URL query string + if (getReply() != null) { + try { + joiner.add(String.format("%sreply%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReply()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverview.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverview.java new file mode 100644 index 0000000..cfbd104 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverview.java @@ -0,0 +1,652 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetSmtpTemplateOverviewSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmtpTemplateOverview + */ +@JsonPropertyOrder({ + GetSmtpTemplateOverview.JSON_PROPERTY_ID, + GetSmtpTemplateOverview.JSON_PROPERTY_NAME, + GetSmtpTemplateOverview.JSON_PROPERTY_SUBJECT, + GetSmtpTemplateOverview.JSON_PROPERTY_IS_ACTIVE, + GetSmtpTemplateOverview.JSON_PROPERTY_TEST_SENT, + GetSmtpTemplateOverview.JSON_PROPERTY_SENDER, + GetSmtpTemplateOverview.JSON_PROPERTY_REPLY_TO, + GetSmtpTemplateOverview.JSON_PROPERTY_TO_FIELD, + GetSmtpTemplateOverview.JSON_PROPERTY_TAG, + GetSmtpTemplateOverview.JSON_PROPERTY_HTML_CONTENT, + GetSmtpTemplateOverview.JSON_PROPERTY_CREATED_AT, + GetSmtpTemplateOverview.JSON_PROPERTY_MODIFIED_AT, + GetSmtpTemplateOverview.JSON_PROPERTY_DOI_TEMPLATE +}) +@JsonTypeName("getSmtpTemplateOverview") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmtpTemplateOverview { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_IS_ACTIVE = "isActive"; + private Boolean isActive; + + public static final String JSON_PROPERTY_TEST_SENT = "testSent"; + private Boolean testSent; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private GetSmtpTemplateOverviewSender sender; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_DOI_TEMPLATE = "doiTemplate"; + private Boolean doiTemplate; + + public GetSmtpTemplateOverview() { + } + + public GetSmtpTemplateOverview id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the template + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetSmtpTemplateOverview name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the template + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetSmtpTemplateOverview subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the template + * @return subject + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetSmtpTemplateOverview isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Status of template (true=active, false=inactive) + * @return isActive + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + + public GetSmtpTemplateOverview testSent(Boolean testSent) { + + this.testSent = testSent; + return this; + } + + /** + * Status of test sending for the template (true=test email has been sent, false=test email has not been sent) + * @return testSent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getTestSent() { + return testSent; + } + + + @JsonProperty(JSON_PROPERTY_TEST_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestSent(Boolean testSent) { + this.testSent = testSent; + } + + + public GetSmtpTemplateOverview sender(GetSmtpTemplateOverviewSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetSmtpTemplateOverviewSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(GetSmtpTemplateOverviewSender sender) { + this.sender = sender; + } + + + public GetSmtpTemplateOverview replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email defined as the \"Reply to\" for the template + * @return replyTo + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public GetSmtpTemplateOverview toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * Customisation of the \"to\" field for the template + * @return toField + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToField(String toField) { + this.toField = toField; + } + + + public GetSmtpTemplateOverview tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the template + * @return tag + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTag(String tag) { + this.tag = tag; + } + + + public GetSmtpTemplateOverview htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * HTML content of the template + * @return htmlContent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public GetSmtpTemplateOverview createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetSmtpTemplateOverview modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetSmtpTemplateOverview doiTemplate(Boolean doiTemplate) { + + this.doiTemplate = doiTemplate; + return this; + } + + /** + * It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. + * @return doiTemplate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOI_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDoiTemplate() { + return doiTemplate; + } + + + @JsonProperty(JSON_PROPERTY_DOI_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDoiTemplate(Boolean doiTemplate) { + this.doiTemplate = doiTemplate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmtpTemplateOverview getSmtpTemplateOverview = (GetSmtpTemplateOverview) o; + return Objects.equals(this.id, getSmtpTemplateOverview.id) && + Objects.equals(this.name, getSmtpTemplateOverview.name) && + Objects.equals(this.subject, getSmtpTemplateOverview.subject) && + Objects.equals(this.isActive, getSmtpTemplateOverview.isActive) && + Objects.equals(this.testSent, getSmtpTemplateOverview.testSent) && + Objects.equals(this.sender, getSmtpTemplateOverview.sender) && + Objects.equals(this.replyTo, getSmtpTemplateOverview.replyTo) && + Objects.equals(this.toField, getSmtpTemplateOverview.toField) && + Objects.equals(this.tag, getSmtpTemplateOverview.tag) && + Objects.equals(this.htmlContent, getSmtpTemplateOverview.htmlContent) && + Objects.equals(this.createdAt, getSmtpTemplateOverview.createdAt) && + Objects.equals(this.modifiedAt, getSmtpTemplateOverview.modifiedAt) && + Objects.equals(this.doiTemplate, getSmtpTemplateOverview.doiTemplate); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, subject, isActive, testSent, sender, replyTo, toField, tag, htmlContent, createdAt, modifiedAt, doiTemplate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmtpTemplateOverview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" testSent: ").append(toIndentedString(testSent)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" doiTemplate: ").append(toIndentedString(doiTemplate)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isActive` to the URL query string + if (getIsActive() != null) { + try { + joiner.add(String.format("%sisActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `testSent` to the URL query string + if (getTestSent() != null) { + try { + joiner.add(String.format("%stestSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTestSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `doiTemplate` to the URL query string + if (getDoiTemplate() != null) { + try { + joiner.add(String.format("%sdoiTemplate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDoiTemplate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverviewSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverviewSender.java new file mode 100644 index 0000000..1d1ef9c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplateOverviewSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmtpTemplateOverviewSender + */ +@JsonPropertyOrder({ + GetSmtpTemplateOverviewSender.JSON_PROPERTY_NAME, + GetSmtpTemplateOverviewSender.JSON_PROPERTY_EMAIL, + GetSmtpTemplateOverviewSender.JSON_PROPERTY_ID +}) +@JsonTypeName("getSmtpTemplateOverview_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmtpTemplateOverviewSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public GetSmtpTemplateOverviewSender() { + } + + public GetSmtpTemplateOverviewSender name(String name) { + + this.name = name; + return this; + } + + /** + * From email for the template + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public GetSmtpTemplateOverviewSender email(String email) { + + this.email = email; + return this; + } + + /** + * From email for the template + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public GetSmtpTemplateOverviewSender id(String id) { + + this.id = id; + return this; + } + + /** + * Sender id of the template + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmtpTemplateOverviewSender getSmtpTemplateOverviewSender = (GetSmtpTemplateOverviewSender) o; + return Objects.equals(this.name, getSmtpTemplateOverviewSender.name) && + Objects.equals(this.email, getSmtpTemplateOverviewSender.email) && + Objects.equals(this.id, getSmtpTemplateOverviewSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmtpTemplateOverviewSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplates.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplates.java new file mode 100644 index 0000000..cf80f98 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSmtpTemplates.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetSmtpTemplateOverview; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSmtpTemplates + */ +@JsonPropertyOrder({ + GetSmtpTemplates.JSON_PROPERTY_COUNT, + GetSmtpTemplates.JSON_PROPERTY_TEMPLATES +}) +@JsonTypeName("getSmtpTemplates") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSmtpTemplates { + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_TEMPLATES = "templates"; + private List templates; + + public GetSmtpTemplates() { + } + + public GetSmtpTemplates count(Long count) { + + this.count = count; + return this; + } + + /** + * Count of transactional email templates + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + + public GetSmtpTemplates templates(List templates) { + + this.templates = templates; + return this; + } + + public GetSmtpTemplates addTemplatesItem(GetSmtpTemplateOverview templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); + } + this.templates.add(templatesItem); + return this; + } + + /** + * Get templates + * @return templates + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTemplates() { + return templates; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplates(List templates) { + this.templates = templates; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmtpTemplates getSmtpTemplates = (GetSmtpTemplates) o; + return Objects.equals(this.count, getSmtpTemplates.count) && + Objects.equals(this.templates, getSmtpTemplates.templates); + } + + @Override + public int hashCode() { + return Objects.hash(count, templates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmtpTemplates {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" templates: ").append(toIndentedString(templates)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templates` to the URL query string + if (getTemplates() != null) { + for (int i = 0; i < getTemplates().size(); i++) { + if (getTemplates().get(i) != null) { + joiner.add(getTemplates().get(i).toUrlQueryString(String.format("%stemplates%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSsoToken.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSsoToken.java new file mode 100644 index 0000000..2a50592 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSsoToken.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSsoToken + */ +@JsonPropertyOrder({ + GetSsoToken.JSON_PROPERTY_TOKEN +}) +@JsonTypeName("getSsoToken") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSsoToken { + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public GetSsoToken() { + } + + public GetSsoToken token(String token) { + + this.token = token; + return this; + } + + /** + * Session token, it will remain valid for 15 days. + * @return token + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToken(String token) { + this.token = token; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSsoToken getSsoToken = (GetSsoToken) o; + return Objects.equals(this.token, getSsoToken.token); + } + + @Override + public int hashCode() { + return Objects.hash(token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSsoToken {\n"); + sb.append(" token: ").append(toIndentedString(token)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `token` to the URL query string + if (getToken() != null) { + try { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToken()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetStatsByDevice.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetStatsByDevice.java new file mode 100644 index 0000000..934f8be --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetStatsByDevice.java @@ -0,0 +1,313 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import software.xdev.brevo.model.GetDeviceBrowserStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetStatsByDevice + */ +@JsonPropertyOrder({ + GetStatsByDevice.JSON_PROPERTY_DESKTOP, + GetStatsByDevice.JSON_PROPERTY_MOBILE, + GetStatsByDevice.JSON_PROPERTY_TABLET, + GetStatsByDevice.JSON_PROPERTY_UNKNOWN +}) +@JsonTypeName("getStatsByDevice") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetStatsByDevice { + public static final String JSON_PROPERTY_DESKTOP = "desktop"; + private Map desktop = new HashMap<>(); + + public static final String JSON_PROPERTY_MOBILE = "mobile"; + private Map mobile = new HashMap<>(); + + public static final String JSON_PROPERTY_TABLET = "tablet"; + private Map tablet = new HashMap<>(); + + public static final String JSON_PROPERTY_UNKNOWN = "unknown"; + private Map unknown = new HashMap<>(); + + public GetStatsByDevice() { + } + + public GetStatsByDevice desktop(Map desktop) { + + this.desktop = desktop; + return this; + } + + public GetStatsByDevice putDesktopItem(String key, GetDeviceBrowserStats desktopItem) { + if (this.desktop == null) { + this.desktop = new HashMap<>(); + } + this.desktop.put(key, desktopItem); + return this; + } + + /** + * Statistics of the campaign on the basis of desktop devices + * @return desktop + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESKTOP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getDesktop() { + return desktop; + } + + + @JsonProperty(JSON_PROPERTY_DESKTOP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDesktop(Map desktop) { + this.desktop = desktop; + } + + + public GetStatsByDevice mobile(Map mobile) { + + this.mobile = mobile; + return this; + } + + public GetStatsByDevice putMobileItem(String key, GetDeviceBrowserStats mobileItem) { + if (this.mobile == null) { + this.mobile = new HashMap<>(); + } + this.mobile.put(key, mobileItem); + return this; + } + + /** + * Statistics of the campaign on the basis of mobile devices + * @return mobile + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MOBILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMobile() { + return mobile; + } + + + @JsonProperty(JSON_PROPERTY_MOBILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMobile(Map mobile) { + this.mobile = mobile; + } + + + public GetStatsByDevice tablet(Map tablet) { + + this.tablet = tablet; + return this; + } + + public GetStatsByDevice putTabletItem(String key, GetDeviceBrowserStats tabletItem) { + if (this.tablet == null) { + this.tablet = new HashMap<>(); + } + this.tablet.put(key, tabletItem); + return this; + } + + /** + * Statistics of the campaign on the basis of tablet devices + * @return tablet + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TABLET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getTablet() { + return tablet; + } + + + @JsonProperty(JSON_PROPERTY_TABLET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTablet(Map tablet) { + this.tablet = tablet; + } + + + public GetStatsByDevice unknown(Map unknown) { + + this.unknown = unknown; + return this; + } + + public GetStatsByDevice putUnknownItem(String key, GetDeviceBrowserStats unknownItem) { + if (this.unknown == null) { + this.unknown = new HashMap<>(); + } + this.unknown.put(key, unknownItem); + return this; + } + + /** + * Statistics of the campaign on the basis of unknown devices + * @return unknown + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNKNOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getUnknown() { + return unknown; + } + + + @JsonProperty(JSON_PROPERTY_UNKNOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnknown(Map unknown) { + this.unknown = unknown; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatsByDevice getStatsByDevice = (GetStatsByDevice) o; + return Objects.equals(this.desktop, getStatsByDevice.desktop) && + Objects.equals(this.mobile, getStatsByDevice.mobile) && + Objects.equals(this.tablet, getStatsByDevice.tablet) && + Objects.equals(this.unknown, getStatsByDevice.unknown); + } + + @Override + public int hashCode() { + return Objects.hash(desktop, mobile, tablet, unknown); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatsByDevice {\n"); + sb.append(" desktop: ").append(toIndentedString(desktop)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" tablet: ").append(toIndentedString(tablet)).append("\n"); + sb.append(" unknown: ").append(toIndentedString(unknown)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `desktop` to the URL query string + if (getDesktop() != null) { + for (String _key : getDesktop().keySet()) { + if (getDesktop().get(_key) != null) { + joiner.add(getDesktop().get(_key).toUrlQueryString(String.format("%sdesktop%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `mobile` to the URL query string + if (getMobile() != null) { + for (String _key : getMobile().keySet()) { + if (getMobile().get(_key) != null) { + joiner.add(getMobile().get(_key).toUrlQueryString(String.format("%smobile%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `tablet` to the URL query string + if (getTablet() != null) { + for (String _key : getTablet().keySet()) { + if (getTablet().get(_key) != null) { + joiner.add(getTablet().get(_key).toUrlQueryString(String.format("%stablet%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `unknown` to the URL query string + if (getUnknown() != null) { + for (String _key : getUnknown().keySet()) { + if (getUnknown().get(_key) != null) { + joiner.add(getUnknown().get(_key).toUrlQueryString(String.format("%sunknown%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSubAccountGroups200ResponseInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSubAccountGroups200ResponseInner.java new file mode 100644 index 0000000..76f55d3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetSubAccountGroups200ResponseInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetSubAccountGroups200ResponseInner + */ +@JsonPropertyOrder({ + GetSubAccountGroups200ResponseInner.JSON_PROPERTY_ID, + GetSubAccountGroups200ResponseInner.JSON_PROPERTY_GROUP_NAME +}) +@JsonTypeName("getSubAccountGroups_200_response_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSubAccountGroups200ResponseInner { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_GROUP_NAME = "groupName"; + private String groupName; + + public GetSubAccountGroups200ResponseInner() { + } + + public GetSubAccountGroups200ResponseInner id(String id) { + + this.id = id; + return this; + } + + /** + * Unique id of the group + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public GetSubAccountGroups200ResponseInner groupName(String groupName) { + + this.groupName = groupName; + return this; + } + + /** + * The name of the group of sub-accounts + * @return groupName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupName() { + return groupName; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubAccountGroups200ResponseInner getSubAccountGroups200ResponseInner = (GetSubAccountGroups200ResponseInner) o; + return Objects.equals(this.id, getSubAccountGroups200ResponseInner.id) && + Objects.equals(this.groupName, getSubAccountGroups200ResponseInner.groupName); + } + + @Override + public int hashCode() { + return Objects.hash(id, groupName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubAccountGroups200ResponseInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `groupName` to the URL query string + if (getGroupName() != null) { + try { + joiner.add(String.format("%sgroupName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGroupName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacAggregatedSmsReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacAggregatedSmsReport.java new file mode 100644 index 0000000..33f7f66 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacAggregatedSmsReport.java @@ -0,0 +1,530 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacAggregatedSmsReport + */ +@JsonPropertyOrder({ + GetTransacAggregatedSmsReport.JSON_PROPERTY_RANGE, + GetTransacAggregatedSmsReport.JSON_PROPERTY_REQUESTS, + GetTransacAggregatedSmsReport.JSON_PROPERTY_DELIVERED, + GetTransacAggregatedSmsReport.JSON_PROPERTY_HARD_BOUNCES, + GetTransacAggregatedSmsReport.JSON_PROPERTY_SOFT_BOUNCES, + GetTransacAggregatedSmsReport.JSON_PROPERTY_BLOCKED, + GetTransacAggregatedSmsReport.JSON_PROPERTY_UNSUBSCRIBED, + GetTransacAggregatedSmsReport.JSON_PROPERTY_REPLIED, + GetTransacAggregatedSmsReport.JSON_PROPERTY_ACCEPTED, + GetTransacAggregatedSmsReport.JSON_PROPERTY_REJECTED +}) +@JsonTypeName("getTransacAggregatedSmsReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacAggregatedSmsReport { + public static final String JSON_PROPERTY_RANGE = "range"; + private String range; + + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private Long requests; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_BLOCKED = "blocked"; + private Long blocked; + + public static final String JSON_PROPERTY_UNSUBSCRIBED = "unsubscribed"; + private Long unsubscribed; + + public static final String JSON_PROPERTY_REPLIED = "replied"; + private Long replied; + + public static final String JSON_PROPERTY_ACCEPTED = "accepted"; + private Long accepted; + + public static final String JSON_PROPERTY_REJECTED = "rejected"; + private Long rejected; + + public GetTransacAggregatedSmsReport() { + } + + public GetTransacAggregatedSmsReport range(String range) { + + this.range = range; + return this; + } + + /** + * Time frame of the report + * @return range + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRange() { + return range; + } + + + @JsonProperty(JSON_PROPERTY_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRange(String range) { + this.range = range; + } + + + public GetTransacAggregatedSmsReport requests(Long requests) { + + this.requests = requests; + return this; + } + + /** + * Number of requests for the timeframe + * @return requests + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRequests() { + return requests; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequests(Long requests) { + this.requests = requests; + } + + + public GetTransacAggregatedSmsReport delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered SMS for the timeframe + * @return delivered + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetTransacAggregatedSmsReport hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of hardbounces for the timeframe + * @return hardBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetTransacAggregatedSmsReport softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounces for the timeframe + * @return softBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetTransacAggregatedSmsReport blocked(Long blocked) { + + this.blocked = blocked; + return this; + } + + /** + * Number of blocked contact for the timeframe + * @return blocked + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getBlocked() { + return blocked; + } + + + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlocked(Long blocked) { + this.blocked = blocked; + } + + + public GetTransacAggregatedSmsReport unsubscribed(Long unsubscribed) { + + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Number of unsubscription for the timeframe + * @return unsubscribed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUnsubscribed() { + return unsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscribed(Long unsubscribed) { + this.unsubscribed = unsubscribed; + } + + + public GetTransacAggregatedSmsReport replied(Long replied) { + + this.replied = replied; + return this; + } + + /** + * Number of answered SMS for the timeframe + * @return replied + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReplied() { + return replied; + } + + + @JsonProperty(JSON_PROPERTY_REPLIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplied(Long replied) { + this.replied = replied; + } + + + public GetTransacAggregatedSmsReport accepted(Long accepted) { + + this.accepted = accepted; + return this; + } + + /** + * Number of accepted for the timeframe + * @return accepted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCEPTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getAccepted() { + return accepted; + } + + + @JsonProperty(JSON_PROPERTY_ACCEPTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccepted(Long accepted) { + this.accepted = accepted; + } + + + public GetTransacAggregatedSmsReport rejected(Long rejected) { + + this.rejected = rejected; + return this; + } + + /** + * Number of rejected for the timeframe + * @return rejected + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REJECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRejected() { + return rejected; + } + + + @JsonProperty(JSON_PROPERTY_REJECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRejected(Long rejected) { + this.rejected = rejected; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacAggregatedSmsReport getTransacAggregatedSmsReport = (GetTransacAggregatedSmsReport) o; + return Objects.equals(this.range, getTransacAggregatedSmsReport.range) && + Objects.equals(this.requests, getTransacAggregatedSmsReport.requests) && + Objects.equals(this.delivered, getTransacAggregatedSmsReport.delivered) && + Objects.equals(this.hardBounces, getTransacAggregatedSmsReport.hardBounces) && + Objects.equals(this.softBounces, getTransacAggregatedSmsReport.softBounces) && + Objects.equals(this.blocked, getTransacAggregatedSmsReport.blocked) && + Objects.equals(this.unsubscribed, getTransacAggregatedSmsReport.unsubscribed) && + Objects.equals(this.replied, getTransacAggregatedSmsReport.replied) && + Objects.equals(this.accepted, getTransacAggregatedSmsReport.accepted) && + Objects.equals(this.rejected, getTransacAggregatedSmsReport.rejected); + } + + @Override + public int hashCode() { + return Objects.hash(range, requests, delivered, hardBounces, softBounces, blocked, unsubscribed, replied, accepted, rejected); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacAggregatedSmsReport {\n"); + sb.append(" range: ").append(toIndentedString(range)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); + sb.append(" unsubscribed: ").append(toIndentedString(unsubscribed)).append("\n"); + sb.append(" replied: ").append(toIndentedString(replied)).append("\n"); + sb.append(" accepted: ").append(toIndentedString(accepted)).append("\n"); + sb.append(" rejected: ").append(toIndentedString(rejected)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `range` to the URL query string + if (getRange() != null) { + try { + joiner.add(String.format("%srange%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRange()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `requests` to the URL query string + if (getRequests() != null) { + try { + joiner.add(String.format("%srequests%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRequests()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `blocked` to the URL query string + if (getBlocked() != null) { + try { + joiner.add(String.format("%sblocked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBlocked()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribed` to the URL query string + if (getUnsubscribed() != null) { + try { + joiner.add(String.format("%sunsubscribed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replied` to the URL query string + if (getReplied() != null) { + try { + joiner.add(String.format("%sreplied%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplied()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `accepted` to the URL query string + if (getAccepted() != null) { + try { + joiner.add(String.format("%saccepted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAccepted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `rejected` to the URL query string + if (getRejected() != null) { + try { + joiner.add(String.format("%srejected%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRejected()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContacts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContacts.java new file mode 100644 index 0000000..24dbf14 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContacts.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetTransacBlockedContactsContactsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacBlockedContacts + */ +@JsonPropertyOrder({ + GetTransacBlockedContacts.JSON_PROPERTY_COUNT, + GetTransacBlockedContacts.JSON_PROPERTY_CONTACTS +}) +@JsonTypeName("getTransacBlockedContacts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacBlockedContacts { + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_CONTACTS = "contacts"; + private List contacts; + + public GetTransacBlockedContacts() { + } + + public GetTransacBlockedContacts count(Long count) { + + this.count = count; + return this; + } + + /** + * Count of blocked or unsubscribed contact + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + + public GetTransacBlockedContacts contacts(List contacts) { + + this.contacts = contacts; + return this; + } + + public GetTransacBlockedContacts addContactsItem(GetTransacBlockedContactsContactsInner contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * Get contacts + * @return contacts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContacts() { + return contacts; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContacts(List contacts) { + this.contacts = contacts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacBlockedContacts getTransacBlockedContacts = (GetTransacBlockedContacts) o; + return Objects.equals(this.count, getTransacBlockedContacts.count) && + Objects.equals(this.contacts, getTransacBlockedContacts.contacts); + } + + @Override + public int hashCode() { + return Objects.hash(count, contacts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacBlockedContacts {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contacts` to the URL query string + if (getContacts() != null) { + for (int i = 0; i < getContacts().size(); i++) { + if (getContacts().get(i) != null) { + joiner.add(getContacts().get(i).toUrlQueryString(String.format("%scontacts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInner.java new file mode 100644 index 0000000..49af2ca --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInner.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.GetTransacBlockedContactsContactsInnerReason; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacBlockedContactsContactsInner + */ +@JsonPropertyOrder({ + GetTransacBlockedContactsContactsInner.JSON_PROPERTY_EMAIL, + GetTransacBlockedContactsContactsInner.JSON_PROPERTY_SENDER_EMAIL, + GetTransacBlockedContactsContactsInner.JSON_PROPERTY_REASON, + GetTransacBlockedContactsContactsInner.JSON_PROPERTY_BLOCKED_AT +}) +@JsonTypeName("getTransacBlockedContacts_contacts_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacBlockedContactsContactsInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_SENDER_EMAIL = "senderEmail"; + private String senderEmail; + + public static final String JSON_PROPERTY_REASON = "reason"; + private GetTransacBlockedContactsContactsInnerReason reason; + + public static final String JSON_PROPERTY_BLOCKED_AT = "blockedAt"; + private String blockedAt; + + public GetTransacBlockedContactsContactsInner() { + } + + public GetTransacBlockedContactsContactsInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the blocked or unsubscribed contact + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetTransacBlockedContactsContactsInner senderEmail(String senderEmail) { + + this.senderEmail = senderEmail; + return this; + } + + /** + * Sender email address of the blocked or unsubscribed contact + * @return senderEmail + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderEmail() { + return senderEmail; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderEmail(String senderEmail) { + this.senderEmail = senderEmail; + } + + + public GetTransacBlockedContactsContactsInner reason(GetTransacBlockedContactsContactsInnerReason reason) { + + this.reason = reason; + return this; + } + + /** + * Get reason + * @return reason + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public GetTransacBlockedContactsContactsInnerReason getReason() { + return reason; + } + + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReason(GetTransacBlockedContactsContactsInnerReason reason) { + this.reason = reason; + } + + + public GetTransacBlockedContactsContactsInner blockedAt(String blockedAt) { + + this.blockedAt = blockedAt; + return this; + } + + /** + * Date when the contact was blocked or unsubscribed on + * @return blockedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BLOCKED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBlockedAt() { + return blockedAt; + } + + + @JsonProperty(JSON_PROPERTY_BLOCKED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBlockedAt(String blockedAt) { + this.blockedAt = blockedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacBlockedContactsContactsInner getTransacBlockedContactsContactsInner = (GetTransacBlockedContactsContactsInner) o; + return Objects.equals(this.email, getTransacBlockedContactsContactsInner.email) && + Objects.equals(this.senderEmail, getTransacBlockedContactsContactsInner.senderEmail) && + Objects.equals(this.reason, getTransacBlockedContactsContactsInner.reason) && + Objects.equals(this.blockedAt, getTransacBlockedContactsContactsInner.blockedAt); + } + + @Override + public int hashCode() { + return Objects.hash(email, senderEmail, reason, blockedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacBlockedContactsContactsInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" senderEmail: ").append(toIndentedString(senderEmail)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" blockedAt: ").append(toIndentedString(blockedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `senderEmail` to the URL query string + if (getSenderEmail() != null) { + try { + joiner.add(String.format("%ssenderEmail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `reason` to the URL query string + if (getReason() != null) { + joiner.add(getReason().toUrlQueryString(prefix + "reason" + suffix)); + } + + // add `blockedAt` to the URL query string + if (getBlockedAt() != null) { + try { + joiner.add(String.format("%sblockedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBlockedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInnerReason.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInnerReason.java new file mode 100644 index 0000000..1779580 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacBlockedContactsContactsInnerReason.java @@ -0,0 +1,237 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Reason for blocking / unsubscribing + */ +@JsonPropertyOrder({ + GetTransacBlockedContactsContactsInnerReason.JSON_PROPERTY_CODE, + GetTransacBlockedContactsContactsInnerReason.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("getTransacBlockedContacts_contacts_inner_reason") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacBlockedContactsContactsInnerReason { + /** + * Reason code for blocking / unsubscribing (This code is safe for comparison) + */ + public enum CodeEnum { + UNSUBSCRIBEDVIAMA("unsubscribedViaMA"), + + UNSUBSCRIBEDVIAEMAIL("unsubscribedViaEmail"), + + ADMINBLOCKED("adminBlocked"), + + UNSUBSCRIBEDVIAAPI("unsubscribedViaApi"), + + HARDBOUNCE("hardBounce"), + + CONTACTFLAGGEDASSPAM("contactFlaggedAsSpam"); + + private String value; + + CodeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CodeEnum fromValue(String value) { + for (CodeEnum b : CodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CODE = "code"; + private CodeEnum code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public GetTransacBlockedContactsContactsInnerReason() { + } + + public GetTransacBlockedContactsContactsInnerReason code(CodeEnum code) { + + this.code = code; + return this; + } + + /** + * Reason code for blocking / unsubscribing (This code is safe for comparison) + * @return code + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CodeEnum getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(CodeEnum code) { + this.code = code; + } + + + public GetTransacBlockedContactsContactsInnerReason message(String message) { + + this.message = message; + return this; + } + + /** + * Reason for blocking / unsubscribing (This string is not safe for comparison) + * @return message + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacBlockedContactsContactsInnerReason getTransacBlockedContactsContactsInnerReason = (GetTransacBlockedContactsContactsInnerReason) o; + return Objects.equals(this.code, getTransacBlockedContactsContactsInnerReason.code) && + Objects.equals(this.message, getTransacBlockedContactsContactsInnerReason.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacBlockedContactsContactsInnerReason {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + try { + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContent.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContent.java new file mode 100644 index 0000000..3df84c5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContent.java @@ -0,0 +1,416 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetTransacEmailContentEventsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacEmailContent + */ +@JsonPropertyOrder({ + GetTransacEmailContent.JSON_PROPERTY_EMAIL, + GetTransacEmailContent.JSON_PROPERTY_SUBJECT, + GetTransacEmailContent.JSON_PROPERTY_TEMPLATE_ID, + GetTransacEmailContent.JSON_PROPERTY_DATE, + GetTransacEmailContent.JSON_PROPERTY_EVENTS, + GetTransacEmailContent.JSON_PROPERTY_BODY, + GetTransacEmailContent.JSON_PROPERTY_ATTACHMENT_COUNT +}) +@JsonTypeName("getTransacEmailContent") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacEmailContent { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events = new ArrayList<>(); + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + public static final String JSON_PROPERTY_ATTACHMENT_COUNT = "attachmentCount"; + private Long attachmentCount; + + public GetTransacEmailContent() { + } + + public GetTransacEmailContent email(String email) { + + this.email = email; + return this; + } + + /** + * Email address to which transactional email has been sent + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetTransacEmailContent subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the sent email + * @return subject + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetTransacEmailContent templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the template + * @return templateId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + + public GetTransacEmailContent date(String date) { + + this.date = date; + return this; + } + + /** + * Date on which transactional email was sent + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(String date) { + this.date = date; + } + + + public GetTransacEmailContent events(List events) { + + this.events = events; + return this; + } + + public GetTransacEmailContent addEventsItem(GetTransacEmailContentEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Series of events which occurred on the transactional email + * @return events + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvents(List events) { + this.events = events; + } + + + public GetTransacEmailContent body(String body) { + + this.body = body; + return this; + } + + /** + * Actual content of the transactional email that has been sent + * @return body + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBody(String body) { + this.body = body; + } + + + public GetTransacEmailContent attachmentCount(Long attachmentCount) { + + this.attachmentCount = attachmentCount; + return this; + } + + /** + * Count of the attachments that were sent in the email + * @return attachmentCount + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ATTACHMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getAttachmentCount() { + return attachmentCount; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAttachmentCount(Long attachmentCount) { + this.attachmentCount = attachmentCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacEmailContent getTransacEmailContent = (GetTransacEmailContent) o; + return Objects.equals(this.email, getTransacEmailContent.email) && + Objects.equals(this.subject, getTransacEmailContent.subject) && + Objects.equals(this.templateId, getTransacEmailContent.templateId) && + Objects.equals(this.date, getTransacEmailContent.date) && + Objects.equals(this.events, getTransacEmailContent.events) && + Objects.equals(this.body, getTransacEmailContent.body) && + Objects.equals(this.attachmentCount, getTransacEmailContent.attachmentCount); + } + + @Override + public int hashCode() { + return Objects.hash(email, subject, templateId, date, events, body, attachmentCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacEmailContent {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" attachmentCount: ").append(toIndentedString(attachmentCount)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + if (getEvents().get(i) != null) { + joiner.add(getEvents().get(i).toUrlQueryString(String.format("%sevents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `body` to the URL query string + if (getBody() != null) { + try { + joiner.add(String.format("%sbody%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBody()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attachmentCount` to the URL query string + if (getAttachmentCount() != null) { + try { + joiner.add(String.format("%sattachmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttachmentCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContentEventsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContentEventsInner.java new file mode 100644 index 0000000..9b609ae --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailContentEventsInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacEmailContentEventsInner + */ +@JsonPropertyOrder({ + GetTransacEmailContentEventsInner.JSON_PROPERTY_NAME, + GetTransacEmailContentEventsInner.JSON_PROPERTY_TIME +}) +@JsonTypeName("getTransacEmailContent_events_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacEmailContentEventsInner { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TIME = "time"; + private String time; + + public GetTransacEmailContentEventsInner() { + } + + public GetTransacEmailContentEventsInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the event that occurred on the sent email + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetTransacEmailContentEventsInner time(String time) { + + this.time = time; + return this; + } + + /** + * Time at which the event occurred + * @return time + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTime() { + return time; + } + + + @JsonProperty(JSON_PROPERTY_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTime(String time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacEmailContentEventsInner getTransacEmailContentEventsInner = (GetTransacEmailContentEventsInner) o; + return Objects.equals(this.name, getTransacEmailContentEventsInner.name) && + Objects.equals(this.time, getTransacEmailContentEventsInner.time); + } + + @Override + public int hashCode() { + return Objects.hash(name, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacEmailContentEventsInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `time` to the URL query string + if (getTime() != null) { + try { + joiner.add(String.format("%stime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsList.java new file mode 100644 index 0000000..543f1ba --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsList.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetTransacEmailsListTransactionalEmailsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacEmailsList + */ +@JsonPropertyOrder({ + GetTransacEmailsList.JSON_PROPERTY_COUNT, + GetTransacEmailsList.JSON_PROPERTY_TRANSACTIONAL_EMAILS +}) +@JsonTypeName("getTransacEmailsList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacEmailsList { + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_TRANSACTIONAL_EMAILS = "transactionalEmails"; + private List transactionalEmails; + + public GetTransacEmailsList() { + } + + public GetTransacEmailsList count(Long count) { + + this.count = count; + return this; + } + + /** + * Total number of transactional emails available on your account according to the passed filter + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + + public GetTransacEmailsList transactionalEmails(List transactionalEmails) { + + this.transactionalEmails = transactionalEmails; + return this; + } + + public GetTransacEmailsList addTransactionalEmailsItem(GetTransacEmailsListTransactionalEmailsInner transactionalEmailsItem) { + if (this.transactionalEmails == null) { + this.transactionalEmails = new ArrayList<>(); + } + this.transactionalEmails.add(transactionalEmailsItem); + return this; + } + + /** + * Get transactionalEmails + * @return transactionalEmails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTransactionalEmails() { + return transactionalEmails; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionalEmails(List transactionalEmails) { + this.transactionalEmails = transactionalEmails; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacEmailsList getTransacEmailsList = (GetTransacEmailsList) o; + return Objects.equals(this.count, getTransacEmailsList.count) && + Objects.equals(this.transactionalEmails, getTransacEmailsList.transactionalEmails); + } + + @Override + public int hashCode() { + return Objects.hash(count, transactionalEmails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacEmailsList {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" transactionalEmails: ").append(toIndentedString(transactionalEmails)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `transactionalEmails` to the URL query string + if (getTransactionalEmails() != null) { + for (int i = 0; i < getTransactionalEmails().size(); i++) { + if (getTransactionalEmails().get(i) != null) { + joiner.add(getTransactionalEmails().get(i).toUrlQueryString(String.format("%stransactionalEmails%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsListTransactionalEmailsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsListTransactionalEmailsInner.java new file mode 100644 index 0000000..819f61f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacEmailsListTransactionalEmailsInner.java @@ -0,0 +1,461 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacEmailsListTransactionalEmailsInner + */ +@JsonPropertyOrder({ + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_EMAIL, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_SUBJECT, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_TEMPLATE_ID, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_MESSAGE_ID, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_UUID, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_DATE, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_FROM, + GetTransacEmailsListTransactionalEmailsInner.JSON_PROPERTY_TAGS +}) +@JsonTypeName("getTransacEmailsList_transactionalEmails_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacEmailsListTransactionalEmailsInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags; + + public GetTransacEmailsListTransactionalEmailsInner() { + } + + public GetTransacEmailsListTransactionalEmailsInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address to which transactional email has been sent + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetTransacEmailsListTransactionalEmailsInner subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the sent email + * @return subject + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetTransacEmailsListTransactionalEmailsInner templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the template + * @return templateId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + + public GetTransacEmailsListTransactionalEmailsInner messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message Id of the sent email + * @return messageId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetTransacEmailsListTransactionalEmailsInner uuid(String uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Unique id of the email sent to a particular contact + * @return uuid + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUuid(String uuid) { + this.uuid = uuid; + } + + + public GetTransacEmailsListTransactionalEmailsInner date(String date) { + + this.date = date; + return this; + } + + /** + * Date on which transactional email was sent + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(String date) { + this.date = date; + } + + + public GetTransacEmailsListTransactionalEmailsInner from(String from) { + + this.from = from; + return this; + } + + /** + * Email address of the sender from which the email was sent + * @return from + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFrom() { + return from; + } + + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + + public GetTransacEmailsListTransactionalEmailsInner tags(List tags) { + + this.tags = tags; + return this; + } + + public GetTransacEmailsListTransactionalEmailsInner addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags used for your email + * @return tags + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacEmailsListTransactionalEmailsInner getTransacEmailsListTransactionalEmailsInner = (GetTransacEmailsListTransactionalEmailsInner) o; + return Objects.equals(this.email, getTransacEmailsListTransactionalEmailsInner.email) && + Objects.equals(this.subject, getTransacEmailsListTransactionalEmailsInner.subject) && + Objects.equals(this.templateId, getTransacEmailsListTransactionalEmailsInner.templateId) && + Objects.equals(this.messageId, getTransacEmailsListTransactionalEmailsInner.messageId) && + Objects.equals(this.uuid, getTransacEmailsListTransactionalEmailsInner.uuid) && + Objects.equals(this.date, getTransacEmailsListTransactionalEmailsInner.date) && + Objects.equals(this.from, getTransacEmailsListTransactionalEmailsInner.from) && + Objects.equals(this.tags, getTransacEmailsListTransactionalEmailsInner.tags); + } + + @Override + public int hashCode() { + return Objects.hash(email, subject, templateId, messageId, uuid, date, from, tags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacEmailsListTransactionalEmailsInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `uuid` to the URL query string + if (getUuid() != null) { + try { + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `from` to the URL query string + if (getFrom() != null) { + try { + joiner.add(String.format("%sfrom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFrom()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + try { + joiner.add(String.format("%stags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getTags().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReport.java new file mode 100644 index 0000000..6739388 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReport.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetTransacSmsReportReportsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacSmsReport + */ +@JsonPropertyOrder({ + GetTransacSmsReport.JSON_PROPERTY_REPORTS +}) +@JsonTypeName("getTransacSmsReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacSmsReport { + public static final String JSON_PROPERTY_REPORTS = "reports"; + private List reports; + + public GetTransacSmsReport() { + } + + public GetTransacSmsReport reports(List reports) { + + this.reports = reports; + return this; + } + + public GetTransacSmsReport addReportsItem(GetTransacSmsReportReportsInner reportsItem) { + if (this.reports == null) { + this.reports = new ArrayList<>(); + } + this.reports.add(reportsItem); + return this; + } + + /** + * Get reports + * @return reports + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getReports() { + return reports; + } + + + @JsonProperty(JSON_PROPERTY_REPORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReports(List reports) { + this.reports = reports; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacSmsReport getTransacSmsReport = (GetTransacSmsReport) o; + return Objects.equals(this.reports, getTransacSmsReport.reports); + } + + @Override + public int hashCode() { + return Objects.hash(reports); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacSmsReport {\n"); + sb.append(" reports: ").append(toIndentedString(reports)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `reports` to the URL query string + if (getReports() != null) { + for (int i = 0; i < getReports().size(); i++) { + if (getReports().get(i) != null) { + joiner.add(getReports().get(i).toUrlQueryString(String.format("%sreports%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReportReportsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReportReportsInner.java new file mode 100644 index 0000000..1caa359 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetTransacSmsReportReportsInner.java @@ -0,0 +1,531 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetTransacSmsReportReportsInner + */ +@JsonPropertyOrder({ + GetTransacSmsReportReportsInner.JSON_PROPERTY_DATE, + GetTransacSmsReportReportsInner.JSON_PROPERTY_REQUESTS, + GetTransacSmsReportReportsInner.JSON_PROPERTY_DELIVERED, + GetTransacSmsReportReportsInner.JSON_PROPERTY_HARD_BOUNCES, + GetTransacSmsReportReportsInner.JSON_PROPERTY_SOFT_BOUNCES, + GetTransacSmsReportReportsInner.JSON_PROPERTY_BLOCKED, + GetTransacSmsReportReportsInner.JSON_PROPERTY_UNSUBSCRIBED, + GetTransacSmsReportReportsInner.JSON_PROPERTY_REPLIED, + GetTransacSmsReportReportsInner.JSON_PROPERTY_ACCEPTED, + GetTransacSmsReportReportsInner.JSON_PROPERTY_REJECTED +}) +@JsonTypeName("getTransacSmsReport_reports_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransacSmsReportReportsInner { + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private Long requests; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Long delivered; + + public static final String JSON_PROPERTY_HARD_BOUNCES = "hardBounces"; + private Long hardBounces; + + public static final String JSON_PROPERTY_SOFT_BOUNCES = "softBounces"; + private Long softBounces; + + public static final String JSON_PROPERTY_BLOCKED = "blocked"; + private Long blocked; + + public static final String JSON_PROPERTY_UNSUBSCRIBED = "unsubscribed"; + private Long unsubscribed; + + public static final String JSON_PROPERTY_REPLIED = "replied"; + private Long replied; + + public static final String JSON_PROPERTY_ACCEPTED = "accepted"; + private Long accepted; + + public static final String JSON_PROPERTY_REJECTED = "rejected"; + private Long rejected; + + public GetTransacSmsReportReportsInner() { + } + + public GetTransacSmsReportReportsInner date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Date for which statistics are retrieved + * @return date + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LocalDate getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(LocalDate date) { + this.date = date; + } + + + public GetTransacSmsReportReportsInner requests(Long requests) { + + this.requests = requests; + return this; + } + + /** + * Number of requests for the date + * @return requests + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRequests() { + return requests; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequests(Long requests) { + this.requests = requests; + } + + + public GetTransacSmsReportReportsInner delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Number of delivered SMS for the date + * @return delivered + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public GetTransacSmsReportReportsInner hardBounces(Long hardBounces) { + + this.hardBounces = hardBounces; + return this; + } + + /** + * Number of hardbounces for the date + * @return hardBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getHardBounces() { + return hardBounces; + } + + + @JsonProperty(JSON_PROPERTY_HARD_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHardBounces(Long hardBounces) { + this.hardBounces = hardBounces; + } + + + public GetTransacSmsReportReportsInner softBounces(Long softBounces) { + + this.softBounces = softBounces; + return this; + } + + /** + * Number of softbounces for the date + * @return softBounces + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSoftBounces() { + return softBounces; + } + + + @JsonProperty(JSON_PROPERTY_SOFT_BOUNCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftBounces(Long softBounces) { + this.softBounces = softBounces; + } + + + public GetTransacSmsReportReportsInner blocked(Long blocked) { + + this.blocked = blocked; + return this; + } + + /** + * Number of blocked contact for the date + * @return blocked + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getBlocked() { + return blocked; + } + + + @JsonProperty(JSON_PROPERTY_BLOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlocked(Long blocked) { + this.blocked = blocked; + } + + + public GetTransacSmsReportReportsInner unsubscribed(Long unsubscribed) { + + this.unsubscribed = unsubscribed; + return this; + } + + /** + * Number of unsubscription for the date + * @return unsubscribed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUnsubscribed() { + return unsubscribed; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscribed(Long unsubscribed) { + this.unsubscribed = unsubscribed; + } + + + public GetTransacSmsReportReportsInner replied(Long replied) { + + this.replied = replied; + return this; + } + + /** + * Number of answered SMS for the date + * @return replied + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getReplied() { + return replied; + } + + + @JsonProperty(JSON_PROPERTY_REPLIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplied(Long replied) { + this.replied = replied; + } + + + public GetTransacSmsReportReportsInner accepted(Long accepted) { + + this.accepted = accepted; + return this; + } + + /** + * Number of accepted for the date + * @return accepted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCEPTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getAccepted() { + return accepted; + } + + + @JsonProperty(JSON_PROPERTY_ACCEPTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccepted(Long accepted) { + this.accepted = accepted; + } + + + public GetTransacSmsReportReportsInner rejected(Long rejected) { + + this.rejected = rejected; + return this; + } + + /** + * Number of rejected for the date + * @return rejected + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REJECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRejected() { + return rejected; + } + + + @JsonProperty(JSON_PROPERTY_REJECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRejected(Long rejected) { + this.rejected = rejected; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransacSmsReportReportsInner getTransacSmsReportReportsInner = (GetTransacSmsReportReportsInner) o; + return Objects.equals(this.date, getTransacSmsReportReportsInner.date) && + Objects.equals(this.requests, getTransacSmsReportReportsInner.requests) && + Objects.equals(this.delivered, getTransacSmsReportReportsInner.delivered) && + Objects.equals(this.hardBounces, getTransacSmsReportReportsInner.hardBounces) && + Objects.equals(this.softBounces, getTransacSmsReportReportsInner.softBounces) && + Objects.equals(this.blocked, getTransacSmsReportReportsInner.blocked) && + Objects.equals(this.unsubscribed, getTransacSmsReportReportsInner.unsubscribed) && + Objects.equals(this.replied, getTransacSmsReportReportsInner.replied) && + Objects.equals(this.accepted, getTransacSmsReportReportsInner.accepted) && + Objects.equals(this.rejected, getTransacSmsReportReportsInner.rejected); + } + + @Override + public int hashCode() { + return Objects.hash(date, requests, delivered, hardBounces, softBounces, blocked, unsubscribed, replied, accepted, rejected); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransacSmsReportReportsInner {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" hardBounces: ").append(toIndentedString(hardBounces)).append("\n"); + sb.append(" softBounces: ").append(toIndentedString(softBounces)).append("\n"); + sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); + sb.append(" unsubscribed: ").append(toIndentedString(unsubscribed)).append("\n"); + sb.append(" replied: ").append(toIndentedString(replied)).append("\n"); + sb.append(" accepted: ").append(toIndentedString(accepted)).append("\n"); + sb.append(" rejected: ").append(toIndentedString(rejected)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `requests` to the URL query string + if (getRequests() != null) { + try { + joiner.add(String.format("%srequests%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRequests()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hardBounces` to the URL query string + if (getHardBounces() != null) { + try { + joiner.add(String.format("%shardBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `softBounces` to the URL query string + if (getSoftBounces() != null) { + try { + joiner.add(String.format("%ssoftBounces%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSoftBounces()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `blocked` to the URL query string + if (getBlocked() != null) { + try { + joiner.add(String.format("%sblocked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBlocked()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribed` to the URL query string + if (getUnsubscribed() != null) { + try { + joiner.add(String.format("%sunsubscribed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replied` to the URL query string + if (getReplied() != null) { + try { + joiner.add(String.format("%sreplied%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplied()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `accepted` to the URL query string + if (getAccepted() != null) { + try { + joiner.add(String.format("%saccepted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAccepted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `rejected` to the URL query string + if (getRejected() != null) { + try { + joiner.add(String.format("%srejected%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRejected()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermission.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermission.java new file mode 100644 index 0000000..bf6d8a9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermission.java @@ -0,0 +1,248 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetUserPermissionPrivilegesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Check user permission + */ +@JsonPropertyOrder({ + GetUserPermission.JSON_PROPERTY_EMAIL, + GetUserPermission.JSON_PROPERTY_STATUS, + GetUserPermission.JSON_PROPERTY_PRIVILEGES +}) +@JsonTypeName("getUserPermission") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetUserPermission { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_PRIVILEGES = "privileges"; + private List privileges = new ArrayList<>(); + + public GetUserPermission() { + } + + public GetUserPermission email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public GetUserPermission status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the invited user. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public GetUserPermission privileges(List privileges) { + + this.privileges = privileges; + return this; + } + + public GetUserPermission addPrivilegesItem(GetUserPermissionPrivilegesInner privilegesItem) { + if (this.privileges == null) { + this.privileges = new ArrayList<>(); + } + this.privileges.add(privilegesItem); + return this; + } + + /** + * Granular feature permissions given to the user. + * @return privileges + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPrivileges() { + return privileges; + } + + + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrivileges(List privileges) { + this.privileges = privileges; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserPermission getUserPermission = (GetUserPermission) o; + return Objects.equals(this.email, getUserPermission.email) && + Objects.equals(this.status, getUserPermission.status) && + Objects.equals(this.privileges, getUserPermission.privileges); + } + + @Override + public int hashCode() { + return Objects.hash(email, status, privileges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUserPermission {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" privileges: ").append(toIndentedString(privileges)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `privileges` to the URL query string + if (getPrivileges() != null) { + for (int i = 0; i < getPrivileges().size(); i++) { + if (getPrivileges().get(i) != null) { + joiner.add(getPrivileges().get(i).toUrlQueryString(String.format("%sprivileges%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermissionPrivilegesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermissionPrivilegesInner.java new file mode 100644 index 0000000..5000279 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetUserPermissionPrivilegesInner.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetUserPermissionPrivilegesInner + */ +@JsonPropertyOrder({ + GetUserPermissionPrivilegesInner.JSON_PROPERTY_FEATURE, + GetUserPermissionPrivilegesInner.JSON_PROPERTY_PERMISSIONS +}) +@JsonTypeName("getUserPermission_privileges_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetUserPermissionPrivilegesInner { + public static final String JSON_PROPERTY_FEATURE = "feature"; + private String feature; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions = new ArrayList<>(); + + public GetUserPermissionPrivilegesInner() { + } + + public GetUserPermissionPrivilegesInner feature(String feature) { + + this.feature = feature; + return this; + } + + /** + * Get feature + * @return feature + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFeature() { + return feature; + } + + + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFeature(String feature) { + this.feature = feature; + } + + + public GetUserPermissionPrivilegesInner permissions(List permissions) { + + this.permissions = permissions; + return this; + } + + public GetUserPermissionPrivilegesInner addPermissionsItem(String permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserPermissionPrivilegesInner getUserPermissionPrivilegesInner = (GetUserPermissionPrivilegesInner) o; + return Objects.equals(this.feature, getUserPermissionPrivilegesInner.feature) && + Objects.equals(this.permissions, getUserPermissionPrivilegesInner.permissions); + } + + @Override + public int hashCode() { + return Objects.hash(feature, permissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUserPermissionPrivilegesInner {\n"); + sb.append(" feature: ").append(toIndentedString(feature)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `feature` to the URL query string + if (getFeature() != null) { + try { + joiner.add(String.format("%sfeature%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFeature()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `permissions` to the URL query string + if (getPermissions() != null) { + for (int i = 0; i < getPermissions().size(); i++) { + try { + joiner.add(String.format("%spermissions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getPermissions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhook.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhook.java new file mode 100644 index 0000000..c1a6561 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhook.java @@ -0,0 +1,592 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWebhook + */ +@JsonPropertyOrder({ + GetWebhook.JSON_PROPERTY_URL, + GetWebhook.JSON_PROPERTY_ID, + GetWebhook.JSON_PROPERTY_DESCRIPTION, + GetWebhook.JSON_PROPERTY_EVENTS, + GetWebhook.JSON_PROPERTY_TYPE, + GetWebhook.JSON_PROPERTY_CREATED_AT, + GetWebhook.JSON_PROPERTY_MODIFIED_AT, + GetWebhook.JSON_PROPERTY_BATCHED, + GetWebhook.JSON_PROPERTY_AUTH, + GetWebhook.JSON_PROPERTY_HEADERS +}) +@JsonTypeName("getWebhook") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWebhook { + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events = new ArrayList<>(); + + /** + * Type of webhook (marketing or transactional) + */ + public enum TypeEnum { + MARKETING("marketing"), + + TRANSACTIONAL("transactional"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public static final String JSON_PROPERTY_BATCHED = "batched"; + private Boolean batched; + + public static final String JSON_PROPERTY_AUTH = "auth"; + private Object auth; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers; + + public GetWebhook() { + } + + public GetWebhook url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the webhook + * @return url + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(String url) { + this.url = url; + } + + + public GetWebhook id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the webhook + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetWebhook description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the webhook + * @return description + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDescription(String description) { + this.description = description; + } + + + public GetWebhook events(List events) { + + this.events = events; + return this; + } + + public GetWebhook addEventsItem(String eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvents(List events) { + this.events = events; + } + + + public GetWebhook type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of webhook (marketing or transactional) + * @return type + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public GetWebhook createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetWebhook modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + + public GetWebhook batched(Boolean batched) { + + this.batched = batched; + return this; + } + + /** + * Batching configuration of the webhook, we send batched webhooks if its true + * @return batched + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getBatched() { + return batched; + } + + + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatched(Boolean batched) { + this.batched = batched; + } + + + public GetWebhook auth(Object auth) { + + this.auth = auth; + return this; + } + + /** + * Authentication header to be send with the webhook requests + * @return auth + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAuth() { + return auth; + } + + + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(Object auth) { + this.auth = auth; + } + + + public GetWebhook headers(List headers) { + + this.headers = headers; + return this; + } + + public GetWebhook addHeadersItem(Object headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Get headers + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWebhook getWebhook = (GetWebhook) o; + return Objects.equals(this.url, getWebhook.url) && + Objects.equals(this.id, getWebhook.id) && + Objects.equals(this.description, getWebhook.description) && + Objects.equals(this.events, getWebhook.events) && + Objects.equals(this.type, getWebhook.type) && + Objects.equals(this.createdAt, getWebhook.createdAt) && + Objects.equals(this.modifiedAt, getWebhook.modifiedAt) && + Objects.equals(this.batched, getWebhook.batched) && + Objects.equals(this.auth, getWebhook.auth) && + Objects.equals(this.headers, getWebhook.headers); + } + + @Override + public int hashCode() { + return Objects.hash(url, id, description, events, type, createdAt, modifiedAt, batched, auth, headers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWebhook {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" batched: ").append(toIndentedString(batched)).append("\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + try { + joiner.add(String.format("%sevents%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEvents().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batched` to the URL query string + if (getBatched() != null) { + try { + joiner.add(String.format("%sbatched%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatched()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `auth` to the URL query string + if (getAuth() != null) { + try { + joiner.add(String.format("%sauth%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuth()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + try { + joiner.add(String.format("%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getHeaders().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhooks.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhooks.java new file mode 100644 index 0000000..fd69f72 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWebhooks.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetWebhook; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWebhooks + */ +@JsonPropertyOrder({ + GetWebhooks.JSON_PROPERTY_WEBHOOKS +}) +@JsonTypeName("getWebhooks") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWebhooks { + public static final String JSON_PROPERTY_WEBHOOKS = "webhooks"; + private List webhooks = new ArrayList<>(); + + public GetWebhooks() { + } + + public GetWebhooks webhooks(List webhooks) { + + this.webhooks = webhooks; + return this; + } + + public GetWebhooks addWebhooksItem(GetWebhook webhooksItem) { + if (this.webhooks == null) { + this.webhooks = new ArrayList<>(); + } + this.webhooks.add(webhooksItem); + return this; + } + + /** + * Get webhooks + * @return webhooks + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getWebhooks() { + return webhooks; + } + + + @JsonProperty(JSON_PROPERTY_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWebhooks(List webhooks) { + this.webhooks = webhooks; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWebhooks getWebhooks = (GetWebhooks) o; + return Objects.equals(this.webhooks, getWebhooks.webhooks); + } + + @Override + public int hashCode() { + return Objects.hash(webhooks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWebhooks {\n"); + sb.append(" webhooks: ").append(toIndentedString(webhooks)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `webhooks` to the URL query string + if (getWebhooks() != null) { + for (int i = 0; i < getWebhooks().size(); i++) { + if (getWebhooks().get(i) != null) { + joiner.add(getWebhooks().get(i).toUrlQueryString(String.format("%swebhooks%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsAppConfig.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsAppConfig.java new file mode 100644 index 0000000..e9de40a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsAppConfig.java @@ -0,0 +1,473 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsAppConfig + */ +@JsonPropertyOrder({ + GetWhatsAppConfig.JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_ID, + GetWhatsAppConfig.JSON_PROPERTY_SENDING_LIMIT, + GetWhatsAppConfig.JSON_PROPERTY_PHONE_NUMBER_QUALITY, + GetWhatsAppConfig.JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_STATUS, + GetWhatsAppConfig.JSON_PROPERTY_BUSINESS_STATUS, + GetWhatsAppConfig.JSON_PROPERTY_PHONE_NUMBER_NAME_STATUS +}) +@JsonTypeName("getWhatsAppConfig") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsAppConfig { + public static final String JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_ID = "whatsappBusinessAccountId"; + private String whatsappBusinessAccountId; + + public static final String JSON_PROPERTY_SENDING_LIMIT = "sendingLimit"; + private String sendingLimit; + + /** + * Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** + */ + public enum PhoneNumberQualityEnum { + GREEN("GREEN"), + + YELLOW("YELLOW"), + + RED("RED"); + + private String value; + + PhoneNumberQualityEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PhoneNumberQualityEnum fromValue(String value) { + for (PhoneNumberQualityEnum b : PhoneNumberQualityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PHONE_NUMBER_QUALITY = "phoneNumberQuality"; + private PhoneNumberQualityEnum phoneNumberQuality; + + /** + * Status information related to WhatsApp API account + */ + public enum WhatsappBusinessAccountStatusEnum { + APPROVED("APPROVED"), + + PENDING("PENDING"), + + REJECTED("REJECTED"); + + private String value; + + WhatsappBusinessAccountStatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WhatsappBusinessAccountStatusEnum fromValue(String value) { + for (WhatsappBusinessAccountStatusEnum b : WhatsappBusinessAccountStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_STATUS = "whatsappBusinessAccountStatus"; + private WhatsappBusinessAccountStatusEnum whatsappBusinessAccountStatus; + + public static final String JSON_PROPERTY_BUSINESS_STATUS = "businessStatus"; + private String businessStatus; + + /** + * Status of the name associated with WhatsApp Phone number + */ + public enum PhoneNumberNameStatusEnum { + APPROVED("APPROVED"), + + PENDING("PENDING"), + + REJECTED("REJECTED"); + + private String value; + + PhoneNumberNameStatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PhoneNumberNameStatusEnum fromValue(String value) { + for (PhoneNumberNameStatusEnum b : PhoneNumberNameStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PHONE_NUMBER_NAME_STATUS = "phoneNumberNameStatus"; + private PhoneNumberNameStatusEnum phoneNumberNameStatus; + + public GetWhatsAppConfig() { + } + + public GetWhatsAppConfig whatsappBusinessAccountId(String whatsappBusinessAccountId) { + + this.whatsappBusinessAccountId = whatsappBusinessAccountId; + return this; + } + + /** + * Id of the WhatsApp business account + * @return whatsappBusinessAccountId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWhatsappBusinessAccountId() { + return whatsappBusinessAccountId; + } + + + @JsonProperty(JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhatsappBusinessAccountId(String whatsappBusinessAccountId) { + this.whatsappBusinessAccountId = whatsappBusinessAccountId; + } + + + public GetWhatsAppConfig sendingLimit(String sendingLimit) { + + this.sendingLimit = sendingLimit; + return this; + } + + /** + * Sending limit Information of the WhatsApp API account + * @return sendingLimit + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDING_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSendingLimit() { + return sendingLimit; + } + + + @JsonProperty(JSON_PROPERTY_SENDING_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendingLimit(String sendingLimit) { + this.sendingLimit = sendingLimit; + } + + + public GetWhatsAppConfig phoneNumberQuality(PhoneNumberQualityEnum phoneNumberQuality) { + + this.phoneNumberQuality = phoneNumberQuality; + return this; + } + + /** + * Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** + * @return phoneNumberQuality + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER_QUALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PhoneNumberQualityEnum getPhoneNumberQuality() { + return phoneNumberQuality; + } + + + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER_QUALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhoneNumberQuality(PhoneNumberQualityEnum phoneNumberQuality) { + this.phoneNumberQuality = phoneNumberQuality; + } + + + public GetWhatsAppConfig whatsappBusinessAccountStatus(WhatsappBusinessAccountStatusEnum whatsappBusinessAccountStatus) { + + this.whatsappBusinessAccountStatus = whatsappBusinessAccountStatus; + return this; + } + + /** + * Status information related to WhatsApp API account + * @return whatsappBusinessAccountStatus + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WhatsappBusinessAccountStatusEnum getWhatsappBusinessAccountStatus() { + return whatsappBusinessAccountStatus; + } + + + @JsonProperty(JSON_PROPERTY_WHATSAPP_BUSINESS_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhatsappBusinessAccountStatus(WhatsappBusinessAccountStatusEnum whatsappBusinessAccountStatus) { + this.whatsappBusinessAccountStatus = whatsappBusinessAccountStatus; + } + + + public GetWhatsAppConfig businessStatus(String businessStatus) { + + this.businessStatus = businessStatus; + return this; + } + + /** + * Verification status information of the Business account + * @return businessStatus + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUSINESS_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBusinessStatus() { + return businessStatus; + } + + + @JsonProperty(JSON_PROPERTY_BUSINESS_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBusinessStatus(String businessStatus) { + this.businessStatus = businessStatus; + } + + + public GetWhatsAppConfig phoneNumberNameStatus(PhoneNumberNameStatusEnum phoneNumberNameStatus) { + + this.phoneNumberNameStatus = phoneNumberNameStatus; + return this; + } + + /** + * Status of the name associated with WhatsApp Phone number + * @return phoneNumberNameStatus + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER_NAME_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PhoneNumberNameStatusEnum getPhoneNumberNameStatus() { + return phoneNumberNameStatus; + } + + + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER_NAME_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhoneNumberNameStatus(PhoneNumberNameStatusEnum phoneNumberNameStatus) { + this.phoneNumberNameStatus = phoneNumberNameStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsAppConfig getWhatsAppConfig = (GetWhatsAppConfig) o; + return Objects.equals(this.whatsappBusinessAccountId, getWhatsAppConfig.whatsappBusinessAccountId) && + Objects.equals(this.sendingLimit, getWhatsAppConfig.sendingLimit) && + Objects.equals(this.phoneNumberQuality, getWhatsAppConfig.phoneNumberQuality) && + Objects.equals(this.whatsappBusinessAccountStatus, getWhatsAppConfig.whatsappBusinessAccountStatus) && + Objects.equals(this.businessStatus, getWhatsAppConfig.businessStatus) && + Objects.equals(this.phoneNumberNameStatus, getWhatsAppConfig.phoneNumberNameStatus); + } + + @Override + public int hashCode() { + return Objects.hash(whatsappBusinessAccountId, sendingLimit, phoneNumberQuality, whatsappBusinessAccountStatus, businessStatus, phoneNumberNameStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsAppConfig {\n"); + sb.append(" whatsappBusinessAccountId: ").append(toIndentedString(whatsappBusinessAccountId)).append("\n"); + sb.append(" sendingLimit: ").append(toIndentedString(sendingLimit)).append("\n"); + sb.append(" phoneNumberQuality: ").append(toIndentedString(phoneNumberQuality)).append("\n"); + sb.append(" whatsappBusinessAccountStatus: ").append(toIndentedString(whatsappBusinessAccountStatus)).append("\n"); + sb.append(" businessStatus: ").append(toIndentedString(businessStatus)).append("\n"); + sb.append(" phoneNumberNameStatus: ").append(toIndentedString(phoneNumberNameStatus)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `whatsappBusinessAccountId` to the URL query string + if (getWhatsappBusinessAccountId() != null) { + try { + joiner.add(String.format("%swhatsappBusinessAccountId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWhatsappBusinessAccountId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sendingLimit` to the URL query string + if (getSendingLimit() != null) { + try { + joiner.add(String.format("%ssendingLimit%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendingLimit()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `phoneNumberQuality` to the URL query string + if (getPhoneNumberQuality() != null) { + try { + joiner.add(String.format("%sphoneNumberQuality%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhoneNumberQuality()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `whatsappBusinessAccountStatus` to the URL query string + if (getWhatsappBusinessAccountStatus() != null) { + try { + joiner.add(String.format("%swhatsappBusinessAccountStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWhatsappBusinessAccountStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `businessStatus` to the URL query string + if (getBusinessStatus() != null) { + try { + joiner.add(String.format("%sbusinessStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBusinessStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `phoneNumberNameStatus` to the URL query string + if (getPhoneNumberNameStatus() != null) { + try { + joiner.add(String.format("%sphoneNumberNameStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhoneNumberNameStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignOverview.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignOverview.java new file mode 100644 index 0000000..6514dee --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignOverview.java @@ -0,0 +1,527 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.WhatsappCampStats; +import software.xdev.brevo.model.WhatsappCampTemplate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappCampaignOverview + */ +@JsonPropertyOrder({ + GetWhatsappCampaignOverview.JSON_PROPERTY_ID, + GetWhatsappCampaignOverview.JSON_PROPERTY_CAMPAIGN_NAME, + GetWhatsappCampaignOverview.JSON_PROPERTY_CAMPAIGN_STATUS, + GetWhatsappCampaignOverview.JSON_PROPERTY_SCHEDULED_AT, + GetWhatsappCampaignOverview.JSON_PROPERTY_SENDER_NUMBER, + GetWhatsappCampaignOverview.JSON_PROPERTY_STATS, + GetWhatsappCampaignOverview.JSON_PROPERTY_TEMPLATE, + GetWhatsappCampaignOverview.JSON_PROPERTY_CREATED_AT, + GetWhatsappCampaignOverview.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getWhatsappCampaignOverview") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappCampaignOverview { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CAMPAIGN_NAME = "campaignName"; + private String campaignName; + + /** + * Status of the WhatsApp Campaign + */ + public enum CampaignStatusEnum { + DRAFT("draft"), + + SCHEDULED("scheduled"), + + PENDING("pending"), + + APPROVED("approved"), + + RUNNING("running"), + + SUSPENDED("suspended"), + + REJECTED("rejected"), + + SENT("sent"); + + private String value; + + CampaignStatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CampaignStatusEnum fromValue(String value) { + for (CampaignStatusEnum b : CampaignStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CAMPAIGN_STATUS = "campaignStatus"; + private CampaignStatusEnum campaignStatus; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SENDER_NUMBER = "senderNumber"; + private String senderNumber; + + public static final String JSON_PROPERTY_STATS = "stats"; + private WhatsappCampStats stats; + + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private WhatsappCampTemplate template; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public GetWhatsappCampaignOverview() { + } + + public GetWhatsappCampaignOverview id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the WhatsApp Campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetWhatsappCampaignOverview campaignName(String campaignName) { + + this.campaignName = campaignName; + return this; + } + + /** + * Name of the WhatsApp Campaign + * @return campaignName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCampaignName() { + return campaignName; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignName(String campaignName) { + this.campaignName = campaignName; + } + + + public GetWhatsappCampaignOverview campaignStatus(CampaignStatusEnum campaignStatus) { + + this.campaignStatus = campaignStatus; + return this; + } + + /** + * Status of the WhatsApp Campaign + * @return campaignStatus + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CampaignStatusEnum getCampaignStatus() { + return campaignStatus; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignStatus(CampaignStatusEnum campaignStatus) { + this.campaignStatus = campaignStatus; + } + + + public GetWhatsappCampaignOverview scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetWhatsappCampaignOverview senderNumber(String senderNumber) { + + this.senderNumber = senderNumber; + return this; + } + + /** + * Sender of the WhatsApp Campaign + * @return senderNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderNumber() { + return senderNumber; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderNumber(String senderNumber) { + this.senderNumber = senderNumber; + } + + + public GetWhatsappCampaignOverview stats(WhatsappCampStats stats) { + + this.stats = stats; + return this; + } + + /** + * Get stats + * @return stats + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WhatsappCampStats getStats() { + return stats; + } + + + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStats(WhatsappCampStats stats) { + this.stats = stats; + } + + + public GetWhatsappCampaignOverview template(WhatsappCampTemplate template) { + + this.template = template; + return this; + } + + /** + * Get template + * @return template + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public WhatsappCampTemplate getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(WhatsappCampTemplate template) { + this.template = template; + } + + + public GetWhatsappCampaignOverview createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetWhatsappCampaignOverview modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappCampaignOverview getWhatsappCampaignOverview = (GetWhatsappCampaignOverview) o; + return Objects.equals(this.id, getWhatsappCampaignOverview.id) && + Objects.equals(this.campaignName, getWhatsappCampaignOverview.campaignName) && + Objects.equals(this.campaignStatus, getWhatsappCampaignOverview.campaignStatus) && + Objects.equals(this.scheduledAt, getWhatsappCampaignOverview.scheduledAt) && + Objects.equals(this.senderNumber, getWhatsappCampaignOverview.senderNumber) && + Objects.equals(this.stats, getWhatsappCampaignOverview.stats) && + Objects.equals(this.template, getWhatsappCampaignOverview.template) && + Objects.equals(this.createdAt, getWhatsappCampaignOverview.createdAt) && + Objects.equals(this.modifiedAt, getWhatsappCampaignOverview.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, campaignName, campaignStatus, scheduledAt, senderNumber, stats, template, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappCampaignOverview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" campaignName: ").append(toIndentedString(campaignName)).append("\n"); + sb.append(" campaignStatus: ").append(toIndentedString(campaignStatus)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" senderNumber: ").append(toIndentedString(senderNumber)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignName` to the URL query string + if (getCampaignName() != null) { + try { + joiner.add(String.format("%scampaignName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignStatus` to the URL query string + if (getCampaignStatus() != null) { + try { + joiner.add(String.format("%scampaignStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `senderNumber` to the URL query string + if (getSenderNumber() != null) { + try { + joiner.add(String.format("%ssenderNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `stats` to the URL query string + if (getStats() != null) { + joiner.add(getStats().toUrlQueryString(prefix + "stats" + suffix)); + } + + // add `template` to the URL query string + if (getTemplate() != null) { + joiner.add(getTemplate().toUrlQueryString(prefix + "template" + suffix)); + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaigns.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaigns.java new file mode 100644 index 0000000..354cf7d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaigns.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetWhatsappCampaignsCampaignsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappCampaigns + */ +@JsonPropertyOrder({ + GetWhatsappCampaigns.JSON_PROPERTY_CAMPAIGNS, + GetWhatsappCampaigns.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getWhatsappCampaigns") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappCampaigns { + public static final String JSON_PROPERTY_CAMPAIGNS = "campaigns"; + private List campaigns; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetWhatsappCampaigns() { + } + + public GetWhatsappCampaigns campaigns(List campaigns) { + + this.campaigns = campaigns; + return this; + } + + public GetWhatsappCampaigns addCampaignsItem(GetWhatsappCampaignsCampaignsInner campaignsItem) { + if (this.campaigns == null) { + this.campaigns = new ArrayList<>(); + } + this.campaigns.add(campaignsItem); + return this; + } + + /** + * Get campaigns + * @return campaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCampaigns() { + return campaigns; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaigns(List campaigns) { + this.campaigns = campaigns; + } + + + public GetWhatsappCampaigns count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of WhatsApp campaigns retrieved + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappCampaigns getWhatsappCampaigns = (GetWhatsappCampaigns) o; + return Objects.equals(this.campaigns, getWhatsappCampaigns.campaigns) && + Objects.equals(this.count, getWhatsappCampaigns.count); + } + + @Override + public int hashCode() { + return Objects.hash(campaigns, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappCampaigns {\n"); + sb.append(" campaigns: ").append(toIndentedString(campaigns)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaigns` to the URL query string + if (getCampaigns() != null) { + for (int i = 0; i < getCampaigns().size(); i++) { + if (getCampaigns().get(i) != null) { + joiner.add(getCampaigns().get(i).toUrlQueryString(String.format("%scampaigns%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignsCampaignsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignsCampaignsInner.java new file mode 100644 index 0000000..12fa9f7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappCampaignsCampaignsInner.java @@ -0,0 +1,615 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.WhatsappCampStats; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappCampaignsCampaignsInner + */ +@JsonPropertyOrder({ + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_ID, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_CAMPAIGN_NAME, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_TEMPLATE_ID, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_CAMPAIGN_STATUS, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_SCHEDULED_AT, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_ERROR_REASON, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_INVALIDATED_CONTACTS, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_READ_PERCENTAGE, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_STATS, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_CREATED_AT, + GetWhatsappCampaignsCampaignsInner.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getWhatsappCampaigns_campaigns_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappCampaignsCampaignsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CAMPAIGN_NAME = "campaignName"; + private String campaignName; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private String templateId; + + /** + * Status of the WhatsApp Campaign + */ + public enum CampaignStatusEnum { + DRAFT("draft"), + + SCHEDULED("scheduled"), + + PENDING("pending"), + + APPROVED("approved"), + + RUNNING("running"), + + SUSPENDED("suspended"), + + REJECTED("rejected"), + + SENT("sent"); + + private String value; + + CampaignStatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CampaignStatusEnum fromValue(String value) { + for (CampaignStatusEnum b : CampaignStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CAMPAIGN_STATUS = "campaignStatus"; + private CampaignStatusEnum campaignStatus; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_ERROR_REASON = "errorReason"; + private String errorReason; + + public static final String JSON_PROPERTY_INVALIDATED_CONTACTS = "invalidatedContacts"; + private Long invalidatedContacts; + + public static final String JSON_PROPERTY_READ_PERCENTAGE = "readPercentage"; + private Float readPercentage; + + public static final String JSON_PROPERTY_STATS = "stats"; + private WhatsappCampStats stats; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public GetWhatsappCampaignsCampaignsInner() { + } + + public GetWhatsappCampaignsCampaignsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the WhatsApp Campaign + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetWhatsappCampaignsCampaignsInner campaignName(String campaignName) { + + this.campaignName = campaignName; + return this; + } + + /** + * Name of the WhatsApp Campaign + * @return campaignName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCampaignName() { + return campaignName; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignName(String campaignName) { + this.campaignName = campaignName; + } + + + public GetWhatsappCampaignsCampaignsInner templateId(String templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the WhatsApp template + * @return templateId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + + public GetWhatsappCampaignsCampaignsInner campaignStatus(CampaignStatusEnum campaignStatus) { + + this.campaignStatus = campaignStatus; + return this; + } + + /** + * Status of the WhatsApp Campaign + * @return campaignStatus + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CampaignStatusEnum getCampaignStatus() { + return campaignStatus; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCampaignStatus(CampaignStatusEnum campaignStatus) { + this.campaignStatus = campaignStatus; + } + + + public GetWhatsappCampaignsCampaignsInner scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * @return scheduledAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public GetWhatsappCampaignsCampaignsInner errorReason(String errorReason) { + + this.errorReason = errorReason; + return this; + } + + /** + * Error Reason associated with the WhatsApp campaign sending + * @return errorReason + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getErrorReason() { + return errorReason; + } + + + @JsonProperty(JSON_PROPERTY_ERROR_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorReason(String errorReason) { + this.errorReason = errorReason; + } + + + public GetWhatsappCampaignsCampaignsInner invalidatedContacts(Long invalidatedContacts) { + + this.invalidatedContacts = invalidatedContacts; + return this; + } + + /** + * Count of invalidated contacts + * @return invalidatedContacts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVALIDATED_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInvalidatedContacts() { + return invalidatedContacts; + } + + + @JsonProperty(JSON_PROPERTY_INVALIDATED_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidatedContacts(Long invalidatedContacts) { + this.invalidatedContacts = invalidatedContacts; + } + + + public GetWhatsappCampaignsCampaignsInner readPercentage(Float readPercentage) { + + this.readPercentage = readPercentage; + return this; + } + + /** + * Read percentage of the the WhatsApp campaign created + * @return readPercentage + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_READ_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getReadPercentage() { + return readPercentage; + } + + + @JsonProperty(JSON_PROPERTY_READ_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReadPercentage(Float readPercentage) { + this.readPercentage = readPercentage; + } + + + public GetWhatsappCampaignsCampaignsInner stats(WhatsappCampStats stats) { + + this.stats = stats; + return this; + } + + /** + * Get stats + * @return stats + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WhatsappCampStats getStats() { + return stats; + } + + + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStats(WhatsappCampStats stats) { + this.stats = stats; + } + + + public GetWhatsappCampaignsCampaignsInner createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetWhatsappCampaignsCampaignsInner modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappCampaignsCampaignsInner getWhatsappCampaignsCampaignsInner = (GetWhatsappCampaignsCampaignsInner) o; + return Objects.equals(this.id, getWhatsappCampaignsCampaignsInner.id) && + Objects.equals(this.campaignName, getWhatsappCampaignsCampaignsInner.campaignName) && + Objects.equals(this.templateId, getWhatsappCampaignsCampaignsInner.templateId) && + Objects.equals(this.campaignStatus, getWhatsappCampaignsCampaignsInner.campaignStatus) && + Objects.equals(this.scheduledAt, getWhatsappCampaignsCampaignsInner.scheduledAt) && + Objects.equals(this.errorReason, getWhatsappCampaignsCampaignsInner.errorReason) && + Objects.equals(this.invalidatedContacts, getWhatsappCampaignsCampaignsInner.invalidatedContacts) && + Objects.equals(this.readPercentage, getWhatsappCampaignsCampaignsInner.readPercentage) && + Objects.equals(this.stats, getWhatsappCampaignsCampaignsInner.stats) && + Objects.equals(this.createdAt, getWhatsappCampaignsCampaignsInner.createdAt) && + Objects.equals(this.modifiedAt, getWhatsappCampaignsCampaignsInner.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, campaignName, templateId, campaignStatus, scheduledAt, errorReason, invalidatedContacts, readPercentage, stats, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappCampaignsCampaignsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" campaignName: ").append(toIndentedString(campaignName)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" campaignStatus: ").append(toIndentedString(campaignStatus)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" errorReason: ").append(toIndentedString(errorReason)).append("\n"); + sb.append(" invalidatedContacts: ").append(toIndentedString(invalidatedContacts)).append("\n"); + sb.append(" readPercentage: ").append(toIndentedString(readPercentage)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignName` to the URL query string + if (getCampaignName() != null) { + try { + joiner.add(String.format("%scampaignName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignStatus` to the URL query string + if (getCampaignStatus() != null) { + try { + joiner.add(String.format("%scampaignStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `errorReason` to the URL query string + if (getErrorReason() != null) { + try { + joiner.add(String.format("%serrorReason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getErrorReason()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `invalidatedContacts` to the URL query string + if (getInvalidatedContacts() != null) { + try { + joiner.add(String.format("%sinvalidatedContacts%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInvalidatedContacts()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `readPercentage` to the URL query string + if (getReadPercentage() != null) { + try { + joiner.add(String.format("%sreadPercentage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReadPercentage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `stats` to the URL query string + if (getStats() != null) { + joiner.add(getStats().toUrlQueryString(prefix + "stats" + suffix)); + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReport.java new file mode 100644 index 0000000..a26bd75 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReport.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetWhatsappEventReportEventsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappEventReport + */ +@JsonPropertyOrder({ + GetWhatsappEventReport.JSON_PROPERTY_EVENTS +}) +@JsonTypeName("getWhatsappEventReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappEventReport { + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events; + + public GetWhatsappEventReport() { + } + + public GetWhatsappEventReport events(List events) { + + this.events = events; + return this; + } + + public GetWhatsappEventReport addEventsItem(GetWhatsappEventReportEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(List events) { + this.events = events; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappEventReport getWhatsappEventReport = (GetWhatsappEventReport) o; + return Objects.equals(this.events, getWhatsappEventReport.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappEventReport {\n"); + sb.append(" events: ").append(toIndentedString(events)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + if (getEvents().get(i) != null) { + joiner.add(getEvents().get(i).toUrlQueryString(String.format("%sevents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReportEventsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReportEventsInner.java new file mode 100644 index 0000000..d78866d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappEventReportEventsInner.java @@ -0,0 +1,491 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappEventReportEventsInner + */ +@JsonPropertyOrder({ + GetWhatsappEventReportEventsInner.JSON_PROPERTY_CONTACT_NUMBER, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_DATE, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_MESSAGE_ID, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_EVENT, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_REASON, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_BODY, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_MEDIA_URL, + GetWhatsappEventReportEventsInner.JSON_PROPERTY_SENDER_NUMBER +}) +@JsonTypeName("getWhatsappEventReport_events_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappEventReportEventsInner { + public static final String JSON_PROPERTY_CONTACT_NUMBER = "contactNumber"; + private String contactNumber; + + public static final String JSON_PROPERTY_DATE = "date"; + private String date; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + /** + * Event which occurred + */ + public enum EventEnum { + SENT("sent"), + + DELIVERED("delivered"), + + READ("read"), + + ERROR("error"), + + UNSUBSCRIBE("unsubscribe"), + + REPLY("reply"), + + SOFT_BOUNCE("soft-bounce"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENT = "event"; + private EventEnum event; + + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + public static final String JSON_PROPERTY_MEDIA_URL = "mediaUrl"; + private String mediaUrl; + + public static final String JSON_PROPERTY_SENDER_NUMBER = "senderNumber"; + private String senderNumber; + + public GetWhatsappEventReportEventsInner() { + } + + public GetWhatsappEventReportEventsInner contactNumber(String contactNumber) { + + this.contactNumber = contactNumber; + return this; + } + + /** + * WhatsApp Number with country code. Example, 85264318721 + * @return contactNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContactNumber() { + return contactNumber; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContactNumber(String contactNumber) { + this.contactNumber = contactNumber; + } + + + public GetWhatsappEventReportEventsInner date(String date) { + + this.date = date; + return this; + } + + /** + * UTC date-time on which the event has been generated + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(String date) { + this.date = date; + } + + + public GetWhatsappEventReportEventsInner messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message ID which generated the event + * @return messageId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetWhatsappEventReportEventsInner event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Event which occurred + * @return event + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventEnum getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(EventEnum event) { + this.event = event; + } + + + public GetWhatsappEventReportEventsInner reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * Reason for the event (will be there in case of `error` and `soft-bounce` events) + * @return reason + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReason() { + return reason; + } + + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(String reason) { + this.reason = reason; + } + + + public GetWhatsappEventReportEventsInner body(String body) { + + this.body = body; + return this; + } + + /** + * Text of the reply (will be there only in case of `reply` event with text) + * @return body + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + } + + + public GetWhatsappEventReportEventsInner mediaUrl(String mediaUrl) { + + this.mediaUrl = mediaUrl; + return this; + } + + /** + * Url of the media reply (will be there only in case of `reply` event with media) + * @return mediaUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEDIA_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMediaUrl() { + return mediaUrl; + } + + + @JsonProperty(JSON_PROPERTY_MEDIA_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaUrl(String mediaUrl) { + this.mediaUrl = mediaUrl; + } + + + public GetWhatsappEventReportEventsInner senderNumber(String senderNumber) { + + this.senderNumber = senderNumber; + return this; + } + + /** + * WhatsApp Number with country code. Example, 85264318721 + * @return senderNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderNumber() { + return senderNumber; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderNumber(String senderNumber) { + this.senderNumber = senderNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappEventReportEventsInner getWhatsappEventReportEventsInner = (GetWhatsappEventReportEventsInner) o; + return Objects.equals(this.contactNumber, getWhatsappEventReportEventsInner.contactNumber) && + Objects.equals(this.date, getWhatsappEventReportEventsInner.date) && + Objects.equals(this.messageId, getWhatsappEventReportEventsInner.messageId) && + Objects.equals(this.event, getWhatsappEventReportEventsInner.event) && + Objects.equals(this.reason, getWhatsappEventReportEventsInner.reason) && + Objects.equals(this.body, getWhatsappEventReportEventsInner.body) && + Objects.equals(this.mediaUrl, getWhatsappEventReportEventsInner.mediaUrl) && + Objects.equals(this.senderNumber, getWhatsappEventReportEventsInner.senderNumber); + } + + @Override + public int hashCode() { + return Objects.hash(contactNumber, date, messageId, event, reason, body, mediaUrl, senderNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappEventReportEventsInner {\n"); + sb.append(" contactNumber: ").append(toIndentedString(contactNumber)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" mediaUrl: ").append(toIndentedString(mediaUrl)).append("\n"); + sb.append(" senderNumber: ").append(toIndentedString(senderNumber)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `contactNumber` to the URL query string + if (getContactNumber() != null) { + try { + joiner.add(String.format("%scontactNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContactNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `date` to the URL query string + if (getDate() != null) { + try { + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `event` to the URL query string + if (getEvent() != null) { + try { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEvent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `reason` to the URL query string + if (getReason() != null) { + try { + joiner.add(String.format("%sreason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReason()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `body` to the URL query string + if (getBody() != null) { + try { + joiner.add(String.format("%sbody%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBody()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mediaUrl` to the URL query string + if (getMediaUrl() != null) { + try { + joiner.add(String.format("%smediaUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMediaUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `senderNumber` to the URL query string + if (getSenderNumber() != null) { + try { + joiner.add(String.format("%ssenderNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplates.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplates.java new file mode 100644 index 0000000..8a94ea5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplates.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetWhatsappTemplatesTemplatesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappTemplates + */ +@JsonPropertyOrder({ + GetWhatsappTemplates.JSON_PROPERTY_TEMPLATES, + GetWhatsappTemplates.JSON_PROPERTY_COUNT +}) +@JsonTypeName("getWhatsappTemplates") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappTemplates { + public static final String JSON_PROPERTY_TEMPLATES = "templates"; + private List templates; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GetWhatsappTemplates() { + } + + public GetWhatsappTemplates templates(List templates) { + + this.templates = templates; + return this; + } + + public GetWhatsappTemplates addTemplatesItem(GetWhatsappTemplatesTemplatesInner templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); + } + this.templates.add(templatesItem); + return this; + } + + /** + * Get templates + * @return templates + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTemplates() { + return templates; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplates(List templates) { + this.templates = templates; + } + + + public GetWhatsappTemplates count(Long count) { + + this.count = count; + return this; + } + + /** + * Number of WhatsApp templates retrieved + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappTemplates getWhatsappTemplates = (GetWhatsappTemplates) o; + return Objects.equals(this.templates, getWhatsappTemplates.templates) && + Objects.equals(this.count, getWhatsappTemplates.count); + } + + @Override + public int hashCode() { + return Objects.hash(templates, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappTemplates {\n"); + sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `templates` to the URL query string + if (getTemplates() != null) { + for (int i = 0; i < getTemplates().size(); i++) { + if (getTemplates().get(i) != null) { + joiner.add(getTemplates().get(i).toUrlQueryString(String.format("%stemplates%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplatesTemplatesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplatesTemplatesInner.java new file mode 100644 index 0000000..2a35aca --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/GetWhatsappTemplatesTemplatesInner.java @@ -0,0 +1,446 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * GetWhatsappTemplatesTemplatesInner + */ +@JsonPropertyOrder({ + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_ID, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_NAME, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_STATUS, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_LANGUAGE, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_CATEGORY, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_ERROR_REASON, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_CREATED_AT, + GetWhatsappTemplatesTemplatesInner.JSON_PROPERTY_MODIFIED_AT +}) +@JsonTypeName("getWhatsappTemplates_templates_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetWhatsappTemplatesTemplatesInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private String language; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_ERROR_REASON = "errorReason"; + private String errorReason; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modifiedAt"; + private String modifiedAt; + + public GetWhatsappTemplatesTemplatesInner() { + } + + public GetWhatsappTemplatesTemplatesInner id(Long id) { + + this.id = id; + return this; + } + + /** + * ID of the WhatsApp template + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public GetWhatsappTemplatesTemplatesInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the WhatsApp template + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public GetWhatsappTemplatesTemplatesInner status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the WhatsApp template + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public GetWhatsappTemplatesTemplatesInner language(String language) { + + this.language = language; + return this; + } + + /** + * Language in which template exists + * @return language + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLanguage(String language) { + this.language = language; + } + + + public GetWhatsappTemplatesTemplatesInner category(String category) { + + this.category = category; + return this; + } + + /** + * category of the template + * @return category + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategory(String category) { + this.category = category; + } + + + public GetWhatsappTemplatesTemplatesInner errorReason(String errorReason) { + + this.errorReason = errorReason; + return this; + } + + /** + * Error reason in the template creation + * @return errorReason + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getErrorReason() { + return errorReason; + } + + + @JsonProperty(JSON_PROPERTY_ERROR_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorReason(String errorReason) { + this.errorReason = errorReason; + } + + + public GetWhatsappTemplatesTemplatesInner createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GetWhatsappTemplatesTemplatesInner modifiedAt(String modifiedAt) { + + this.modifiedAt = modifiedAt; + return this; + } + + /** + * UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * @return modifiedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModifiedAt() { + return modifiedAt; + } + + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWhatsappTemplatesTemplatesInner getWhatsappTemplatesTemplatesInner = (GetWhatsappTemplatesTemplatesInner) o; + return Objects.equals(this.id, getWhatsappTemplatesTemplatesInner.id) && + Objects.equals(this.name, getWhatsappTemplatesTemplatesInner.name) && + Objects.equals(this.status, getWhatsappTemplatesTemplatesInner.status) && + Objects.equals(this.language, getWhatsappTemplatesTemplatesInner.language) && + Objects.equals(this.category, getWhatsappTemplatesTemplatesInner.category) && + Objects.equals(this.errorReason, getWhatsappTemplatesTemplatesInner.errorReason) && + Objects.equals(this.createdAt, getWhatsappTemplatesTemplatesInner.createdAt) && + Objects.equals(this.modifiedAt, getWhatsappTemplatesTemplatesInner.modifiedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, language, category, errorReason, createdAt, modifiedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWhatsappTemplatesTemplatesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" errorReason: ").append(toIndentedString(errorReason)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `category` to the URL query string + if (getCategory() != null) { + try { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCategory()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `errorReason` to the URL query string + if (getErrorReason() != null) { + try { + joiner.add(String.format("%serrorReason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getErrorReason()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `modifiedAt` to the URL query string + if (getModifiedAt() != null) { + try { + joiner.add(String.format("%smodifiedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getModifiedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUser.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUser.java new file mode 100644 index 0000000..277018f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUser.java @@ -0,0 +1,302 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.InviteAdminUserPrivilegesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * InviteAdminUser + */ +@JsonPropertyOrder({ + InviteAdminUser.JSON_PROPERTY_EMAIL, + InviteAdminUser.JSON_PROPERTY_ALL_FEATURES_ACCESS, + InviteAdminUser.JSON_PROPERTY_GROUP_IDS, + InviteAdminUser.JSON_PROPERTY_PRIVILEGES +}) +@JsonTypeName("inviteAdminUser") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InviteAdminUser { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ALL_FEATURES_ACCESS = "all_features_access"; + private Boolean allFeaturesAccess; + + public static final String JSON_PROPERTY_GROUP_IDS = "groupIds"; + private List groupIds; + + public static final String JSON_PROPERTY_PRIVILEGES = "privileges"; + private List privileges = new ArrayList<>(); + + public InviteAdminUser() { + } + + public InviteAdminUser email(String email) { + + this.email = email; + return this; + } + + /** + * Email address for the organization + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public InviteAdminUser allFeaturesAccess(Boolean allFeaturesAccess) { + + this.allFeaturesAccess = allFeaturesAccess; + return this; + } + + /** + * All access to the features + * @return allFeaturesAccess + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ALL_FEATURES_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getAllFeaturesAccess() { + return allFeaturesAccess; + } + + + @JsonProperty(JSON_PROPERTY_ALL_FEATURES_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAllFeaturesAccess(Boolean allFeaturesAccess) { + this.allFeaturesAccess = allFeaturesAccess; + } + + + public InviteAdminUser groupIds(List groupIds) { + + this.groupIds = groupIds; + return this; + } + + public InviteAdminUser addGroupIdsItem(String groupIdsItem) { + if (this.groupIds == null) { + this.groupIds = new ArrayList<>(); + } + this.groupIds.add(groupIdsItem); + return this; + } + + /** + * Ids of Group + * @return groupIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroupIds() { + return groupIds; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupIds(List groupIds) { + this.groupIds = groupIds; + } + + + public InviteAdminUser privileges(List privileges) { + + this.privileges = privileges; + return this; + } + + public InviteAdminUser addPrivilegesItem(InviteAdminUserPrivilegesInner privilegesItem) { + if (this.privileges == null) { + this.privileges = new ArrayList<>(); + } + this.privileges.add(privilegesItem); + return this; + } + + /** + * Get privileges + * @return privileges + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPrivileges() { + return privileges; + } + + + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrivileges(List privileges) { + this.privileges = privileges; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteAdminUser inviteAdminUser = (InviteAdminUser) o; + return Objects.equals(this.email, inviteAdminUser.email) && + Objects.equals(this.allFeaturesAccess, inviteAdminUser.allFeaturesAccess) && + Objects.equals(this.groupIds, inviteAdminUser.groupIds) && + Objects.equals(this.privileges, inviteAdminUser.privileges); + } + + @Override + public int hashCode() { + return Objects.hash(email, allFeaturesAccess, groupIds, privileges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteAdminUser {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" allFeaturesAccess: ").append(toIndentedString(allFeaturesAccess)).append("\n"); + sb.append(" groupIds: ").append(toIndentedString(groupIds)).append("\n"); + sb.append(" privileges: ").append(toIndentedString(privileges)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `all_features_access` to the URL query string + if (getAllFeaturesAccess() != null) { + try { + joiner.add(String.format("%sall_features_access%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAllFeaturesAccess()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `groupIds` to the URL query string + if (getGroupIds() != null) { + for (int i = 0; i < getGroupIds().size(); i++) { + try { + joiner.add(String.format("%sgroupIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getGroupIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `privileges` to the URL query string + if (getPrivileges() != null) { + for (int i = 0; i < getPrivileges().size(); i++) { + if (getPrivileges().get(i) != null) { + joiner.add(getPrivileges().get(i).toUrlQueryString(String.format("%sprivileges%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUserPrivilegesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUserPrivilegesInner.java new file mode 100644 index 0000000..4377863 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteAdminUserPrivilegesInner.java @@ -0,0 +1,283 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Privileges given to the user + */ +@JsonPropertyOrder({ + InviteAdminUserPrivilegesInner.JSON_PROPERTY_FEATURE, + InviteAdminUserPrivilegesInner.JSON_PROPERTY_PERMISSIONS +}) +@JsonTypeName("inviteAdminUser_privileges_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InviteAdminUserPrivilegesInner { + /** + * Feature name + */ + public enum FeatureEnum { + MY_PLAN("my_plan"), + + API("api"), + + USER_MANAGEMENT("user_management"), + + APP_MANAGEMENT("app_management"); + + private String value; + + FeatureEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FeatureEnum fromValue(String value) { + for (FeatureEnum b : FeatureEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FEATURE = "feature"; + private FeatureEnum feature; + + /** + * Gets or Sets permissions + */ + public enum PermissionsEnum { + ALL("all"), + + NONE("none"); + + private String value; + + PermissionsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PermissionsEnum fromValue(String value) { + for (PermissionsEnum b : PermissionsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions; + + public InviteAdminUserPrivilegesInner() { + } + + public InviteAdminUserPrivilegesInner feature(FeatureEnum feature) { + + this.feature = feature; + return this; + } + + /** + * Feature name + * @return feature + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FeatureEnum getFeature() { + return feature; + } + + + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeature(FeatureEnum feature) { + this.feature = feature; + } + + + public InviteAdminUserPrivilegesInner permissions(List permissions) { + + this.permissions = permissions; + return this; + } + + public InviteAdminUserPrivilegesInner addPermissionsItem(PermissionsEnum permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Permissions for a given feature + * @return permissions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteAdminUserPrivilegesInner inviteAdminUserPrivilegesInner = (InviteAdminUserPrivilegesInner) o; + return Objects.equals(this.feature, inviteAdminUserPrivilegesInner.feature) && + Objects.equals(this.permissions, inviteAdminUserPrivilegesInner.permissions); + } + + @Override + public int hashCode() { + return Objects.hash(feature, permissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteAdminUserPrivilegesInner {\n"); + sb.append(" feature: ").append(toIndentedString(feature)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `feature` to the URL query string + if (getFeature() != null) { + try { + joiner.add(String.format("%sfeature%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFeature()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `permissions` to the URL query string + if (getPermissions() != null) { + for (int i = 0; i < getPermissions().size(); i++) { + try { + joiner.add(String.format("%spermissions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getPermissions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Inviteuser.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Inviteuser.java new file mode 100644 index 0000000..4206b70 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Inviteuser.java @@ -0,0 +1,248 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.InviteuserPrivilegesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Inviteuser + */ +@JsonPropertyOrder({ + Inviteuser.JSON_PROPERTY_EMAIL, + Inviteuser.JSON_PROPERTY_ALL_FEATURES_ACCESS, + Inviteuser.JSON_PROPERTY_PRIVILEGES +}) +@JsonTypeName("inviteuser") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Inviteuser { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ALL_FEATURES_ACCESS = "all_features_access"; + private Boolean allFeaturesAccess; + + public static final String JSON_PROPERTY_PRIVILEGES = "privileges"; + private List privileges = new ArrayList<>(); + + public Inviteuser() { + } + + public Inviteuser email(String email) { + + this.email = email; + return this; + } + + /** + * Email address for the organization + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public Inviteuser allFeaturesAccess(Boolean allFeaturesAccess) { + + this.allFeaturesAccess = allFeaturesAccess; + return this; + } + + /** + * All access to the features + * @return allFeaturesAccess + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ALL_FEATURES_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getAllFeaturesAccess() { + return allFeaturesAccess; + } + + + @JsonProperty(JSON_PROPERTY_ALL_FEATURES_ACCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAllFeaturesAccess(Boolean allFeaturesAccess) { + this.allFeaturesAccess = allFeaturesAccess; + } + + + public Inviteuser privileges(List privileges) { + + this.privileges = privileges; + return this; + } + + public Inviteuser addPrivilegesItem(InviteuserPrivilegesInner privilegesItem) { + if (this.privileges == null) { + this.privileges = new ArrayList<>(); + } + this.privileges.add(privilegesItem); + return this; + } + + /** + * Get privileges + * @return privileges + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPrivileges() { + return privileges; + } + + + @JsonProperty(JSON_PROPERTY_PRIVILEGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrivileges(List privileges) { + this.privileges = privileges; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Inviteuser inviteuser = (Inviteuser) o; + return Objects.equals(this.email, inviteuser.email) && + Objects.equals(this.allFeaturesAccess, inviteuser.allFeaturesAccess) && + Objects.equals(this.privileges, inviteuser.privileges); + } + + @Override + public int hashCode() { + return Objects.hash(email, allFeaturesAccess, privileges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Inviteuser {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" allFeaturesAccess: ").append(toIndentedString(allFeaturesAccess)).append("\n"); + sb.append(" privileges: ").append(toIndentedString(privileges)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `all_features_access` to the URL query string + if (getAllFeaturesAccess() != null) { + try { + joiner.add(String.format("%sall_features_access%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAllFeaturesAccess()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `privileges` to the URL query string + if (getPrivileges() != null) { + for (int i = 0; i < getPrivileges().size(); i++) { + if (getPrivileges().get(i) != null) { + joiner.add(getPrivileges().get(i).toUrlQueryString(String.format("%sprivileges%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserPrivilegesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserPrivilegesInner.java new file mode 100644 index 0000000..90441dd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserPrivilegesInner.java @@ -0,0 +1,355 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Privileges given to the user + */ +@JsonPropertyOrder({ + InviteuserPrivilegesInner.JSON_PROPERTY_FEATURE, + InviteuserPrivilegesInner.JSON_PROPERTY_PERMISSIONS +}) +@JsonTypeName("inviteuser_privileges_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InviteuserPrivilegesInner { + /** + * Feature name + */ + public enum FeatureEnum { + EMAIL_CAMPAIGNS("email_campaigns"), + + SMS_CAMPAIGNS("sms_campaigns"), + + CONTACTS("contacts"), + + TEMPLATES("templates"), + + WORKFLOWS("workflows"), + + FACEBOOK_ADS("facebook_ads"), + + LANDING_PAGES("landing_pages"), + + TRANSACTIONAL_EMAILS("transactional_emails"), + + SMTP_API("smtp_api"), + + USER_MANAGEMENT("user_management"), + + SALES_PLATFORM("sales_platform"), + + PHONE("phone"), + + CONVERSATIONS("conversations"), + + SENDERS_DOMAINS_DEDICATED_IPS("senders_domains_dedicated_ips"), + + PUSH_NOTIFICATIONS("push_notifications"); + + private String value; + + FeatureEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FeatureEnum fromValue(String value) { + for (FeatureEnum b : FeatureEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FEATURE = "feature"; + private FeatureEnum feature; + + /** + * Gets or Sets permissions + */ + public enum PermissionsEnum { + CREATE_EDIT_DELETE("create_edit_delete"), + + SEND_SCHEDULE_SUSPEND("send_schedule_suspend"), + + VIEW("view"), + + IMPORT("import"), + + EXPORT("export"), + + LIST_AND_ATTRIBUTES("list_and_attributes"), + + FORMS("forms"), + + ACTIVATE_DEACTIVATE("activate_deactivate"), + + ACTIVATE_DEACTIVATE_PAUSE("activate_deactivate_pause"), + + SETTINGS("settings"), + + SCHEDULE_PAUSE("schedule_pause"), + + ALL("all"), + + LOGS("logs"), + + ACCESS("access"), + + ASSIGN("assign"), + + CONFIGURE("configure"), + + MANAGE_OWNED_DEALS_TASKS_COMPANIES("manage_owned_deals_tasks_companies"), + + MANAGE_OTHERS_DEALS_TASKS_COMPANIES("manage_others_deals_tasks_companies"), + + REPORTS("reports"), + + SENDERS_MANAGEMENT("senders_management"), + + DOMAINS_MANAGEMENT("domains_management"), + + DEDICATED_IPS_MANAGEMENT("dedicated_ips_management"), + + SEND("send"), + + SMTP("smtp"), + + API_KEYS("api_keys"), + + AUTHORIZED_IPS("authorized_ips"), + + NONE("none"); + + private String value; + + PermissionsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PermissionsEnum fromValue(String value) { + for (PermissionsEnum b : PermissionsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions; + + public InviteuserPrivilegesInner() { + } + + public InviteuserPrivilegesInner feature(FeatureEnum feature) { + + this.feature = feature; + return this; + } + + /** + * Feature name + * @return feature + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FeatureEnum getFeature() { + return feature; + } + + + @JsonProperty(JSON_PROPERTY_FEATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeature(FeatureEnum feature) { + this.feature = feature; + } + + + public InviteuserPrivilegesInner permissions(List permissions) { + + this.permissions = permissions; + return this; + } + + public InviteuserPrivilegesInner addPermissionsItem(PermissionsEnum permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Permissions for a given feature + * @return permissions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteuserPrivilegesInner inviteuserPrivilegesInner = (InviteuserPrivilegesInner) o; + return Objects.equals(this.feature, inviteuserPrivilegesInner.feature) && + Objects.equals(this.permissions, inviteuserPrivilegesInner.permissions); + } + + @Override + public int hashCode() { + return Objects.hash(feature, permissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteuserPrivilegesInner {\n"); + sb.append(" feature: ").append(toIndentedString(feature)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `feature` to the URL query string + if (getFeature() != null) { + try { + joiner.add(String.format("%sfeature%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFeature()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `permissions` to the URL query string + if (getPermissions() != null) { + for (int i = 0; i < getPermissions().size(); i++) { + try { + joiner.add(String.format("%spermissions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getPermissions().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserResponse.java new file mode 100644 index 0000000..68a652e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/InviteuserResponse.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * InviteuserResponse + */ +@JsonPropertyOrder({ + InviteuserResponse.JSON_PROPERTY_STATUS, + InviteuserResponse.JSON_PROPERTY_INVOICE_ID +}) +@JsonTypeName("inviteuserResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InviteuserResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_INVOICE_ID = "invoice_id"; + private List invoiceId; + + public InviteuserResponse() { + } + + public InviteuserResponse status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the API operation. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public InviteuserResponse invoiceId(List invoiceId) { + + this.invoiceId = invoiceId; + return this; + } + + public InviteuserResponse addInvoiceIdItem(String invoiceIdItem) { + if (this.invoiceId == null) { + this.invoiceId = new ArrayList<>(); + } + this.invoiceId.add(invoiceIdItem); + return this; + } + + /** + * Invoice id + * @return invoiceId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVOICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getInvoiceId() { + return invoiceId; + } + + + @JsonProperty(JSON_PROPERTY_INVOICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvoiceId(List invoiceId) { + this.invoiceId = invoiceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteuserResponse inviteuserResponse = (InviteuserResponse) o; + return Objects.equals(this.status, inviteuserResponse.status) && + Objects.equals(this.invoiceId, inviteuserResponse.invoiceId); + } + + @Override + public int hashCode() { + return Objects.hash(status, invoiceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteuserResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" invoiceId: ").append(toIndentedString(invoiceId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `invoice_id` to the URL query string + if (getInvoiceId() != null) { + for (int i = 0; i < getInvoiceId().size(); i++) { + try { + joiner.add(String.format("%sinvoice_id%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getInvoiceId().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ManageIp.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ManageIp.java new file mode 100644 index 0000000..6396ab6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ManageIp.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ManageIp + */ +@JsonPropertyOrder({ + ManageIp.JSON_PROPERTY_IP +}) +@JsonTypeName("manageIp") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ManageIp { + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public ManageIp() { + } + + public ManageIp ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Dedicated ID + * @return ip + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageIp manageIp = (ManageIp) o; + return Objects.equals(this.ip, manageIp.ip); + } + + @Override + public int hashCode() { + return Objects.hash(ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageIp {\n"); + sb.append(" ip: ").append(toIndentedString(ip)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ip` to the URL query string + if (getIp() != null) { + try { + joiner.add(String.format("%sip%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponse.java new file mode 100644 index 0000000..2077da4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponse.java @@ -0,0 +1,396 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.MasterDetailsResponseBillingInfo; +import software.xdev.brevo.model.MasterDetailsResponsePlanInfo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * MasterDetailsResponse + */ +@JsonPropertyOrder({ + MasterDetailsResponse.JSON_PROPERTY_EMAIL, + MasterDetailsResponse.JSON_PROPERTY_COMPANY_NAME, + MasterDetailsResponse.JSON_PROPERTY_ID, + MasterDetailsResponse.JSON_PROPERTY_CURRENCY_CODE, + MasterDetailsResponse.JSON_PROPERTY_TIMEZONE, + MasterDetailsResponse.JSON_PROPERTY_BILLING_INFO, + MasterDetailsResponse.JSON_PROPERTY_PLAN_INFO +}) +@JsonTypeName("masterDetailsResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponse { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CURRENCY_CODE = "currencyCode"; + private String currencyCode; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public static final String JSON_PROPERTY_BILLING_INFO = "billingInfo"; + private MasterDetailsResponseBillingInfo billingInfo; + + public static final String JSON_PROPERTY_PLAN_INFO = "planInfo"; + private MasterDetailsResponsePlanInfo planInfo; + + public MasterDetailsResponse() { + } + + public MasterDetailsResponse email(String email) { + + this.email = email; + return this; + } + + /** + * Email id of master account + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public MasterDetailsResponse companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Company name of master account organization + * @return companyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public MasterDetailsResponse id(Long id) { + + this.id = id; + return this; + } + + /** + * Unique identifier of the master account organization + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + + public MasterDetailsResponse currencyCode(String currencyCode) { + + this.currencyCode = currencyCode; + return this; + } + + /** + * Currency code of the master account organization + * @return currencyCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCurrencyCode() { + return currencyCode; + } + + + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + + public MasterDetailsResponse timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Timezone of the master account organization + * @return timezone + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTimezone() { + return timezone; + } + + + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + + public MasterDetailsResponse billingInfo(MasterDetailsResponseBillingInfo billingInfo) { + + this.billingInfo = billingInfo; + return this; + } + + /** + * Get billingInfo + * @return billingInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BILLING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MasterDetailsResponseBillingInfo getBillingInfo() { + return billingInfo; + } + + + @JsonProperty(JSON_PROPERTY_BILLING_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBillingInfo(MasterDetailsResponseBillingInfo billingInfo) { + this.billingInfo = billingInfo; + } + + + public MasterDetailsResponse planInfo(MasterDetailsResponsePlanInfo planInfo) { + + this.planInfo = planInfo; + return this; + } + + /** + * Get planInfo + * @return planInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLAN_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MasterDetailsResponsePlanInfo getPlanInfo() { + return planInfo; + } + + + @JsonProperty(JSON_PROPERTY_PLAN_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlanInfo(MasterDetailsResponsePlanInfo planInfo) { + this.planInfo = planInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponse masterDetailsResponse = (MasterDetailsResponse) o; + return Objects.equals(this.email, masterDetailsResponse.email) && + Objects.equals(this.companyName, masterDetailsResponse.companyName) && + Objects.equals(this.id, masterDetailsResponse.id) && + Objects.equals(this.currencyCode, masterDetailsResponse.currencyCode) && + Objects.equals(this.timezone, masterDetailsResponse.timezone) && + Objects.equals(this.billingInfo, masterDetailsResponse.billingInfo) && + Objects.equals(this.planInfo, masterDetailsResponse.planInfo); + } + + @Override + public int hashCode() { + return Objects.hash(email, companyName, id, currencyCode, timezone, billingInfo, planInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponse {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" billingInfo: ").append(toIndentedString(billingInfo)).append("\n"); + sb.append(" planInfo: ").append(toIndentedString(planInfo)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `currencyCode` to the URL query string + if (getCurrencyCode() != null) { + try { + joiner.add(String.format("%scurrencyCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCurrencyCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `timezone` to the URL query string + if (getTimezone() != null) { + try { + joiner.add(String.format("%stimezone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTimezone()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `billingInfo` to the URL query string + if (getBillingInfo() != null) { + joiner.add(getBillingInfo().toUrlQueryString(prefix + "billingInfo" + suffix)); + } + + // add `planInfo` to the URL query string + if (getPlanInfo() != null) { + joiner.add(getPlanInfo().toUrlQueryString(prefix + "planInfo" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfo.java new file mode 100644 index 0000000..b219e35 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfo.java @@ -0,0 +1,270 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.MasterDetailsResponseBillingInfoAddress; +import software.xdev.brevo.model.MasterDetailsResponseBillingInfoName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Billing details of the master account organization + */ +@JsonPropertyOrder({ + MasterDetailsResponseBillingInfo.JSON_PROPERTY_EMAIL, + MasterDetailsResponseBillingInfo.JSON_PROPERTY_COMPANY_NAME, + MasterDetailsResponseBillingInfo.JSON_PROPERTY_NAME, + MasterDetailsResponseBillingInfo.JSON_PROPERTY_ADDRESS +}) +@JsonTypeName("masterDetailsResponse_billingInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponseBillingInfo { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_NAME = "name"; + private MasterDetailsResponseBillingInfoName name; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + private MasterDetailsResponseBillingInfoAddress address; + + public MasterDetailsResponseBillingInfo() { + } + + public MasterDetailsResponseBillingInfo email(String email) { + + this.email = email; + return this; + } + + /** + * Billing email id of master account + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public MasterDetailsResponseBillingInfo companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Company name of master account + * @return companyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public MasterDetailsResponseBillingInfo name(MasterDetailsResponseBillingInfoName name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MasterDetailsResponseBillingInfoName getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(MasterDetailsResponseBillingInfoName name) { + this.name = name; + } + + + public MasterDetailsResponseBillingInfo address(MasterDetailsResponseBillingInfoAddress address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MasterDetailsResponseBillingInfoAddress getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(MasterDetailsResponseBillingInfoAddress address) { + this.address = address; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponseBillingInfo masterDetailsResponseBillingInfo = (MasterDetailsResponseBillingInfo) o; + return Objects.equals(this.email, masterDetailsResponseBillingInfo.email) && + Objects.equals(this.companyName, masterDetailsResponseBillingInfo.companyName) && + Objects.equals(this.name, masterDetailsResponseBillingInfo.name) && + Objects.equals(this.address, masterDetailsResponseBillingInfo.address); + } + + @Override + public int hashCode() { + return Objects.hash(email, companyName, name, address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponseBillingInfo {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(getName().toUrlQueryString(prefix + "name" + suffix)); + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(getAddress().toUrlQueryString(prefix + "address" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoAddress.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoAddress.java new file mode 100644 index 0000000..8023ef5 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoAddress.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Billing address of master account + */ +@JsonPropertyOrder({ + MasterDetailsResponseBillingInfoAddress.JSON_PROPERTY_STREET_ADDRESS, + MasterDetailsResponseBillingInfoAddress.JSON_PROPERTY_LOCALITY, + MasterDetailsResponseBillingInfoAddress.JSON_PROPERTY_POSTAL_CODE, + MasterDetailsResponseBillingInfoAddress.JSON_PROPERTY_STATE_CODE, + MasterDetailsResponseBillingInfoAddress.JSON_PROPERTY_COUNTRY_CODE +}) +@JsonTypeName("masterDetailsResponse_billingInfo_address") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponseBillingInfoAddress { + public static final String JSON_PROPERTY_STREET_ADDRESS = "streetAddress"; + private String streetAddress; + + public static final String JSON_PROPERTY_LOCALITY = "locality"; + private String locality; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + public static final String JSON_PROPERTY_STATE_CODE = "stateCode"; + private String stateCode; + + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; + private String countryCode; + + public MasterDetailsResponseBillingInfoAddress() { + } + + public MasterDetailsResponseBillingInfoAddress streetAddress(String streetAddress) { + + this.streetAddress = streetAddress; + return this; + } + + /** + * Street address + * @return streetAddress + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STREET_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStreetAddress() { + return streetAddress; + } + + + @JsonProperty(JSON_PROPERTY_STREET_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + + public MasterDetailsResponseBillingInfoAddress locality(String locality) { + + this.locality = locality; + return this; + } + + /** + * Locality + * @return locality + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLocality() { + return locality; + } + + + @JsonProperty(JSON_PROPERTY_LOCALITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocality(String locality) { + this.locality = locality; + } + + + public MasterDetailsResponseBillingInfoAddress postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } + + /** + * Postal code + * @return postalCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPostalCode() { + return postalCode; + } + + + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + + public MasterDetailsResponseBillingInfoAddress stateCode(String stateCode) { + + this.stateCode = stateCode; + return this; + } + + /** + * State code + * @return stateCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStateCode() { + return stateCode; + } + + + @JsonProperty(JSON_PROPERTY_STATE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStateCode(String stateCode) { + this.stateCode = stateCode; + } + + + public MasterDetailsResponseBillingInfoAddress countryCode(String countryCode) { + + this.countryCode = countryCode; + return this; + } + + /** + * Country code + * @return countryCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCountryCode() { + return countryCode; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponseBillingInfoAddress masterDetailsResponseBillingInfoAddress = (MasterDetailsResponseBillingInfoAddress) o; + return Objects.equals(this.streetAddress, masterDetailsResponseBillingInfoAddress.streetAddress) && + Objects.equals(this.locality, masterDetailsResponseBillingInfoAddress.locality) && + Objects.equals(this.postalCode, masterDetailsResponseBillingInfoAddress.postalCode) && + Objects.equals(this.stateCode, masterDetailsResponseBillingInfoAddress.stateCode) && + Objects.equals(this.countryCode, masterDetailsResponseBillingInfoAddress.countryCode); + } + + @Override + public int hashCode() { + return Objects.hash(streetAddress, locality, postalCode, stateCode, countryCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponseBillingInfoAddress {\n"); + sb.append(" streetAddress: ").append(toIndentedString(streetAddress)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateCode: ").append(toIndentedString(stateCode)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `streetAddress` to the URL query string + if (getStreetAddress() != null) { + try { + joiner.add(String.format("%sstreetAddress%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStreetAddress()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `locality` to the URL query string + if (getLocality() != null) { + try { + joiner.add(String.format("%slocality%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLocality()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `postalCode` to the URL query string + if (getPostalCode() != null) { + try { + joiner.add(String.format("%spostalCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPostalCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `stateCode` to the URL query string + if (getStateCode() != null) { + try { + joiner.add(String.format("%sstateCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStateCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `countryCode` to the URL query string + if (getCountryCode() != null) { + try { + joiner.add(String.format("%scountryCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCountryCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoName.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoName.java new file mode 100644 index 0000000..b442478 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponseBillingInfoName.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Billing name of master account holder + */ +@JsonPropertyOrder({ + MasterDetailsResponseBillingInfoName.JSON_PROPERTY_GIVEN_NAME, + MasterDetailsResponseBillingInfoName.JSON_PROPERTY_FAMILY_NAME +}) +@JsonTypeName("masterDetailsResponse_billingInfo_name") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponseBillingInfoName { + public static final String JSON_PROPERTY_GIVEN_NAME = "givenName"; + private String givenName; + + public static final String JSON_PROPERTY_FAMILY_NAME = "familyName"; + private String familyName; + + public MasterDetailsResponseBillingInfoName() { + } + + public MasterDetailsResponseBillingInfoName givenName(String givenName) { + + this.givenName = givenName; + return this; + } + + /** + * First name for billing + * @return givenName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GIVEN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGivenName() { + return givenName; + } + + + @JsonProperty(JSON_PROPERTY_GIVEN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + + public MasterDetailsResponseBillingInfoName familyName(String familyName) { + + this.familyName = familyName; + return this; + } + + /** + * Last name for billing + * @return familyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAMILY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFamilyName() { + return familyName; + } + + + @JsonProperty(JSON_PROPERTY_FAMILY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponseBillingInfoName masterDetailsResponseBillingInfoName = (MasterDetailsResponseBillingInfoName) o; + return Objects.equals(this.givenName, masterDetailsResponseBillingInfoName.givenName) && + Objects.equals(this.familyName, masterDetailsResponseBillingInfoName.familyName); + } + + @Override + public int hashCode() { + return Objects.hash(givenName, familyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponseBillingInfoName {\n"); + sb.append(" givenName: ").append(toIndentedString(givenName)).append("\n"); + sb.append(" familyName: ").append(toIndentedString(familyName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `givenName` to the URL query string + if (getGivenName() != null) { + try { + joiner.add(String.format("%sgivenName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGivenName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `familyName` to the URL query string + if (getFamilyName() != null) { + try { + joiner.add(String.format("%sfamilyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFamilyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfo.java new file mode 100644 index 0000000..7db819a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfo.java @@ -0,0 +1,410 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.MasterDetailsResponsePlanInfoFeaturesInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Plan details + */ +@JsonPropertyOrder({ + MasterDetailsResponsePlanInfo.JSON_PROPERTY_CURRENCY_CODE, + MasterDetailsResponsePlanInfo.JSON_PROPERTY_NEXT_BILLING_AT, + MasterDetailsResponsePlanInfo.JSON_PROPERTY_PRICE, + MasterDetailsResponsePlanInfo.JSON_PROPERTY_PLAN_PERIOD, + MasterDetailsResponsePlanInfo.JSON_PROPERTY_SUB_ACCOUNTS, + MasterDetailsResponsePlanInfo.JSON_PROPERTY_FEATURES +}) +@JsonTypeName("masterDetailsResponse_planInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponsePlanInfo { + public static final String JSON_PROPERTY_CURRENCY_CODE = "currencyCode"; + private String currencyCode; + + public static final String JSON_PROPERTY_NEXT_BILLING_AT = "nextBillingAt"; + private Long nextBillingAt; + + public static final String JSON_PROPERTY_PRICE = "price"; + private BigDecimal price; + + /** + * Plan period type + */ + public enum PlanPeriodEnum { + MONTH("month"), + + YEAR("year"); + + private String value; + + PlanPeriodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PlanPeriodEnum fromValue(String value) { + for (PlanPeriodEnum b : PlanPeriodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PLAN_PERIOD = "planPeriod"; + private PlanPeriodEnum planPeriod; + + public static final String JSON_PROPERTY_SUB_ACCOUNTS = "subAccounts"; + private Integer subAccounts; + + public static final String JSON_PROPERTY_FEATURES = "features"; + private List features; + + public MasterDetailsResponsePlanInfo() { + } + + public MasterDetailsResponsePlanInfo currencyCode(String currencyCode) { + + this.currencyCode = currencyCode; + return this; + } + + /** + * Plan currency + * @return currencyCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCurrencyCode() { + return currencyCode; + } + + + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + + public MasterDetailsResponsePlanInfo nextBillingAt(Long nextBillingAt) { + + this.nextBillingAt = nextBillingAt; + return this; + } + + /** + * Timestamp of next billing date + * @return nextBillingAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT_BILLING_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getNextBillingAt() { + return nextBillingAt; + } + + + @JsonProperty(JSON_PROPERTY_NEXT_BILLING_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextBillingAt(Long nextBillingAt) { + this.nextBillingAt = nextBillingAt; + } + + + public MasterDetailsResponsePlanInfo price(BigDecimal price) { + + this.price = price; + return this; + } + + /** + * Plan amount + * @return price + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getPrice() { + return price; + } + + + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrice(BigDecimal price) { + this.price = price; + } + + + public MasterDetailsResponsePlanInfo planPeriod(PlanPeriodEnum planPeriod) { + + this.planPeriod = planPeriod; + return this; + } + + /** + * Plan period type + * @return planPeriod + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLAN_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PlanPeriodEnum getPlanPeriod() { + return planPeriod; + } + + + @JsonProperty(JSON_PROPERTY_PLAN_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlanPeriod(PlanPeriodEnum planPeriod) { + this.planPeriod = planPeriod; + } + + + public MasterDetailsResponsePlanInfo subAccounts(Integer subAccounts) { + + this.subAccounts = subAccounts; + return this; + } + + /** + * Number of sub-accounts + * @return subAccounts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSubAccounts() { + return subAccounts; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubAccounts(Integer subAccounts) { + this.subAccounts = subAccounts; + } + + + public MasterDetailsResponsePlanInfo features(List features) { + + this.features = features; + return this; + } + + public MasterDetailsResponsePlanInfo addFeaturesItem(MasterDetailsResponsePlanInfoFeaturesInner featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * List of provided features in the plan + * @return features + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFeatures() { + return features; + } + + + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeatures(List features) { + this.features = features; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponsePlanInfo masterDetailsResponsePlanInfo = (MasterDetailsResponsePlanInfo) o; + return Objects.equals(this.currencyCode, masterDetailsResponsePlanInfo.currencyCode) && + Objects.equals(this.nextBillingAt, masterDetailsResponsePlanInfo.nextBillingAt) && + Objects.equals(this.price, masterDetailsResponsePlanInfo.price) && + Objects.equals(this.planPeriod, masterDetailsResponsePlanInfo.planPeriod) && + Objects.equals(this.subAccounts, masterDetailsResponsePlanInfo.subAccounts) && + Objects.equals(this.features, masterDetailsResponsePlanInfo.features); + } + + @Override + public int hashCode() { + return Objects.hash(currencyCode, nextBillingAt, price, planPeriod, subAccounts, features); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponsePlanInfo {\n"); + sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n"); + sb.append(" nextBillingAt: ").append(toIndentedString(nextBillingAt)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" planPeriod: ").append(toIndentedString(planPeriod)).append("\n"); + sb.append(" subAccounts: ").append(toIndentedString(subAccounts)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `currencyCode` to the URL query string + if (getCurrencyCode() != null) { + try { + joiner.add(String.format("%scurrencyCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCurrencyCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `nextBillingAt` to the URL query string + if (getNextBillingAt() != null) { + try { + joiner.add(String.format("%snextBillingAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNextBillingAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `price` to the URL query string + if (getPrice() != null) { + try { + joiner.add(String.format("%sprice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `planPeriod` to the URL query string + if (getPlanPeriod() != null) { + try { + joiner.add(String.format("%splanPeriod%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPlanPeriod()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subAccounts` to the URL query string + if (getSubAccounts() != null) { + try { + joiner.add(String.format("%ssubAccounts%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubAccounts()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `features` to the URL query string + if (getFeatures() != null) { + for (int i = 0; i < getFeatures().size(); i++) { + if (getFeatures().get(i) != null) { + joiner.add(getFeatures().get(i).toUrlQueryString(String.format("%sfeatures%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfoFeaturesInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfoFeaturesInner.java new file mode 100644 index 0000000..3942233 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/MasterDetailsResponsePlanInfoFeaturesInner.java @@ -0,0 +1,404 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * MasterDetailsResponsePlanInfoFeaturesInner + */ +@JsonPropertyOrder({ + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_NAME, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_UNIT_VALUE, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_QUANTITY, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_QUANTITY_WITH_OVERAGES, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_USED, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_USED_OVERAGES, + MasterDetailsResponsePlanInfoFeaturesInner.JSON_PROPERTY_REMAINING +}) +@JsonTypeName("masterDetailsResponse_planInfo_features_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MasterDetailsResponsePlanInfoFeaturesInner { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_UNIT_VALUE = "unitValue"; + private String unitValue; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_QUANTITY_WITH_OVERAGES = "quantityWithOverages"; + private Long quantityWithOverages; + + public static final String JSON_PROPERTY_USED = "used"; + private Long used; + + public static final String JSON_PROPERTY_USED_OVERAGES = "usedOverages"; + private Long usedOverages; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public MasterDetailsResponsePlanInfoFeaturesInner() { + } + + public MasterDetailsResponsePlanInfoFeaturesInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the feature + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner unitValue(String unitValue) { + + this.unitValue = unitValue; + return this; + } + + /** + * Unit value of the feature + * @return unitValue + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUnitValue() { + return unitValue; + } + + + @JsonProperty(JSON_PROPERTY_UNIT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnitValue(String unitValue) { + this.unitValue = unitValue; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner quantity(Long quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Quantity provided in the plan + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner quantityWithOverages(Long quantityWithOverages) { + + this.quantityWithOverages = quantityWithOverages; + return this; + } + + /** + * Quantity with overages provided in the plan (only applicable on ENTv2) + * @return quantityWithOverages + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY_WITH_OVERAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantityWithOverages() { + return quantityWithOverages; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY_WITH_OVERAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantityWithOverages(Long quantityWithOverages) { + this.quantityWithOverages = quantityWithOverages; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner used(Long used) { + + this.used = used; + return this; + } + + /** + * Quantity consumed by master + * @return used + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsed() { + return used; + } + + + @JsonProperty(JSON_PROPERTY_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsed(Long used) { + this.used = used; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner usedOverages(Long usedOverages) { + + this.usedOverages = usedOverages; + return this; + } + + /** + * Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2) + * @return usedOverages + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_OVERAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedOverages() { + return usedOverages; + } + + + @JsonProperty(JSON_PROPERTY_USED_OVERAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedOverages(Long usedOverages) { + this.usedOverages = usedOverages; + } + + + public MasterDetailsResponsePlanInfoFeaturesInner remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Quantity remaining in the plan + * @return remaining + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MasterDetailsResponsePlanInfoFeaturesInner masterDetailsResponsePlanInfoFeaturesInner = (MasterDetailsResponsePlanInfoFeaturesInner) o; + return Objects.equals(this.name, masterDetailsResponsePlanInfoFeaturesInner.name) && + Objects.equals(this.unitValue, masterDetailsResponsePlanInfoFeaturesInner.unitValue) && + Objects.equals(this.quantity, masterDetailsResponsePlanInfoFeaturesInner.quantity) && + Objects.equals(this.quantityWithOverages, masterDetailsResponsePlanInfoFeaturesInner.quantityWithOverages) && + Objects.equals(this.used, masterDetailsResponsePlanInfoFeaturesInner.used) && + Objects.equals(this.usedOverages, masterDetailsResponsePlanInfoFeaturesInner.usedOverages) && + Objects.equals(this.remaining, masterDetailsResponsePlanInfoFeaturesInner.remaining); + } + + @Override + public int hashCode() { + return Objects.hash(name, unitValue, quantity, quantityWithOverages, used, usedOverages, remaining); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MasterDetailsResponsePlanInfoFeaturesInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" unitValue: ").append(toIndentedString(unitValue)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" quantityWithOverages: ").append(toIndentedString(quantityWithOverages)).append("\n"); + sb.append(" used: ").append(toIndentedString(used)).append("\n"); + sb.append(" usedOverages: ").append(toIndentedString(usedOverages)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unitValue` to the URL query string + if (getUnitValue() != null) { + try { + joiner.add(String.format("%sunitValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnitValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `quantityWithOverages` to the URL query string + if (getQuantityWithOverages() != null) { + try { + joiner.add(String.format("%squantityWithOverages%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantityWithOverages()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `used` to the URL query string + if (getUsed() != null) { + try { + joiner.add(String.format("%sused%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `usedOverages` to the URL query string + if (getUsedOverages() != null) { + try { + joiner.add(String.format("%susedOverages%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsedOverages()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Note.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Note.java new file mode 100644 index 0000000..e8649be --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Note.java @@ -0,0 +1,431 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Note Details + */ +@JsonPropertyOrder({ + Note.JSON_PROPERTY_ID, + Note.JSON_PROPERTY_TEXT, + Note.JSON_PROPERTY_CONTACT_IDS, + Note.JSON_PROPERTY_DEAL_IDS, + Note.JSON_PROPERTY_AUTHOR_ID, + Note.JSON_PROPERTY_CREATED_AT, + Note.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Note { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_CONTACT_IDS = "contactIds"; + private List contactIds; + + public static final String JSON_PROPERTY_DEAL_IDS = "dealIds"; + private List dealIds; + + public static final String JSON_PROPERTY_AUTHOR_ID = "authorId"; + private Object authorId; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private OffsetDateTime updatedAt; + + public Note() { + } + + public Note id(String id) { + + this.id = id; + return this; + } + + /** + * Unique note Id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public Note text(String text) { + + this.text = text; + return this; + } + + /** + * Text content of a note + * @return text + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(String text) { + this.text = text; + } + + + public Note contactIds(List contactIds) { + + this.contactIds = contactIds; + return this; + } + + public Note addContactIdsItem(Integer contactIdsItem) { + if (this.contactIds == null) { + this.contactIds = new ArrayList<>(); + } + this.contactIds.add(contactIdsItem); + return this; + } + + /** + * Contact ids linked to a note + * @return contactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContactIds() { + return contactIds; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactIds(List contactIds) { + this.contactIds = contactIds; + } + + + public Note dealIds(List dealIds) { + + this.dealIds = dealIds; + return this; + } + + public Note addDealIdsItem(String dealIdsItem) { + if (this.dealIds == null) { + this.dealIds = new ArrayList<>(); + } + this.dealIds.add(dealIdsItem); + return this; + } + + /** + * Deal ids linked to a note + * @return dealIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEAL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDealIds() { + return dealIds; + } + + + @JsonProperty(JSON_PROPERTY_DEAL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealIds(List dealIds) { + this.dealIds = dealIds; + } + + + public Note authorId(Object authorId) { + + this.authorId = authorId; + return this; + } + + /** + * Account details of user which created the note + * @return authorId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAuthorId() { + return authorId; + } + + + @JsonProperty(JSON_PROPERTY_AUTHOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorId(Object authorId) { + this.authorId = authorId; + } + + + public Note createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Note created date/time + * @return createdAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Note updatedAt(OffsetDateTime updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Note updated date/time + * @return updatedAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Note note = (Note) o; + return Objects.equals(this.id, note.id) && + Objects.equals(this.text, note.text) && + Objects.equals(this.contactIds, note.contactIds) && + Objects.equals(this.dealIds, note.dealIds) && + Objects.equals(this.authorId, note.authorId) && + Objects.equals(this.createdAt, note.createdAt) && + Objects.equals(this.updatedAt, note.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, contactIds, dealIds, authorId, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Note {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" contactIds: ").append(toIndentedString(contactIds)).append("\n"); + sb.append(" dealIds: ").append(toIndentedString(dealIds)).append("\n"); + sb.append(" authorId: ").append(toIndentedString(authorId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactIds` to the URL query string + if (getContactIds() != null) { + for (int i = 0; i < getContactIds().size(); i++) { + try { + joiner.add(String.format("%scontactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `dealIds` to the URL query string + if (getDealIds() != null) { + for (int i = 0; i < getDealIds().size(); i++) { + try { + joiner.add(String.format("%sdealIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDealIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `authorId` to the URL query string + if (getAuthorId() != null) { + try { + joiner.add(String.format("%sauthorId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthorId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updatedAt` to the URL query string + if (getUpdatedAt() != null) { + try { + joiner.add(String.format("%supdatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteData.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteData.java new file mode 100644 index 0000000..68d6e4a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteData.java @@ -0,0 +1,316 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Note data to be saved + */ +@JsonPropertyOrder({ + NoteData.JSON_PROPERTY_TEXT, + NoteData.JSON_PROPERTY_CONTACT_IDS, + NoteData.JSON_PROPERTY_DEAL_IDS, + NoteData.JSON_PROPERTY_COMPANY_IDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NoteData { + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_CONTACT_IDS = "contactIds"; + private List contactIds; + + public static final String JSON_PROPERTY_DEAL_IDS = "dealIds"; + private List dealIds; + + public static final String JSON_PROPERTY_COMPANY_IDS = "companyIds"; + private List companyIds; + + public NoteData() { + } + + public NoteData text(String text) { + + this.text = text; + return this; + } + + /** + * Text content of a note + * @return text + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(String text) { + this.text = text; + } + + + public NoteData contactIds(List contactIds) { + + this.contactIds = contactIds; + return this; + } + + public NoteData addContactIdsItem(Integer contactIdsItem) { + if (this.contactIds == null) { + this.contactIds = new ArrayList<>(); + } + this.contactIds.add(contactIdsItem); + return this; + } + + /** + * Contact Ids linked to a note + * @return contactIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContactIds() { + return contactIds; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactIds(List contactIds) { + this.contactIds = contactIds; + } + + + public NoteData dealIds(List dealIds) { + + this.dealIds = dealIds; + return this; + } + + public NoteData addDealIdsItem(String dealIdsItem) { + if (this.dealIds == null) { + this.dealIds = new ArrayList<>(); + } + this.dealIds.add(dealIdsItem); + return this; + } + + /** + * Deal Ids linked to a note + * @return dealIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEAL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDealIds() { + return dealIds; + } + + + @JsonProperty(JSON_PROPERTY_DEAL_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealIds(List dealIds) { + this.dealIds = dealIds; + } + + + public NoteData companyIds(List companyIds) { + + this.companyIds = companyIds; + return this; + } + + public NoteData addCompanyIdsItem(String companyIdsItem) { + if (this.companyIds == null) { + this.companyIds = new ArrayList<>(); + } + this.companyIds.add(companyIdsItem); + return this; + } + + /** + * Company Ids linked to a note + * @return companyIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCompanyIds() { + return companyIds; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyIds(List companyIds) { + this.companyIds = companyIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NoteData noteData = (NoteData) o; + return Objects.equals(this.text, noteData.text) && + Objects.equals(this.contactIds, noteData.contactIds) && + Objects.equals(this.dealIds, noteData.dealIds) && + Objects.equals(this.companyIds, noteData.companyIds); + } + + @Override + public int hashCode() { + return Objects.hash(text, contactIds, dealIds, companyIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NoteData {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" contactIds: ").append(toIndentedString(contactIds)).append("\n"); + sb.append(" dealIds: ").append(toIndentedString(dealIds)).append("\n"); + sb.append(" companyIds: ").append(toIndentedString(companyIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactIds` to the URL query string + if (getContactIds() != null) { + for (int i = 0; i < getContactIds().size(); i++) { + try { + joiner.add(String.format("%scontactIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `dealIds` to the URL query string + if (getDealIds() != null) { + for (int i = 0; i < getDealIds().size(); i++) { + try { + joiner.add(String.format("%sdealIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDealIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `companyIds` to the URL query string + if (getCompanyIds() != null) { + for (int i = 0; i < getCompanyIds().size(); i++) { + try { + joiner.add(String.format("%scompanyIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCompanyIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteId.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteId.java new file mode 100644 index 0000000..4c5594f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/NoteId.java @@ -0,0 +1,151 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Updated Note ID + */ +@JsonPropertyOrder({ + NoteId.JSON_PROPERTY_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NoteId { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public NoteId() { + } + + public NoteId id(String id) { + + this.id = id; + return this; + } + + /** + * Unique note Id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NoteId noteId = (NoteId) o; + return Objects.equals(this.id, noteId.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NoteId {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Order.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Order.java new file mode 100644 index 0000000..8e1206f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Order.java @@ -0,0 +1,509 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.OrderBilling; +import software.xdev.brevo.model.OrderProductsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_CREATED_AT, + Order.JSON_PROPERTY_UPDATED_AT, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_AMOUNT, + Order.JSON_PROPERTY_PRODUCTS, + Order.JSON_PROPERTY_EMAIL, + Order.JSON_PROPERTY_BILLING, + Order.JSON_PROPERTY_COUPONS +}) +@JsonTypeName("order") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private String createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private String updatedAt; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private BigDecimal amount; + + public static final String JSON_PROPERTY_PRODUCTS = "products"; + private List products = new ArrayList<>(); + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_BILLING = "billing"; + private OrderBilling billing; + + public static final String JSON_PROPERTY_COUPONS = "coupons"; + private List coupons; + + public Order() { + } + + public Order id(String id) { + + this.id = id; + return this; + } + + /** + * Unique ID of the order. + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public Order createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public Order updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. + * @return updatedAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + public Order status(String status) { + + this.status = status; + return this; + } + + /** + * State of the order. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public Order amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Total amount of the order, including all shipping expenses, tax and the price of items. + * @return amount + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getAmount() { + return amount; + } + + + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + public Order products(List products) { + + this.products = products; + return this; + } + + public Order addProductsItem(OrderProductsInner productsItem) { + if (this.products == null) { + this.products = new ArrayList<>(); + } + this.products.add(productsItem); + return this; + } + + /** + * Get products + * @return products + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getProducts() { + return products; + } + + + @JsonProperty(JSON_PROPERTY_PRODUCTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProducts(List products) { + this.products = products; + } + + + public Order email(String email) { + + this.email = email; + return this; + } + + /** + * Email of the contact, Mandatory if \"phone\" field is not passed in \"billing\" parameter. + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public Order billing(OrderBilling billing) { + + this.billing = billing; + return this; + } + + /** + * Get billing + * @return billing + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BILLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OrderBilling getBilling() { + return billing; + } + + + @JsonProperty(JSON_PROPERTY_BILLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBilling(OrderBilling billing) { + this.billing = billing; + } + + + public Order coupons(List coupons) { + + this.coupons = coupons; + return this; + } + + public Order addCouponsItem(String couponsItem) { + if (this.coupons == null) { + this.coupons = new ArrayList<>(); + } + this.coupons.add(couponsItem); + return this; + } + + /** + * Coupons applied to the order. Stored case insensitive. + * @return coupons + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUPONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCoupons() { + return coupons; + } + + + @JsonProperty(JSON_PROPERTY_COUPONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoupons(List coupons) { + this.coupons = coupons; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.createdAt, order.createdAt) && + Objects.equals(this.updatedAt, order.updatedAt) && + Objects.equals(this.status, order.status) && + Objects.equals(this.amount, order.amount) && + Objects.equals(this.products, order.products) && + Objects.equals(this.email, order.email) && + Objects.equals(this.billing, order.billing) && + Objects.equals(this.coupons, order.coupons); + } + + @Override + public int hashCode() { + return Objects.hash(id, createdAt, updatedAt, status, amount, products, email, billing, coupons); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" products: ").append(toIndentedString(products)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" billing: ").append(toIndentedString(billing)).append("\n"); + sb.append(" coupons: ").append(toIndentedString(coupons)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updatedAt` to the URL query string + if (getUpdatedAt() != null) { + try { + joiner.add(String.format("%supdatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `amount` to the URL query string + if (getAmount() != null) { + try { + joiner.add(String.format("%samount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAmount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `products` to the URL query string + if (getProducts() != null) { + for (int i = 0; i < getProducts().size(); i++) { + if (getProducts().get(i) != null) { + joiner.add(getProducts().get(i).toUrlQueryString(String.format("%sproducts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `billing` to the URL query string + if (getBilling() != null) { + joiner.add(getBilling().toUrlQueryString(prefix + "billing" + suffix)); + } + + // add `coupons` to the URL query string + if (getCoupons() != null) { + for (int i = 0; i < getCoupons().size(); i++) { + try { + joiner.add(String.format("%scoupons%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCoupons().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBatch.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBatch.java new file mode 100644 index 0000000..5fbebfb --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBatch.java @@ -0,0 +1,248 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.Order; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * OrderBatch + */ +@JsonPropertyOrder({ + OrderBatch.JSON_PROPERTY_ORDERS, + OrderBatch.JSON_PROPERTY_NOTIFY_URL, + OrderBatch.JSON_PROPERTY_HISTORICAL +}) +@JsonTypeName("orderBatch") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrderBatch { + public static final String JSON_PROPERTY_ORDERS = "orders"; + private List orders = new ArrayList<>(); + + public static final String JSON_PROPERTY_NOTIFY_URL = "notifyUrl"; + private String notifyUrl; + + public static final String JSON_PROPERTY_HISTORICAL = "historical"; + private Boolean historical = true; + + public OrderBatch() { + } + + public OrderBatch orders(List orders) { + + this.orders = orders; + return this; + } + + public OrderBatch addOrdersItem(Order ordersItem) { + if (this.orders == null) { + this.orders = new ArrayList<>(); + } + this.orders.add(ordersItem); + return this; + } + + /** + * array of order objects + * @return orders + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORDERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getOrders() { + return orders; + } + + + @JsonProperty(JSON_PROPERTY_ORDERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOrders(List orders) { + this.orders = orders; + } + + + public OrderBatch notifyUrl(String notifyUrl) { + + this.notifyUrl = notifyUrl; + return this; + } + + /** + * Notify Url provided by client to get the status of batch request + * @return notifyUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotifyUrl() { + return notifyUrl; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; + } + + + public OrderBatch historical(Boolean historical) { + + this.historical = historical; + return this; + } + + /** + * Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. + * @return historical + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HISTORICAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHistorical() { + return historical; + } + + + @JsonProperty(JSON_PROPERTY_HISTORICAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHistorical(Boolean historical) { + this.historical = historical; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderBatch orderBatch = (OrderBatch) o; + return Objects.equals(this.orders, orderBatch.orders) && + Objects.equals(this.notifyUrl, orderBatch.notifyUrl) && + Objects.equals(this.historical, orderBatch.historical); + } + + @Override + public int hashCode() { + return Objects.hash(orders, notifyUrl, historical); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderBatch {\n"); + sb.append(" orders: ").append(toIndentedString(orders)).append("\n"); + sb.append(" notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n"); + sb.append(" historical: ").append(toIndentedString(historical)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `orders` to the URL query string + if (getOrders() != null) { + for (int i = 0; i < getOrders().size(); i++) { + if (getOrders().get(i) != null) { + joiner.add(getOrders().get(i).toUrlQueryString(String.format("%sorders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `notifyUrl` to the URL query string + if (getNotifyUrl() != null) { + try { + joiner.add(String.format("%snotifyUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `historical` to the URL query string + if (getHistorical() != null) { + try { + joiner.add(String.format("%shistorical%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHistorical()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBilling.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBilling.java new file mode 100644 index 0000000..74cbb0b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderBilling.java @@ -0,0 +1,404 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Billing details of an order. + */ +@JsonPropertyOrder({ + OrderBilling.JSON_PROPERTY_ADDRESS, + OrderBilling.JSON_PROPERTY_CITY, + OrderBilling.JSON_PROPERTY_COUNTRY_CODE, + OrderBilling.JSON_PROPERTY_PHONE, + OrderBilling.JSON_PROPERTY_POST_CODE, + OrderBilling.JSON_PROPERTY_PAYMENT_METHOD, + OrderBilling.JSON_PROPERTY_REGION +}) +@JsonTypeName("order_billing") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrderBilling { + public static final String JSON_PROPERTY_ADDRESS = "address"; + private String address; + + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; + private String countryCode; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_POST_CODE = "postCode"; + private String postCode; + + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; + private String paymentMethod; + + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + + public OrderBilling() { + } + + public OrderBilling address(String address) { + + this.address = address; + return this; + } + + /** + * Full billing address. + * @return address + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(String address) { + this.address = address; + } + + + public OrderBilling city(String city) { + + this.city = city; + return this; + } + + /** + * Exact city of the address. + * @return city + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + + public OrderBilling countryCode(String countryCode) { + + this.countryCode = countryCode; + return this; + } + + /** + * Billing country 2-letter ISO code. + * @return countryCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCountryCode() { + return countryCode; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + + public OrderBilling phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Phone number to contact for further details about the order, Mandatory if \"email\" field is not passed. + * @return phone + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhone() { + return phone; + } + + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + + public OrderBilling postCode(String postCode) { + + this.postCode = postCode; + return this; + } + + /** + * Postcode for delivery and billing. + * @return postCode + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POST_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPostCode() { + return postCode; + } + + + @JsonProperty(JSON_PROPERTY_POST_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostCode(String postCode) { + this.postCode = postCode; + } + + + public OrderBilling paymentMethod(String paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * How the visitor will pay for the item(s), e.g. paypal, check, etc. + * @return paymentMethod + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPaymentMethod() { + return paymentMethod; + } + + + @JsonProperty(JSON_PROPERTY_PAYMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + public OrderBilling region(String region) { + + this.region = region; + return this; + } + + /** + * Exact region (state/province) for delivery and billing. + * @return region + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRegion() { + return region; + } + + + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRegion(String region) { + this.region = region; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderBilling orderBilling = (OrderBilling) o; + return Objects.equals(this.address, orderBilling.address) && + Objects.equals(this.city, orderBilling.city) && + Objects.equals(this.countryCode, orderBilling.countryCode) && + Objects.equals(this.phone, orderBilling.phone) && + Objects.equals(this.postCode, orderBilling.postCode) && + Objects.equals(this.paymentMethod, orderBilling.paymentMethod) && + Objects.equals(this.region, orderBilling.region); + } + + @Override + public int hashCode() { + return Objects.hash(address, city, countryCode, phone, postCode, paymentMethod, region); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderBilling {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" postCode: ").append(toIndentedString(postCode)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + try { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAddress()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `city` to the URL query string + if (getCity() != null) { + try { + joiner.add(String.format("%scity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `countryCode` to the URL query string + if (getCountryCode() != null) { + try { + joiner.add(String.format("%scountryCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCountryCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `phone` to the URL query string + if (getPhone() != null) { + try { + joiner.add(String.format("%sphone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhone()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `postCode` to the URL query string + if (getPostCode() != null) { + try { + joiner.add(String.format("%spostCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPostCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `paymentMethod` to the URL query string + if (getPaymentMethod() != null) { + try { + joiner.add(String.format("%spaymentMethod%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPaymentMethod()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `region` to the URL query string + if (getRegion() != null) { + try { + joiner.add(String.format("%sregion%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRegion()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderProductsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderProductsInner.java new file mode 100644 index 0000000..1dae2e4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/OrderProductsInner.java @@ -0,0 +1,279 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Details for the Products in an order. + */ +@JsonPropertyOrder({ + OrderProductsInner.JSON_PROPERTY_PRODUCT_ID, + OrderProductsInner.JSON_PROPERTY_QUANTITY, + OrderProductsInner.JSON_PROPERTY_VARIANT_ID, + OrderProductsInner.JSON_PROPERTY_PRICE +}) +@JsonTypeName("order_products_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OrderProductsInner { + public static final String JSON_PROPERTY_PRODUCT_ID = "productId"; + private String productId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private BigDecimal quantity; + + public static final String JSON_PROPERTY_VARIANT_ID = "variantId"; + private String variantId; + + public static final String JSON_PROPERTY_PRICE = "price"; + private BigDecimal price; + + public OrderProductsInner() { + } + + public OrderProductsInner productId(String productId) { + + this.productId = productId; + return this; + } + + /** + * ID of the product. + * @return productId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRODUCT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getProductId() { + return productId; + } + + + @JsonProperty(JSON_PROPERTY_PRODUCT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProductId(String productId) { + this.productId = productId; + } + + + public OrderProductsInner quantity(BigDecimal quantity) { + + this.quantity = quantity; + return this; + } + + /** + * How many pieces of the product the visitor has added to the cart. + * @return quantity + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + + public OrderProductsInner variantId(String variantId) { + + this.variantId = variantId; + return this; + } + + /** + * Product ID of the red color shirts. + * @return variantId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVariantId() { + return variantId; + } + + + @JsonProperty(JSON_PROPERTY_VARIANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVariantId(String variantId) { + this.variantId = variantId; + } + + + public OrderProductsInner price(BigDecimal price) { + + this.price = price; + return this; + } + + /** + * The price of a unit of product + * @return price + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getPrice() { + return price; + } + + + @JsonProperty(JSON_PROPERTY_PRICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrice(BigDecimal price) { + this.price = price; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderProductsInner orderProductsInner = (OrderProductsInner) o; + return Objects.equals(this.productId, orderProductsInner.productId) && + Objects.equals(this.quantity, orderProductsInner.quantity) && + Objects.equals(this.variantId, orderProductsInner.variantId) && + Objects.equals(this.price, orderProductsInner.price); + } + + @Override + public int hashCode() { + return Objects.hash(productId, quantity, variantId, price); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderProductsInner {\n"); + sb.append(" productId: ").append(toIndentedString(productId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" variantId: ").append(toIndentedString(variantId)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `productId` to the URL query string + if (getProductId() != null) { + try { + joiner.add(String.format("%sproductId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProductId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `variantId` to the URL query string + if (getVariantId() != null) { + try { + joiner.add(String.format("%svariantId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVariantId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `price` to the URL query string + if (getPrice() != null) { + try { + joiner.add(String.format("%sprice%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPrice()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Otp.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Otp.java new file mode 100644 index 0000000..8d7c5e8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Otp.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Otp + */ +@JsonPropertyOrder({ + Otp.JSON_PROPERTY_OTP +}) +@JsonTypeName("otp") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Otp { + public static final String JSON_PROPERTY_OTP = "otp"; + private Integer otp; + + public Otp() { + } + + public Otp otp(Integer otp) { + + this.otp = otp; + return this; + } + + /** + * 6 digit OTP received on email + * @return otp + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OTP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getOtp() { + return otp; + } + + + @JsonProperty(JSON_PROPERTY_OTP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOtp(Integer otp) { + this.otp = otp; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Otp otp = (Otp) o; + return Objects.equals(this.otp, otp.otp); + } + + @Override + public int hashCode() { + return Objects.hash(otp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Otp {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `otp` to the URL query string + if (getOtp() != null) { + try { + joiner.add(String.format("%sotp%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOtp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Pipeline.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Pipeline.java new file mode 100644 index 0000000..28975ec --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Pipeline.java @@ -0,0 +1,247 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.PipelineStage; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of stages + */ +@JsonPropertyOrder({ + Pipeline.JSON_PROPERTY_PIPELINE_NAME, + Pipeline.JSON_PROPERTY_PIPELINE, + Pipeline.JSON_PROPERTY_STAGES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pipeline { + public static final String JSON_PROPERTY_PIPELINE_NAME = "pipeline_name"; + private String pipelineName; + + public static final String JSON_PROPERTY_PIPELINE = "pipeline"; + private String pipeline; + + public static final String JSON_PROPERTY_STAGES = "stages"; + private List stages; + + public Pipeline() { + } + + public Pipeline pipelineName(String pipelineName) { + + this.pipelineName = pipelineName; + return this; + } + + /** + * Pipeline name + * @return pipelineName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIPELINE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPipelineName() { + return pipelineName; + } + + + @JsonProperty(JSON_PROPERTY_PIPELINE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPipelineName(String pipelineName) { + this.pipelineName = pipelineName; + } + + + public Pipeline pipeline(String pipeline) { + + this.pipeline = pipeline; + return this; + } + + /** + * Pipeline id + * @return pipeline + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIPELINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPipeline() { + return pipeline; + } + + + @JsonProperty(JSON_PROPERTY_PIPELINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPipeline(String pipeline) { + this.pipeline = pipeline; + } + + + public Pipeline stages(List stages) { + + this.stages = stages; + return this; + } + + public Pipeline addStagesItem(PipelineStage stagesItem) { + if (this.stages == null) { + this.stages = new ArrayList<>(); + } + this.stages.add(stagesItem); + return this; + } + + /** + * List of stages + * @return stages + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getStages() { + return stages; + } + + + @JsonProperty(JSON_PROPERTY_STAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStages(List stages) { + this.stages = stages; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pipeline pipeline = (Pipeline) o; + return Objects.equals(this.pipelineName, pipeline.pipelineName) && + Objects.equals(this.pipeline, pipeline.pipeline) && + Objects.equals(this.stages, pipeline.stages); + } + + @Override + public int hashCode() { + return Objects.hash(pipelineName, pipeline, stages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pipeline {\n"); + sb.append(" pipelineName: ").append(toIndentedString(pipelineName)).append("\n"); + sb.append(" pipeline: ").append(toIndentedString(pipeline)).append("\n"); + sb.append(" stages: ").append(toIndentedString(stages)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pipeline_name` to the URL query string + if (getPipelineName() != null) { + try { + joiner.add(String.format("%spipeline_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPipelineName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `pipeline` to the URL query string + if (getPipeline() != null) { + try { + joiner.add(String.format("%spipeline%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPipeline()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `stages` to the URL query string + if (getStages() != null) { + for (int i = 0; i < getStages().size(); i++) { + if (getStages().get(i) != null) { + joiner.add(getStages().get(i).toUrlQueryString(String.format("%sstages%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PipelineStage.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PipelineStage.java new file mode 100644 index 0000000..27baac0 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PipelineStage.java @@ -0,0 +1,193 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of stages + */ +@JsonPropertyOrder({ + PipelineStage.JSON_PROPERTY_ID, + PipelineStage.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PipelineStage { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public PipelineStage() { + } + + public PipelineStage id(String id) { + + this.id = id; + return this; + } + + /** + * Stage id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public PipelineStage name(String name) { + + this.name = name; + return this; + } + + /** + * Stage name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PipelineStage pipelineStage = (PipelineStage) o; + return Objects.equals(this.id, pipelineStage.id) && + Objects.equals(this.name, pipelineStage.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PipelineStage {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfo.java new file mode 100644 index 0000000..20357f2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfo.java @@ -0,0 +1,148 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.PostContactInfoContacts; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostContactInfo + */ +@JsonPropertyOrder({ + PostContactInfo.JSON_PROPERTY_CONTACTS +}) +@JsonTypeName("postContactInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostContactInfo { + public static final String JSON_PROPERTY_CONTACTS = "contacts"; + private PostContactInfoContacts contacts; + + public PostContactInfo() { + } + + public PostContactInfo contacts(PostContactInfoContacts contacts) { + + this.contacts = contacts; + return this; + } + + /** + * Get contacts + * @return contacts + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public PostContactInfoContacts getContacts() { + return contacts; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContacts(PostContactInfoContacts contacts) { + this.contacts = contacts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostContactInfo postContactInfo = (PostContactInfo) o; + return Objects.equals(this.contacts, postContactInfo.contacts); + } + + @Override + public int hashCode() { + return Objects.hash(contacts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostContactInfo {\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `contacts` to the URL query string + if (getContacts() != null) { + joiner.add(getContacts().toUrlQueryString(prefix + "contacts" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContacts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContacts.java new file mode 100644 index 0000000..2350c71 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContacts.java @@ -0,0 +1,270 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.PostContactInfoContactsFailure; +import software.xdev.brevo.model.PostContactInfoContactsSuccess; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostContactInfoContacts + */ +@JsonPropertyOrder({ + PostContactInfoContacts.JSON_PROPERTY_SUCCESS, + PostContactInfoContacts.JSON_PROPERTY_FAILURE, + PostContactInfoContacts.JSON_PROPERTY_TOTAL, + PostContactInfoContacts.JSON_PROPERTY_PROCESS_ID +}) +@JsonTypeName("postContactInfo_contacts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostContactInfoContacts { + public static final String JSON_PROPERTY_SUCCESS = "success"; + private PostContactInfoContactsSuccess success; + + public static final String JSON_PROPERTY_FAILURE = "failure"; + private PostContactInfoContactsFailure failure; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_PROCESS_ID = "processId"; + private Long processId; + + public PostContactInfoContacts() { + } + + public PostContactInfoContacts success(PostContactInfoContactsSuccess success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PostContactInfoContactsSuccess getSuccess() { + return success; + } + + + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(PostContactInfoContactsSuccess success) { + this.success = success; + } + + + public PostContactInfoContacts failure(PostContactInfoContactsFailure failure) { + + this.failure = failure; + return this; + } + + /** + * Get failure + * @return failure + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PostContactInfoContactsFailure getFailure() { + return failure; + } + + + @JsonProperty(JSON_PROPERTY_FAILURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailure(PostContactInfoContactsFailure failure) { + this.failure = failure; + } + + + public PostContactInfoContacts total(Long total) { + + this.total = total; + return this; + } + + /** + * Displays the count of total number of contacts removed from list when user opts for \"all\" option. + * @return total + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTotal() { + return total; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(Long total) { + this.total = total; + } + + + public PostContactInfoContacts processId(Long processId) { + + this.processId = processId; + return this; + } + + /** + * Id of the process created to remove contacts from list when user opts for \"all\" option. + * @return processId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROCESS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getProcessId() { + return processId; + } + + + @JsonProperty(JSON_PROPERTY_PROCESS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcessId(Long processId) { + this.processId = processId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostContactInfoContacts postContactInfoContacts = (PostContactInfoContacts) o; + return Objects.equals(this.success, postContactInfoContacts.success) && + Objects.equals(this.failure, postContactInfoContacts.failure) && + Objects.equals(this.total, postContactInfoContacts.total) && + Objects.equals(this.processId, postContactInfoContacts.processId); + } + + @Override + public int hashCode() { + return Objects.hash(success, failure, total, processId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostContactInfoContacts {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" failure: ").append(toIndentedString(failure)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" processId: ").append(toIndentedString(processId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `success` to the URL query string + if (getSuccess() != null) { + joiner.add(getSuccess().toUrlQueryString(prefix + "success" + suffix)); + } + + // add `failure` to the URL query string + if (getFailure() != null) { + joiner.add(getFailure().toUrlQueryString(prefix + "failure" + suffix)); + } + + // add `total` to the URL query string + if (getTotal() != null) { + try { + joiner.add(String.format("%stotal%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTotal()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `processId` to the URL query string + if (getProcessId() != null) { + try { + joiner.add(String.format("%sprocessId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProcessId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsFailure.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsFailure.java new file mode 100644 index 0000000..88ca2d8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsFailure.java @@ -0,0 +1,106 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostContactInfoContactsFailure + */ +@JsonPropertyOrder({ +}) +@JsonTypeName("postContactInfo_contacts_failure") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostContactInfoContactsFailure { + public PostContactInfoContactsFailure() { + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostContactInfoContactsFailure {\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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsSuccess.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsSuccess.java new file mode 100644 index 0000000..6175e2a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostContactInfoContactsSuccess.java @@ -0,0 +1,106 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostContactInfoContactsSuccess + */ +@JsonPropertyOrder({ +}) +@JsonTypeName("postContactInfo_contacts_success") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostContactInfoContactsSuccess { + public PostContactInfoContactsSuccess() { + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostContactInfoContactsSuccess {\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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendFailed.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendFailed.java new file mode 100644 index 0000000..be4dac1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendFailed.java @@ -0,0 +1,359 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostSendFailed + */ +@JsonPropertyOrder({ + PostSendFailed.JSON_PROPERTY_CODE, + PostSendFailed.JSON_PROPERTY_MESSAGE, + PostSendFailed.JSON_PROPERTY_UNEXISTING_EMAILS, + PostSendFailed.JSON_PROPERTY_WITHOUT_LIST_EMAILS, + PostSendFailed.JSON_PROPERTY_BLACK_LISTED_EMAILS +}) +@JsonTypeName("postSendFailed") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostSendFailed { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_UNEXISTING_EMAILS = "unexistingEmails"; + private List unexistingEmails; + + public static final String JSON_PROPERTY_WITHOUT_LIST_EMAILS = "withoutListEmails"; + private List withoutListEmails; + + public static final String JSON_PROPERTY_BLACK_LISTED_EMAILS = "blackListedEmails"; + private List blackListedEmails; + + public PostSendFailed() { + } + + public PostSendFailed code(String code) { + + this.code = code; + return this; + } + + /** + * Response code + * @return code + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(String code) { + this.code = code; + } + + + public PostSendFailed message(String message) { + + this.message = message; + return this; + } + + /** + * Response message + * @return message + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + + public PostSendFailed unexistingEmails(List unexistingEmails) { + + this.unexistingEmails = unexistingEmails; + return this; + } + + public PostSendFailed addUnexistingEmailsItem(String unexistingEmailsItem) { + if (this.unexistingEmails == null) { + this.unexistingEmails = new ArrayList<>(); + } + this.unexistingEmails.add(unexistingEmailsItem); + return this; + } + + /** + * Get unexistingEmails + * @return unexistingEmails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNEXISTING_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnexistingEmails() { + return unexistingEmails; + } + + + @JsonProperty(JSON_PROPERTY_UNEXISTING_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnexistingEmails(List unexistingEmails) { + this.unexistingEmails = unexistingEmails; + } + + + public PostSendFailed withoutListEmails(List withoutListEmails) { + + this.withoutListEmails = withoutListEmails; + return this; + } + + public PostSendFailed addWithoutListEmailsItem(String withoutListEmailsItem) { + if (this.withoutListEmails == null) { + this.withoutListEmails = new ArrayList<>(); + } + this.withoutListEmails.add(withoutListEmailsItem); + return this; + } + + /** + * Get withoutListEmails + * @return withoutListEmails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITHOUT_LIST_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWithoutListEmails() { + return withoutListEmails; + } + + + @JsonProperty(JSON_PROPERTY_WITHOUT_LIST_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithoutListEmails(List withoutListEmails) { + this.withoutListEmails = withoutListEmails; + } + + + public PostSendFailed blackListedEmails(List blackListedEmails) { + + this.blackListedEmails = blackListedEmails; + return this; + } + + public PostSendFailed addBlackListedEmailsItem(String blackListedEmailsItem) { + if (this.blackListedEmails == null) { + this.blackListedEmails = new ArrayList<>(); + } + this.blackListedEmails.add(blackListedEmailsItem); + return this; + } + + /** + * Get blackListedEmails + * @return blackListedEmails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BLACK_LISTED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBlackListedEmails() { + return blackListedEmails; + } + + + @JsonProperty(JSON_PROPERTY_BLACK_LISTED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlackListedEmails(List blackListedEmails) { + this.blackListedEmails = blackListedEmails; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostSendFailed postSendFailed = (PostSendFailed) o; + return Objects.equals(this.code, postSendFailed.code) && + Objects.equals(this.message, postSendFailed.message) && + Objects.equals(this.unexistingEmails, postSendFailed.unexistingEmails) && + Objects.equals(this.withoutListEmails, postSendFailed.withoutListEmails) && + Objects.equals(this.blackListedEmails, postSendFailed.blackListedEmails); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, unexistingEmails, withoutListEmails, blackListedEmails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostSendFailed {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" unexistingEmails: ").append(toIndentedString(unexistingEmails)).append("\n"); + sb.append(" withoutListEmails: ").append(toIndentedString(withoutListEmails)).append("\n"); + sb.append(" blackListedEmails: ").append(toIndentedString(blackListedEmails)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + try { + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unexistingEmails` to the URL query string + if (getUnexistingEmails() != null) { + for (int i = 0; i < getUnexistingEmails().size(); i++) { + try { + joiner.add(String.format("%sunexistingEmails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnexistingEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `withoutListEmails` to the URL query string + if (getWithoutListEmails() != null) { + for (int i = 0; i < getWithoutListEmails().size(); i++) { + try { + joiner.add(String.format("%swithoutListEmails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getWithoutListEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `blackListedEmails` to the URL query string + if (getBlackListedEmails() != null) { + for (int i = 0; i < getBlackListedEmails().size(); i++) { + try { + joiner.add(String.format("%sblackListedEmails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getBlackListedEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendSmsTestFailed.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendSmsTestFailed.java new file mode 100644 index 0000000..c099d9e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PostSendSmsTestFailed.java @@ -0,0 +1,305 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PostSendSmsTestFailed + */ +@JsonPropertyOrder({ + PostSendSmsTestFailed.JSON_PROPERTY_CODE, + PostSendSmsTestFailed.JSON_PROPERTY_MESSAGE, + PostSendSmsTestFailed.JSON_PROPERTY_UNEXISTING_SMS, + PostSendSmsTestFailed.JSON_PROPERTY_WITHOUT_LIST_SMS +}) +@JsonTypeName("postSendSmsTestFailed") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PostSendSmsTestFailed { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_UNEXISTING_SMS = "unexistingSms"; + private List unexistingSms; + + public static final String JSON_PROPERTY_WITHOUT_LIST_SMS = "withoutListSms"; + private List withoutListSms; + + public PostSendSmsTestFailed() { + } + + public PostSendSmsTestFailed code(String code) { + + this.code = code; + return this; + } + + /** + * Response code + * @return code + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(String code) { + this.code = code; + } + + + public PostSendSmsTestFailed message(String message) { + + this.message = message; + return this; + } + + /** + * Response message + * @return message + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + + public PostSendSmsTestFailed unexistingSms(List unexistingSms) { + + this.unexistingSms = unexistingSms; + return this; + } + + public PostSendSmsTestFailed addUnexistingSmsItem(String unexistingSmsItem) { + if (this.unexistingSms == null) { + this.unexistingSms = new ArrayList<>(); + } + this.unexistingSms.add(unexistingSmsItem); + return this; + } + + /** + * Get unexistingSms + * @return unexistingSms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNEXISTING_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnexistingSms() { + return unexistingSms; + } + + + @JsonProperty(JSON_PROPERTY_UNEXISTING_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnexistingSms(List unexistingSms) { + this.unexistingSms = unexistingSms; + } + + + public PostSendSmsTestFailed withoutListSms(List withoutListSms) { + + this.withoutListSms = withoutListSms; + return this; + } + + public PostSendSmsTestFailed addWithoutListSmsItem(String withoutListSmsItem) { + if (this.withoutListSms == null) { + this.withoutListSms = new ArrayList<>(); + } + this.withoutListSms.add(withoutListSmsItem); + return this; + } + + /** + * Get withoutListSms + * @return withoutListSms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITHOUT_LIST_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWithoutListSms() { + return withoutListSms; + } + + + @JsonProperty(JSON_PROPERTY_WITHOUT_LIST_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithoutListSms(List withoutListSms) { + this.withoutListSms = withoutListSms; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostSendSmsTestFailed postSendSmsTestFailed = (PostSendSmsTestFailed) o; + return Objects.equals(this.code, postSendSmsTestFailed.code) && + Objects.equals(this.message, postSendSmsTestFailed.message) && + Objects.equals(this.unexistingSms, postSendSmsTestFailed.unexistingSms) && + Objects.equals(this.withoutListSms, postSendSmsTestFailed.withoutListSms); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, unexistingSms, withoutListSms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PostSendSmsTestFailed {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" unexistingSms: ").append(toIndentedString(unexistingSms)).append("\n"); + sb.append(" withoutListSms: ").append(toIndentedString(withoutListSms)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + try { + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `message` to the URL query string + if (getMessage() != null) { + try { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unexistingSms` to the URL query string + if (getUnexistingSms() != null) { + for (int i = 0; i < getUnexistingSms().size(); i++) { + try { + joiner.add(String.format("%sunexistingSms%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnexistingSms().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `withoutListSms` to the URL query string + if (getWithoutListSms() != null) { + for (int i = 0; i < getWithoutListSms().size(); i++) { + try { + joiner.add(String.format("%swithoutListSms%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getWithoutListSms().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermission.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermission.java new file mode 100644 index 0000000..f3f3254 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermission.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Revoke user permission + */ +@JsonPropertyOrder({ + PutRevokeUserPermission.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("putRevokeUserPermission") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PutRevokeUserPermission { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public PutRevokeUserPermission() { + } + + public PutRevokeUserPermission email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PutRevokeUserPermission putRevokeUserPermission = (PutRevokeUserPermission) o; + return Objects.equals(this.email, putRevokeUserPermission.email); + } + + @Override + public int hashCode() { + return Objects.hash(email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PutRevokeUserPermission {\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermissionResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermissionResponse.java new file mode 100644 index 0000000..47f4841 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutRevokeUserPermissionResponse.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PutRevokeUserPermissionResponse + */ +@JsonPropertyOrder({ + PutRevokeUserPermissionResponse.JSON_PROPERTY_STATUS, + PutRevokeUserPermissionResponse.JSON_PROPERTY_CREDIT_NOTES +}) +@JsonTypeName("putRevokeUserPermissionResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PutRevokeUserPermissionResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_CREDIT_NOTES = "credit_notes"; + private List creditNotes; + + public PutRevokeUserPermissionResponse() { + } + + public PutRevokeUserPermissionResponse status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the API operation. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public PutRevokeUserPermissionResponse creditNotes(List creditNotes) { + + this.creditNotes = creditNotes; + return this; + } + + public PutRevokeUserPermissionResponse addCreditNotesItem(String creditNotesItem) { + if (this.creditNotes == null) { + this.creditNotes = new ArrayList<>(); + } + this.creditNotes.add(creditNotesItem); + return this; + } + + /** + * Credit note + * @return creditNotes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCreditNotes() { + return creditNotes; + } + + + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreditNotes(List creditNotes) { + this.creditNotes = creditNotes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PutRevokeUserPermissionResponse putRevokeUserPermissionResponse = (PutRevokeUserPermissionResponse) o; + return Objects.equals(this.status, putRevokeUserPermissionResponse.status) && + Objects.equals(this.creditNotes, putRevokeUserPermissionResponse.creditNotes); + } + + @Override + public int hashCode() { + return Objects.hash(status, creditNotes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PutRevokeUserPermissionResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creditNotes: ").append(toIndentedString(creditNotes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credit_notes` to the URL query string + if (getCreditNotes() != null) { + for (int i = 0; i < getCreditNotes().size(); i++) { + try { + joiner.add(String.format("%scredit_notes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCreditNotes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Putresendcancelinvitation.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Putresendcancelinvitation.java new file mode 100644 index 0000000..b9d100c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Putresendcancelinvitation.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Revoke user permission + */ +@JsonPropertyOrder({ + Putresendcancelinvitation.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("putresendcancelinvitation") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Putresendcancelinvitation { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public Putresendcancelinvitation() { + } + + public Putresendcancelinvitation email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user. + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Putresendcancelinvitation putresendcancelinvitation = (Putresendcancelinvitation) o; + return Objects.equals(this.email, putresendcancelinvitation.email); + } + + @Override + public int hashCode() { + return Objects.hash(email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Putresendcancelinvitation {\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutresendcancelinvitationResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutresendcancelinvitationResponse.java new file mode 100644 index 0000000..7c6d43c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/PutresendcancelinvitationResponse.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * PutresendcancelinvitationResponse + */ +@JsonPropertyOrder({ + PutresendcancelinvitationResponse.JSON_PROPERTY_STATUS, + PutresendcancelinvitationResponse.JSON_PROPERTY_CREDIT_NOTES +}) +@JsonTypeName("putresendcancelinvitationResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PutresendcancelinvitationResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_CREDIT_NOTES = "credit_notes"; + private List creditNotes; + + public PutresendcancelinvitationResponse() { + } + + public PutresendcancelinvitationResponse status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the API operation. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public PutresendcancelinvitationResponse creditNotes(List creditNotes) { + + this.creditNotes = creditNotes; + return this; + } + + public PutresendcancelinvitationResponse addCreditNotesItem(String creditNotesItem) { + if (this.creditNotes == null) { + this.creditNotes = new ArrayList<>(); + } + this.creditNotes.add(creditNotesItem); + return this; + } + + /** + * Credit note + * @return creditNotes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCreditNotes() { + return creditNotes; + } + + + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreditNotes(List creditNotes) { + this.creditNotes = creditNotes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PutresendcancelinvitationResponse putresendcancelinvitationResponse = (PutresendcancelinvitationResponse) o; + return Objects.equals(this.status, putresendcancelinvitationResponse.status) && + Objects.equals(this.creditNotes, putresendcancelinvitationResponse.creditNotes); + } + + @Override + public int hashCode() { + return Objects.hash(status, creditNotes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PutresendcancelinvitationResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creditNotes: ").append(toIndentedString(creditNotes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credit_notes` to the URL query string + if (getCreditNotes() != null) { + for (int i = 0; i < getCreditNotes().size(); i++) { + try { + joiner.add(String.format("%scredit_notes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCreditNotes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModel.java new file mode 100644 index 0000000..e83f718 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModel.java @@ -0,0 +1,186 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.RemainingCreditModelChild; +import software.xdev.brevo.model.RemainingCreditModelReseller; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemainingCreditModel + */ +@JsonPropertyOrder({ + RemainingCreditModel.JSON_PROPERTY_CHILD, + RemainingCreditModel.JSON_PROPERTY_RESELLER +}) +@JsonTypeName("remainingCreditModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemainingCreditModel { + public static final String JSON_PROPERTY_CHILD = "child"; + private RemainingCreditModelChild child; + + public static final String JSON_PROPERTY_RESELLER = "reseller"; + private RemainingCreditModelReseller reseller; + + public RemainingCreditModel() { + } + + public RemainingCreditModel child(RemainingCreditModelChild child) { + + this.child = child; + return this; + } + + /** + * Get child + * @return child + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CHILD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RemainingCreditModelChild getChild() { + return child; + } + + + @JsonProperty(JSON_PROPERTY_CHILD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setChild(RemainingCreditModelChild child) { + this.child = child; + } + + + public RemainingCreditModel reseller(RemainingCreditModelReseller reseller) { + + this.reseller = reseller; + return this; + } + + /** + * Get reseller + * @return reseller + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RESELLER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RemainingCreditModelReseller getReseller() { + return reseller; + } + + + @JsonProperty(JSON_PROPERTY_RESELLER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReseller(RemainingCreditModelReseller reseller) { + this.reseller = reseller; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemainingCreditModel remainingCreditModel = (RemainingCreditModel) o; + return Objects.equals(this.child, remainingCreditModel.child) && + Objects.equals(this.reseller, remainingCreditModel.reseller); + } + + @Override + public int hashCode() { + return Objects.hash(child, reseller); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemainingCreditModel {\n"); + sb.append(" child: ").append(toIndentedString(child)).append("\n"); + sb.append(" reseller: ").append(toIndentedString(reseller)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `child` to the URL query string + if (getChild() != null) { + joiner.add(getChild().toUrlQueryString(prefix + "child" + suffix)); + } + + // add `reseller` to the URL query string + if (getReseller() != null) { + joiner.add(getReseller().toUrlQueryString(prefix + "reseller" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelChild.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelChild.java new file mode 100644 index 0000000..54125f3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelChild.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Credits remaining for child account + */ +@JsonPropertyOrder({ + RemainingCreditModelChild.JSON_PROPERTY_SMS, + RemainingCreditModelChild.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("remainingCreditModel_child") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemainingCreditModelChild { + public static final String JSON_PROPERTY_SMS = "sms"; + private Double sms; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private Double email; + + public RemainingCreditModelChild() { + } + + public RemainingCreditModelChild sms(Double sms) { + + this.sms = sms; + return this; + } + + /** + * SMS Credits remaining for child account + * @return sms + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSms(Double sms) { + this.sms = sms; + } + + + public RemainingCreditModelChild email(Double email) { + + this.email = email; + return this; + } + + /** + * Email Credits remaining for child account + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(Double email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemainingCreditModelChild remainingCreditModelChild = (RemainingCreditModelChild) o; + return Objects.equals(this.sms, remainingCreditModelChild.sms) && + Objects.equals(this.email, remainingCreditModelChild.email); + } + + @Override + public int hashCode() { + return Objects.hash(sms, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemainingCreditModelChild {\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelReseller.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelReseller.java new file mode 100644 index 0000000..b0a1ced --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemainingCreditModelReseller.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemainingCreditModelReseller + */ +@JsonPropertyOrder({ + RemainingCreditModelReseller.JSON_PROPERTY_SMS, + RemainingCreditModelReseller.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("remainingCreditModel_reseller") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemainingCreditModelReseller { + public static final String JSON_PROPERTY_SMS = "sms"; + private Double sms; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private Double email; + + public RemainingCreditModelReseller() { + } + + public RemainingCreditModelReseller sms(Double sms) { + + this.sms = sms; + return this; + } + + /** + * SMS Credits remaining for reseller account + * @return sms + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSms(Double sms) { + this.sms = sms; + } + + + public RemainingCreditModelReseller email(Double email) { + + this.email = email; + return this; + } + + /** + * Email Credits remaining for reseller account + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(Double email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemainingCreditModelReseller remainingCreditModelReseller = (RemainingCreditModelReseller) o; + return Objects.equals(this.sms, remainingCreditModelReseller.sms) && + Objects.equals(this.email, remainingCreditModelReseller.email); + } + + @Override + public int hashCode() { + return Objects.hash(sms, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemainingCreditModelReseller {\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByAll.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByAll.java new file mode 100644 index 0000000..68d216a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByAll.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemoveContactFromListByAll + */ +@JsonPropertyOrder({ + RemoveContactFromListByAll.JSON_PROPERTY_ALL +}) +@JsonTypeName("removeContactFromListByAll") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveContactFromListByAll { + public static final String JSON_PROPERTY_ALL = "all"; + private Boolean all; + + public RemoveContactFromListByAll() { + } + + public RemoveContactFromListByAll all(Boolean all) { + + this.all = all; + return this; + } + + /** + * **Required if 'emails' and 'ids' are empty.** Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress + * @return all + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAll() { + return all; + } + + + @JsonProperty(JSON_PROPERTY_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAll(Boolean all) { + this.all = all; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveContactFromListByAll removeContactFromListByAll = (RemoveContactFromListByAll) o; + return Objects.equals(this.all, removeContactFromListByAll.all); + } + + @Override + public int hashCode() { + return Objects.hash(all); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveContactFromListByAll {\n"); + sb.append(" all: ").append(toIndentedString(all)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `all` to the URL query string + if (getAll() != null) { + try { + joiner.add(String.format("%sall%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAll()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByEmails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByEmails.java new file mode 100644 index 0000000..df62852 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByEmails.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemoveContactFromListByEmails + */ +@JsonPropertyOrder({ + RemoveContactFromListByEmails.JSON_PROPERTY_EMAILS +}) +@JsonTypeName("removeContactFromListByEmails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveContactFromListByEmails { + public static final String JSON_PROPERTY_EMAILS = "emails"; + private List emails; + + public RemoveContactFromListByEmails() { + } + + public RemoveContactFromListByEmails emails(List emails) { + + this.emails = emails; + return this; + } + + public RemoveContactFromListByEmails addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * **Required if 'all' is false and 'ids' is empty.** Emails to remove from a list. You can pass a **maximum of 150 emails** for removal in one request. + * @return emails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEmails() { + return emails; + } + + + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmails(List emails) { + this.emails = emails; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveContactFromListByEmails removeContactFromListByEmails = (RemoveContactFromListByEmails) o; + return Objects.equals(this.emails, removeContactFromListByEmails.emails); + } + + @Override + public int hashCode() { + return Objects.hash(emails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveContactFromListByEmails {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emails` to the URL query string + if (getEmails() != null) { + for (int i = 0; i < getEmails().size(); i++) { + try { + joiner.add(String.format("%semails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByIDs.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByIDs.java new file mode 100644 index 0000000..2c505b0 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListByIDs.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemoveContactFromListByIDs + */ +@JsonPropertyOrder({ + RemoveContactFromListByIDs.JSON_PROPERTY_IDS +}) +@JsonTypeName("removeContactFromListByIDs") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveContactFromListByIDs { + public static final String JSON_PROPERTY_IDS = "ids"; + private List ids; + + public RemoveContactFromListByIDs() { + } + + public RemoveContactFromListByIDs ids(List ids) { + + this.ids = ids; + return this; + } + + public RemoveContactFromListByIDs addIdsItem(Long idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * **Required if 'all' is false and 'emails' is empty.** IDs to remove from a list. You can pass a **maximum of 150 IDs** for removal in one request. + * @return ids + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIds() { + return ids; + } + + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(List ids) { + this.ids = ids; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveContactFromListByIDs removeContactFromListByIDs = (RemoveContactFromListByIDs) o; + return Objects.equals(this.ids, removeContactFromListByIDs.ids); + } + + @Override + public int hashCode() { + return Objects.hash(ids); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveContactFromListByIDs {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + try { + joiner.add(String.format("%sids%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListRequest.java new file mode 100644 index 0000000..7ef599a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveContactFromListRequest.java @@ -0,0 +1,266 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.RemoveContactFromListByAll; +import software.xdev.brevo.model.RemoveContactFromListByEmails; +import software.xdev.brevo.model.RemoveContactFromListByIDs; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemoveContactFromListRequest + */ +@JsonPropertyOrder({ + RemoveContactFromListRequest.JSON_PROPERTY_EMAILS, + RemoveContactFromListRequest.JSON_PROPERTY_IDS, + RemoveContactFromListRequest.JSON_PROPERTY_ALL +}) +@JsonTypeName("removeContactFromList_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveContactFromListRequest { + public static final String JSON_PROPERTY_EMAILS = "emails"; + private List emails; + + public static final String JSON_PROPERTY_IDS = "ids"; + private List ids; + + public static final String JSON_PROPERTY_ALL = "all"; + private Boolean all; + + public RemoveContactFromListRequest() { + } + + public RemoveContactFromListRequest emails(List emails) { + + this.emails = emails; + return this; + } + + public RemoveContactFromListRequest addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * **Required if 'all' is false and 'ids' is empty.** Emails to remove from a list. You can pass a **maximum of 150 emails** for removal in one request. + * @return emails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEmails() { + return emails; + } + + + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmails(List emails) { + this.emails = emails; + } + + + public RemoveContactFromListRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public RemoveContactFromListRequest addIdsItem(Long idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * **Required if 'all' is false and 'emails' is empty.** IDs to remove from a list. You can pass a **maximum of 150 IDs** for removal in one request. + * @return ids + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIds() { + return ids; + } + + + @JsonProperty(JSON_PROPERTY_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIds(List ids) { + this.ids = ids; + } + + + public RemoveContactFromListRequest all(Boolean all) { + + this.all = all; + return this; + } + + /** + * **Required if 'emails' and 'ids' are empty.** Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress + * @return all + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAll() { + return all; + } + + + @JsonProperty(JSON_PROPERTY_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAll(Boolean all) { + this.all = all; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveContactFromListRequest removeContactFromListRequest = (RemoveContactFromListRequest) o; + return Objects.equals(this.emails, removeContactFromListRequest.emails) && + Objects.equals(this.ids, removeContactFromListRequest.ids) && + Objects.equals(this.all, removeContactFromListRequest.all); + } + + @Override + public int hashCode() { + return Objects.hash(emails, ids, all); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveContactFromListRequest {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" all: ").append(toIndentedString(all)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emails` to the URL query string + if (getEmails() != null) { + for (int i = 0; i < getEmails().size(); i++) { + try { + joiner.add(String.format("%semails%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEmails().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `ids` to the URL query string + if (getIds() != null) { + for (int i = 0; i < getIds().size(); i++) { + try { + joiner.add(String.format("%sids%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `all` to the URL query string + if (getAll() != null) { + try { + joiner.add(String.format("%sall%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAll()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveCredits.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveCredits.java new file mode 100644 index 0000000..02e5dcf --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RemoveCredits.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RemoveCredits + */ +@JsonPropertyOrder({ + RemoveCredits.JSON_PROPERTY_SMS, + RemoveCredits.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("removeCredits") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveCredits { + public static final String JSON_PROPERTY_SMS = "sms"; + private Long sms; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private Long email; + + public RemoveCredits() { + } + + public RemoveCredits sms(Long sms) { + + this.sms = sms; + return this; + } + + /** + * **Required if email credits are empty.** SMS credits to be removed from the child account + * @return sms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSms(Long sms) { + this.sms = sms; + } + + + public RemoveCredits email(Long email) { + + this.email = email; + return this; + } + + /** + * **Required if sms credits are empty.** Email credits to be removed from the child account + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(Long email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveCredits removeCredits = (RemoveCredits) o; + return Objects.equals(this.sms, removeCredits.sms) && + Objects.equals(this.email, removeCredits.email); + } + + @Override + public int hashCode() { + return Objects.hash(sms, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveCredits {\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExport.java new file mode 100644 index 0000000..0a4b5f3 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExport.java @@ -0,0 +1,247 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.RequestContactExportCustomContactFilter; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RequestContactExport + */ +@JsonPropertyOrder({ + RequestContactExport.JSON_PROPERTY_EXPORT_ATTRIBUTES, + RequestContactExport.JSON_PROPERTY_CUSTOM_CONTACT_FILTER, + RequestContactExport.JSON_PROPERTY_NOTIFY_URL +}) +@JsonTypeName("requestContactExport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestContactExport { + public static final String JSON_PROPERTY_EXPORT_ATTRIBUTES = "exportAttributes"; + private List exportAttributes; + + public static final String JSON_PROPERTY_CUSTOM_CONTACT_FILTER = "customContactFilter"; + private RequestContactExportCustomContactFilter customContactFilter; + + public static final String JSON_PROPERTY_NOTIFY_URL = "notifyUrl"; + private String notifyUrl; + + public RequestContactExport() { + } + + public RequestContactExport exportAttributes(List exportAttributes) { + + this.exportAttributes = exportAttributes; + return this; + } + + public RequestContactExport addExportAttributesItem(String exportAttributesItem) { + if (this.exportAttributes == null) { + this.exportAttributes = new ArrayList<>(); + } + this.exportAttributes.add(exportAttributesItem); + return this; + } + + /** + * List of all the attributes that you want to export. **These attributes must be present in your contact database.** For example: **['fname', 'lname', 'email']** + * @return exportAttributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPORT_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExportAttributes() { + return exportAttributes; + } + + + @JsonProperty(JSON_PROPERTY_EXPORT_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExportAttributes(List exportAttributes) { + this.exportAttributes = exportAttributes; + } + + + public RequestContactExport customContactFilter(RequestContactExportCustomContactFilter customContactFilter) { + + this.customContactFilter = customContactFilter; + return this; + } + + /** + * Get customContactFilter + * @return customContactFilter + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CUSTOM_CONTACT_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RequestContactExportCustomContactFilter getCustomContactFilter() { + return customContactFilter; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_CONTACT_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCustomContactFilter(RequestContactExportCustomContactFilter customContactFilter) { + this.customContactFilter = customContactFilter; + } + + + public RequestContactExport notifyUrl(String notifyUrl) { + + this.notifyUrl = notifyUrl; + return this; + } + + /** + * Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + * @return notifyUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotifyUrl() { + return notifyUrl; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestContactExport requestContactExport = (RequestContactExport) o; + return Objects.equals(this.exportAttributes, requestContactExport.exportAttributes) && + Objects.equals(this.customContactFilter, requestContactExport.customContactFilter) && + Objects.equals(this.notifyUrl, requestContactExport.notifyUrl); + } + + @Override + public int hashCode() { + return Objects.hash(exportAttributes, customContactFilter, notifyUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestContactExport {\n"); + sb.append(" exportAttributes: ").append(toIndentedString(exportAttributes)).append("\n"); + sb.append(" customContactFilter: ").append(toIndentedString(customContactFilter)).append("\n"); + sb.append(" notifyUrl: ").append(toIndentedString(notifyUrl)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `exportAttributes` to the URL query string + if (getExportAttributes() != null) { + for (int i = 0; i < getExportAttributes().size(); i++) { + try { + joiner.add(String.format("%sexportAttributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExportAttributes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `customContactFilter` to the URL query string + if (getCustomContactFilter() != null) { + joiner.add(getCustomContactFilter().toUrlQueryString(prefix + "customContactFilter" + suffix)); + } + + // add `notifyUrl` to the URL query string + if (getNotifyUrl() != null) { + try { + joiner.add(String.format("%snotifyUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExportCustomContactFilter.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExportCustomContactFilter.java new file mode 100644 index 0000000..d2b5a64 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactExportCustomContactFilter.java @@ -0,0 +1,483 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Set the filter for the contacts to be exported. + */ +@JsonPropertyOrder({ + RequestContactExportCustomContactFilter.JSON_PROPERTY_ACTION_FOR_CONTACTS, + RequestContactExportCustomContactFilter.JSON_PROPERTY_ACTION_FOR_EMAIL_CAMPAIGNS, + RequestContactExportCustomContactFilter.JSON_PROPERTY_ACTION_FOR_SMS_CAMPAIGNS, + RequestContactExportCustomContactFilter.JSON_PROPERTY_LIST_ID, + RequestContactExportCustomContactFilter.JSON_PROPERTY_EMAIL_CAMPAIGN_ID, + RequestContactExportCustomContactFilter.JSON_PROPERTY_SMS_CAMPAIGN_ID +}) +@JsonTypeName("requestContactExport_customContactFilter") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestContactExportCustomContactFilter { + /** + * **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. + */ + public enum ActionForContactsEnum { + ALLCONTACTS("allContacts"), + + SUBSCRIBED("subscribed"), + + UNSUBSCRIBED("unsubscribed"), + + UNSUBSCRIBEDPERLIST("unsubscribedPerList"); + + private String value; + + ActionForContactsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ActionForContactsEnum fromValue(String value) { + for (ActionForContactsEnum b : ActionForContactsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ACTION_FOR_CONTACTS = "actionForContacts"; + private ActionForContactsEnum actionForContacts; + + /** + * **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). + */ + public enum ActionForEmailCampaignsEnum { + OPENERS("openers"), + + NONOPENERS("nonOpeners"), + + CLICKERS("clickers"), + + NONCLICKERS("nonClickers"), + + UNSUBSCRIBED("unsubscribed"), + + HARDBOUNCES("hardBounces"), + + SOFTBOUNCES("softBounces"); + + private String value; + + ActionForEmailCampaignsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ActionForEmailCampaignsEnum fromValue(String value) { + for (ActionForEmailCampaignsEnum b : ActionForEmailCampaignsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ACTION_FOR_EMAIL_CAMPAIGNS = "actionForEmailCampaigns"; + private ActionForEmailCampaignsEnum actionForEmailCampaigns; + + /** + * **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. + */ + public enum ActionForSmsCampaignsEnum { + HARDBOUNCES("hardBounces"), + + SOFTBOUNCES("softBounces"), + + UNSUBSCRIBED("unsubscribed"); + + private String value; + + ActionForSmsCampaignsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ActionForSmsCampaignsEnum fromValue(String value) { + for (ActionForSmsCampaignsEnum b : ActionForSmsCampaignsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ACTION_FOR_SMS_CAMPAIGNS = "actionForSmsCampaigns"; + private ActionForSmsCampaignsEnum actionForSmsCampaigns; + + public static final String JSON_PROPERTY_LIST_ID = "listId"; + private Long listId; + + public static final String JSON_PROPERTY_EMAIL_CAMPAIGN_ID = "emailCampaignId"; + private Long emailCampaignId; + + public static final String JSON_PROPERTY_SMS_CAMPAIGN_ID = "smsCampaignId"; + private Long smsCampaignId; + + public RequestContactExportCustomContactFilter() { + } + + public RequestContactExportCustomContactFilter actionForContacts(ActionForContactsEnum actionForContacts) { + + this.actionForContacts = actionForContacts; + return this; + } + + /** + * **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. + * @return actionForContacts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION_FOR_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ActionForContactsEnum getActionForContacts() { + return actionForContacts; + } + + + @JsonProperty(JSON_PROPERTY_ACTION_FOR_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActionForContacts(ActionForContactsEnum actionForContacts) { + this.actionForContacts = actionForContacts; + } + + + public RequestContactExportCustomContactFilter actionForEmailCampaigns(ActionForEmailCampaignsEnum actionForEmailCampaigns) { + + this.actionForEmailCampaigns = actionForEmailCampaigns; + return this; + } + + /** + * **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). + * @return actionForEmailCampaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION_FOR_EMAIL_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ActionForEmailCampaignsEnum getActionForEmailCampaigns() { + return actionForEmailCampaigns; + } + + + @JsonProperty(JSON_PROPERTY_ACTION_FOR_EMAIL_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActionForEmailCampaigns(ActionForEmailCampaignsEnum actionForEmailCampaigns) { + this.actionForEmailCampaigns = actionForEmailCampaigns; + } + + + public RequestContactExportCustomContactFilter actionForSmsCampaigns(ActionForSmsCampaignsEnum actionForSmsCampaigns) { + + this.actionForSmsCampaigns = actionForSmsCampaigns; + return this; + } + + /** + * **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. + * @return actionForSmsCampaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION_FOR_SMS_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ActionForSmsCampaignsEnum getActionForSmsCampaigns() { + return actionForSmsCampaigns; + } + + + @JsonProperty(JSON_PROPERTY_ACTION_FOR_SMS_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActionForSmsCampaigns(ActionForSmsCampaignsEnum actionForSmsCampaigns) { + this.actionForSmsCampaigns = actionForSmsCampaigns; + } + + + public RequestContactExportCustomContactFilter listId(Long listId) { + + this.listId = listId; + return this; + } + + /** + * **Mandatory if actionForContacts is passed, ignored otherwise.** Id of the list for which the corresponding action shall be applied in the filter. + * @return listId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getListId() { + return listId; + } + + + @JsonProperty(JSON_PROPERTY_LIST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListId(Long listId) { + this.listId = listId; + } + + + public RequestContactExportCustomContactFilter emailCampaignId(Long emailCampaignId) { + + this.emailCampaignId = emailCampaignId; + return this; + } + + /** + * Considered only if **actionForEmailCampaigns** is passed, ignored otherwise. **Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed.** The id of the email campaign for which the corresponding action shall be applied in the filter. + * @return emailCampaignId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEmailCampaignId() { + return emailCampaignId; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailCampaignId(Long emailCampaignId) { + this.emailCampaignId = emailCampaignId; + } + + + public RequestContactExportCustomContactFilter smsCampaignId(Long smsCampaignId) { + + this.smsCampaignId = smsCampaignId; + return this; + } + + /** + * Considered only if **actionForSmsCampaigns** is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. + * @return smsCampaignId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSmsCampaignId() { + return smsCampaignId; + } + + + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsCampaignId(Long smsCampaignId) { + this.smsCampaignId = smsCampaignId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestContactExportCustomContactFilter requestContactExportCustomContactFilter = (RequestContactExportCustomContactFilter) o; + return Objects.equals(this.actionForContacts, requestContactExportCustomContactFilter.actionForContacts) && + Objects.equals(this.actionForEmailCampaigns, requestContactExportCustomContactFilter.actionForEmailCampaigns) && + Objects.equals(this.actionForSmsCampaigns, requestContactExportCustomContactFilter.actionForSmsCampaigns) && + Objects.equals(this.listId, requestContactExportCustomContactFilter.listId) && + Objects.equals(this.emailCampaignId, requestContactExportCustomContactFilter.emailCampaignId) && + Objects.equals(this.smsCampaignId, requestContactExportCustomContactFilter.smsCampaignId); + } + + @Override + public int hashCode() { + return Objects.hash(actionForContacts, actionForEmailCampaigns, actionForSmsCampaigns, listId, emailCampaignId, smsCampaignId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestContactExportCustomContactFilter {\n"); + sb.append(" actionForContacts: ").append(toIndentedString(actionForContacts)).append("\n"); + sb.append(" actionForEmailCampaigns: ").append(toIndentedString(actionForEmailCampaigns)).append("\n"); + sb.append(" actionForSmsCampaigns: ").append(toIndentedString(actionForSmsCampaigns)).append("\n"); + sb.append(" listId: ").append(toIndentedString(listId)).append("\n"); + sb.append(" emailCampaignId: ").append(toIndentedString(emailCampaignId)).append("\n"); + sb.append(" smsCampaignId: ").append(toIndentedString(smsCampaignId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `actionForContacts` to the URL query string + if (getActionForContacts() != null) { + try { + joiner.add(String.format("%sactionForContacts%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActionForContacts()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `actionForEmailCampaigns` to the URL query string + if (getActionForEmailCampaigns() != null) { + try { + joiner.add(String.format("%sactionForEmailCampaigns%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActionForEmailCampaigns()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `actionForSmsCampaigns` to the URL query string + if (getActionForSmsCampaigns() != null) { + try { + joiner.add(String.format("%sactionForSmsCampaigns%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActionForSmsCampaigns()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listId` to the URL query string + if (getListId() != null) { + try { + joiner.add(String.format("%slistId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getListId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emailCampaignId` to the URL query string + if (getEmailCampaignId() != null) { + try { + joiner.add(String.format("%semailCampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsCampaignId` to the URL query string + if (getSmsCampaignId() != null) { + try { + joiner.add(String.format("%ssmsCampaignId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsCampaignId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImport.java new file mode 100644 index 0000000..dad41fa --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImport.java @@ -0,0 +1,592 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.RequestContactImportJsonBodyInner; +import software.xdev.brevo.model.RequestContactImportNewList; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RequestContactImport + */ +@JsonPropertyOrder({ + RequestContactImport.JSON_PROPERTY_FILE_URL, + RequestContactImport.JSON_PROPERTY_FILE_BODY, + RequestContactImport.JSON_PROPERTY_JSON_BODY, + RequestContactImport.JSON_PROPERTY_LIST_IDS, + RequestContactImport.JSON_PROPERTY_NOTIFY_URL, + RequestContactImport.JSON_PROPERTY_NEW_LIST, + RequestContactImport.JSON_PROPERTY_EMAIL_BLACKLIST, + RequestContactImport.JSON_PROPERTY_DISABLE_NOTIFICATION, + RequestContactImport.JSON_PROPERTY_SMS_BLACKLIST, + RequestContactImport.JSON_PROPERTY_UPDATE_EXISTING_CONTACTS, + RequestContactImport.JSON_PROPERTY_EMPTY_CONTACTS_ATTRIBUTES +}) +@JsonTypeName("requestContactImport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestContactImport { + public static final String JSON_PROPERTY_FILE_URL = "fileUrl"; + private String fileUrl; + + public static final String JSON_PROPERTY_FILE_BODY = "fileBody"; + private String fileBody; + + public static final String JSON_PROPERTY_JSON_BODY = "jsonBody"; + private List jsonBody; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_NOTIFY_URL = "notifyUrl"; + private String notifyUrl; + + public static final String JSON_PROPERTY_NEW_LIST = "newList"; + private RequestContactImportNewList newList; + + public static final String JSON_PROPERTY_EMAIL_BLACKLIST = "emailBlacklist"; + private Boolean emailBlacklist = false; + + public static final String JSON_PROPERTY_DISABLE_NOTIFICATION = "disableNotification"; + private Boolean disableNotification = false; + + public static final String JSON_PROPERTY_SMS_BLACKLIST = "smsBlacklist"; + private Boolean smsBlacklist = false; + + public static final String JSON_PROPERTY_UPDATE_EXISTING_CONTACTS = "updateExistingContacts"; + private Boolean updateExistingContacts = true; + + public static final String JSON_PROPERTY_EMPTY_CONTACTS_ATTRIBUTES = "emptyContactsAttributes"; + private Boolean emptyContactsAttributes = false; + + public RequestContactImport() { + } + + public RequestContactImport fileUrl(String fileUrl) { + + this.fileUrl = fileUrl; + return this; + } + + /** + * **Mandatory if fileBody and jsonBody is not defined.** URL of the file to be imported (**no local file**). Possible file formats: #### .txt, .csv, .json + * @return fileUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileUrl() { + return fileUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + + public RequestContactImport fileBody(String fileBody) { + + this.fileBody = fileBody; + return this; + } + + /** + * **Mandatory if fileUrl and jsonBody is not defined.** CSV content to be imported. Use semicolon to separate multiple attributes. **Maximum allowed file body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. + * @return fileBody + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileBody() { + return fileBody; + } + + + @JsonProperty(JSON_PROPERTY_FILE_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileBody(String fileBody) { + this.fileBody = fileBody; + } + + + public RequestContactImport jsonBody(List jsonBody) { + + this.jsonBody = jsonBody; + return this; + } + + public RequestContactImport addJsonBodyItem(RequestContactImportJsonBodyInner jsonBodyItem) { + if (this.jsonBody == null) { + this.jsonBody = new ArrayList<>(); + } + this.jsonBody.add(jsonBodyItem); + return this; + } + + /** + * **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. + * @return jsonBody + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JSON_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getJsonBody() { + return jsonBody; + } + + + @JsonProperty(JSON_PROPERTY_JSON_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJsonBody(List jsonBody) { + this.jsonBody = jsonBody; + } + + + public RequestContactImport listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public RequestContactImport addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * **Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**. + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public RequestContactImport notifyUrl(String notifyUrl) { + + this.notifyUrl = notifyUrl; + return this; + } + + /** + * URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + * @return notifyUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotifyUrl() { + return notifyUrl; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; + } + + + public RequestContactImport newList(RequestContactImportNewList newList) { + + this.newList = newList; + return this; + } + + /** + * Get newList + * @return newList + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public RequestContactImportNewList getNewList() { + return newList; + } + + + @JsonProperty(JSON_PROPERTY_NEW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewList(RequestContactImportNewList newList) { + this.newList = newList; + } + + + public RequestContactImport emailBlacklist(Boolean emailBlacklist) { + + this.emailBlacklist = emailBlacklist; + return this; + } + + /** + * To blacklist all the contacts for email + * @return emailBlacklist + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmailBlacklist() { + return emailBlacklist; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailBlacklist(Boolean emailBlacklist) { + this.emailBlacklist = emailBlacklist; + } + + + public RequestContactImport disableNotification(Boolean disableNotification) { + + this.disableNotification = disableNotification; + return this; + } + + /** + * To disable email notification + * @return disableNotification + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLE_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableNotification() { + return disableNotification; + } + + + @JsonProperty(JSON_PROPERTY_DISABLE_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableNotification(Boolean disableNotification) { + this.disableNotification = disableNotification; + } + + + public RequestContactImport smsBlacklist(Boolean smsBlacklist) { + + this.smsBlacklist = smsBlacklist; + return this; + } + + /** + * To blacklist all the contacts for sms + * @return smsBlacklist + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsBlacklist() { + return smsBlacklist; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsBlacklist(Boolean smsBlacklist) { + this.smsBlacklist = smsBlacklist; + } + + + public RequestContactImport updateExistingContacts(Boolean updateExistingContacts) { + + this.updateExistingContacts = updateExistingContacts; + return this; + } + + /** + * To facilitate the choice to update the existing contacts + * @return updateExistingContacts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_EXISTING_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpdateExistingContacts() { + return updateExistingContacts; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_EXISTING_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateExistingContacts(Boolean updateExistingContacts) { + this.updateExistingContacts = updateExistingContacts; + } + + + public RequestContactImport emptyContactsAttributes(Boolean emptyContactsAttributes) { + + this.emptyContactsAttributes = emptyContactsAttributes; + return this; + } + + /** + * To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( **only available if `updateExistingContacts` set to true **) + * @return emptyContactsAttributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMPTY_CONTACTS_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmptyContactsAttributes() { + return emptyContactsAttributes; + } + + + @JsonProperty(JSON_PROPERTY_EMPTY_CONTACTS_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmptyContactsAttributes(Boolean emptyContactsAttributes) { + this.emptyContactsAttributes = emptyContactsAttributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestContactImport requestContactImport = (RequestContactImport) o; + return Objects.equals(this.fileUrl, requestContactImport.fileUrl) && + Objects.equals(this.fileBody, requestContactImport.fileBody) && + Objects.equals(this.jsonBody, requestContactImport.jsonBody) && + Objects.equals(this.listIds, requestContactImport.listIds) && + Objects.equals(this.notifyUrl, requestContactImport.notifyUrl) && + Objects.equals(this.newList, requestContactImport.newList) && + Objects.equals(this.emailBlacklist, requestContactImport.emailBlacklist) && + Objects.equals(this.disableNotification, requestContactImport.disableNotification) && + Objects.equals(this.smsBlacklist, requestContactImport.smsBlacklist) && + Objects.equals(this.updateExistingContacts, requestContactImport.updateExistingContacts) && + Objects.equals(this.emptyContactsAttributes, requestContactImport.emptyContactsAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(fileUrl, fileBody, jsonBody, listIds, notifyUrl, newList, emailBlacklist, disableNotification, smsBlacklist, updateExistingContacts, emptyContactsAttributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestContactImport {\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" fileBody: ").append(toIndentedString(fileBody)).append("\n"); + sb.append(" jsonBody: ").append(toIndentedString(jsonBody)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n"); + sb.append(" newList: ").append(toIndentedString(newList)).append("\n"); + sb.append(" emailBlacklist: ").append(toIndentedString(emailBlacklist)).append("\n"); + sb.append(" disableNotification: ").append(toIndentedString(disableNotification)).append("\n"); + sb.append(" smsBlacklist: ").append(toIndentedString(smsBlacklist)).append("\n"); + sb.append(" updateExistingContacts: ").append(toIndentedString(updateExistingContacts)).append("\n"); + sb.append(" emptyContactsAttributes: ").append(toIndentedString(emptyContactsAttributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `fileUrl` to the URL query string + if (getFileUrl() != null) { + try { + joiner.add(String.format("%sfileUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFileUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `fileBody` to the URL query string + if (getFileBody() != null) { + try { + joiner.add(String.format("%sfileBody%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFileBody()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `jsonBody` to the URL query string + if (getJsonBody() != null) { + for (int i = 0; i < getJsonBody().size(); i++) { + if (getJsonBody().get(i) != null) { + joiner.add(getJsonBody().get(i).toUrlQueryString(String.format("%sjsonBody%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `notifyUrl` to the URL query string + if (getNotifyUrl() != null) { + try { + joiner.add(String.format("%snotifyUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `newList` to the URL query string + if (getNewList() != null) { + joiner.add(getNewList().toUrlQueryString(prefix + "newList" + suffix)); + } + + // add `emailBlacklist` to the URL query string + if (getEmailBlacklist() != null) { + try { + joiner.add(String.format("%semailBlacklist%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklist()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `disableNotification` to the URL query string + if (getDisableNotification() != null) { + try { + joiner.add(String.format("%sdisableNotification%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDisableNotification()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklist` to the URL query string + if (getSmsBlacklist() != null) { + try { + joiner.add(String.format("%ssmsBlacklist%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklist()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updateExistingContacts` to the URL query string + if (getUpdateExistingContacts() != null) { + try { + joiner.add(String.format("%supdateExistingContacts%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateExistingContacts()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emptyContactsAttributes` to the URL query string + if (getEmptyContactsAttributes() != null) { + try { + joiner.add(String.format("%semptyContactsAttributes%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmptyContactsAttributes()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportJsonBodyInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportJsonBodyInner.java new file mode 100644 index 0000000..67c4fad --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportJsonBodyInner.java @@ -0,0 +1,208 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RequestContactImportJsonBodyInner + */ +@JsonPropertyOrder({ + RequestContactImportJsonBodyInner.JSON_PROPERTY_EMAIL, + RequestContactImportJsonBodyInner.JSON_PROPERTY_ATTRIBUTES +}) +@JsonTypeName("requestContactImport_jsonBody_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestContactImportJsonBodyInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map attributes = new HashMap<>(); + + public RequestContactImportJsonBodyInner() { + } + + public RequestContactImportJsonBodyInner email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public RequestContactImportJsonBodyInner attributes(Map attributes) { + + this.attributes = attributes; + return this; + } + + public RequestContactImportJsonBodyInner putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * List of attributes to be imported + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestContactImportJsonBodyInner requestContactImportJsonBodyInner = (RequestContactImportJsonBodyInner) o; + return Objects.equals(this.email, requestContactImportJsonBodyInner.email) && + Objects.equals(this.attributes, requestContactImportJsonBodyInner.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(email, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestContactImportJsonBodyInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (String _key : getAttributes().keySet()) { + try { + joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportNewList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportNewList.java new file mode 100644 index 0000000..71dff79 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestContactImportNewList.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * To create a new list and import the contacts into it, pass the listName and an optional folderId. + */ +@JsonPropertyOrder({ + RequestContactImportNewList.JSON_PROPERTY_LIST_NAME, + RequestContactImportNewList.JSON_PROPERTY_FOLDER_ID +}) +@JsonTypeName("requestContactImport_newList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestContactImportNewList { + public static final String JSON_PROPERTY_LIST_NAME = "listName"; + private String listName; + + public static final String JSON_PROPERTY_FOLDER_ID = "folderId"; + private Long folderId; + + public RequestContactImportNewList() { + } + + public RequestContactImportNewList listName(String listName) { + + this.listName = listName; + return this; + } + + /** + * List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**. + * @return listName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getListName() { + return listName; + } + + + @JsonProperty(JSON_PROPERTY_LIST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListName(String listName) { + this.listName = listName; + } + + + public RequestContactImportNewList folderId(Long folderId) { + + this.folderId = folderId; + return this; + } + + /** + * Id of the folder where this new list shall be created. **Mandatory if listName is not empty** + * @return folderId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFolderId() { + return folderId; + } + + + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestContactImportNewList requestContactImportNewList = (RequestContactImportNewList) o; + return Objects.equals(this.listName, requestContactImportNewList.listName) && + Objects.equals(this.folderId, requestContactImportNewList.folderId); + } + + @Override + public int hashCode() { + return Objects.hash(listName, folderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestContactImportNewList {\n"); + sb.append(" listName: ").append(toIndentedString(listName)).append("\n"); + sb.append(" folderId: ").append(toIndentedString(folderId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `listName` to the URL query string + if (getListName() != null) { + try { + joiner.add(String.format("%slistName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getListName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `folderId` to the URL query string + if (getFolderId() != null) { + try { + joiner.add(String.format("%sfolderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFolderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestSmsRecipientExport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestSmsRecipientExport.java new file mode 100644 index 0000000..33cb1b0 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/RequestSmsRecipientExport.java @@ -0,0 +1,237 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * RequestSmsRecipientExport + */ +@JsonPropertyOrder({ + RequestSmsRecipientExport.JSON_PROPERTY_NOTIFY_U_R_L, + RequestSmsRecipientExport.JSON_PROPERTY_RECIPIENTS_TYPE +}) +@JsonTypeName("requestSmsRecipientExport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RequestSmsRecipientExport { + public static final String JSON_PROPERTY_NOTIFY_U_R_L = "notifyURL"; + private String notifyURL; + + /** + * Filter the recipients based on how they interacted with the campaign + */ + public enum RecipientsTypeEnum { + ALL("all"), + + DELIVERED("delivered"), + + ANSWERED("answered"), + + SOFTBOUNCES("softBounces"), + + HARDBOUNCES("hardBounces"), + + UNSUBSCRIBED("unsubscribed"); + + private String value; + + RecipientsTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RecipientsTypeEnum fromValue(String value) { + for (RecipientsTypeEnum b : RecipientsTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_RECIPIENTS_TYPE = "recipientsType"; + private RecipientsTypeEnum recipientsType; + + public RequestSmsRecipientExport() { + } + + public RequestSmsRecipientExport notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + * @return notifyURL + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNotifyURL() { + return notifyURL; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFY_U_R_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public RequestSmsRecipientExport recipientsType(RecipientsTypeEnum recipientsType) { + + this.recipientsType = recipientsType; + return this; + } + + /** + * Filter the recipients based on how they interacted with the campaign + * @return recipientsType + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENTS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RecipientsTypeEnum getRecipientsType() { + return recipientsType; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipientsType(RecipientsTypeEnum recipientsType) { + this.recipientsType = recipientsType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestSmsRecipientExport requestSmsRecipientExport = (RequestSmsRecipientExport) o; + return Objects.equals(this.notifyURL, requestSmsRecipientExport.notifyURL) && + Objects.equals(this.recipientsType, requestSmsRecipientExport.recipientsType); + } + + @Override + public int hashCode() { + return Objects.hash(notifyURL, recipientsType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestSmsRecipientExport {\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" recipientsType: ").append(toIndentedString(recipientsType)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `notifyURL` to the URL query string + if (getNotifyURL() != null) { + try { + joiner.add(String.format("%snotifyURL%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotifyURL()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipientsType` to the URL query string + if (getRecipientsType() != null) { + try { + joiner.add(String.format("%srecipientsType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecipientsType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/ScheduleSmtpEmail.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ScheduleSmtpEmail.java new file mode 100644 index 0000000..e03ae62 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/ScheduleSmtpEmail.java @@ -0,0 +1,251 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * ScheduleSmtpEmail + */ +@JsonPropertyOrder({ + ScheduleSmtpEmail.JSON_PROPERTY_MESSAGE_ID, + ScheduleSmtpEmail.JSON_PROPERTY_MESSAGE_IDS, + ScheduleSmtpEmail.JSON_PROPERTY_BATCH_ID +}) +@JsonTypeName("scheduleSmtpEmail") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ScheduleSmtpEmail { + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + public static final String JSON_PROPERTY_MESSAGE_IDS = "messageIds"; + private List messageIds; + + public static final String JSON_PROPERTY_BATCH_ID = "batchId"; + private String batchId; + + public ScheduleSmtpEmail() { + } + + public ScheduleSmtpEmail messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message ID of the transactional email scheduled + * @return messageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public ScheduleSmtpEmail messageIds(List messageIds) { + + this.messageIds = messageIds; + return this; + } + + public ScheduleSmtpEmail addMessageIdsItem(String messageIdsItem) { + if (this.messageIds == null) { + this.messageIds = new ArrayList<>(); + } + this.messageIds.add(messageIdsItem); + return this; + } + + /** + * Get messageIds + * @return messageIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMessageIds() { + return messageIds; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageIds(List messageIds) { + this.messageIds = messageIds; + } + + + public ScheduleSmtpEmail batchId(String batchId) { + + this.batchId = batchId; + return this; + } + + /** + * Batch ID of the batch transactional email scheduled + * @return batchId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBatchId() { + return batchId; + } + + + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatchId(String batchId) { + this.batchId = batchId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleSmtpEmail scheduleSmtpEmail = (ScheduleSmtpEmail) o; + return Objects.equals(this.messageId, scheduleSmtpEmail.messageId) && + Objects.equals(this.messageIds, scheduleSmtpEmail.messageIds) && + Objects.equals(this.batchId, scheduleSmtpEmail.batchId); + } + + @Override + public int hashCode() { + return Objects.hash(messageId, messageIds, batchId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleSmtpEmail {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageIds: ").append(toIndentedString(messageIds)).append("\n"); + sb.append(" batchId: ").append(toIndentedString(batchId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageIds` to the URL query string + if (getMessageIds() != null) { + for (int i = 0; i < getMessageIds().size(); i++) { + try { + joiner.add(String.format("%smessageIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getMessageIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `batchId` to the URL query string + if (getBatchId() != null) { + try { + joiner.add(String.format("%sbatchId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatchId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReport.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReport.java new file mode 100644 index 0000000..05022e0 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReport.java @@ -0,0 +1,233 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SendReportEmail; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendReport + */ +@JsonPropertyOrder({ + SendReport.JSON_PROPERTY_LANGUAGE, + SendReport.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("sendReport") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendReport { + /** + * Language of email content for campaign report sending. + */ + public enum LanguageEnum { + FR("fr"), + + ES("es"), + + PT("pt"), + + IT("it"), + + DE("de"), + + EN("en"); + + private String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LanguageEnum fromValue(String value) { + for (LanguageEnum b : LanguageEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private LanguageEnum language = LanguageEnum.FR; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private SendReportEmail email; + + public SendReport() { + } + + public SendReport language(LanguageEnum language) { + + this.language = language; + return this; + } + + /** + * Language of email content for campaign report sending. + * @return language + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LanguageEnum getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(LanguageEnum language) { + this.language = language; + } + + + public SendReport email(SendReportEmail email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public SendReportEmail getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(SendReportEmail email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendReport sendReport = (SendReport) o; + return Objects.equals(this.language, sendReport.language) && + Objects.equals(this.email, sendReport.email); + } + + @Override + public int hashCode() { + return Objects.hash(language, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendReport {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + joiner.add(getEmail().toUrlQueryString(prefix + "email" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReportEmail.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReportEmail.java new file mode 100644 index 0000000..1751b04 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendReportEmail.java @@ -0,0 +1,209 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Custom attributes for the report email. + */ +@JsonPropertyOrder({ + SendReportEmail.JSON_PROPERTY_TO, + SendReportEmail.JSON_PROPERTY_BODY +}) +@JsonTypeName("sendReport_email") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendReportEmail { + public static final String JSON_PROPERTY_TO = "to"; + private List to = new ArrayList<>(); + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + public SendReportEmail() { + } + + public SendReportEmail to(List to) { + + this.to = to; + return this; + } + + public SendReportEmail addToItem(String toItem) { + if (this.to == null) { + this.to = new ArrayList<>(); + } + this.to.add(toItem); + return this; + } + + /** + * Email addresses of the recipients + * @return to + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTo(List to) { + this.to = to; + } + + + public SendReportEmail body(String body) { + + this.body = body; + return this; + } + + /** + * Custom text message to be presented in the report email. + * @return body + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBody(String body) { + this.body = body; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendReportEmail sendReportEmail = (SendReportEmail) o; + return Objects.equals(this.to, sendReportEmail.to) && + Objects.equals(this.body, sendReportEmail.body); + } + + @Override + public int hashCode() { + return Objects.hash(to, body); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendReportEmail {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `to` to the URL query string + if (getTo() != null) { + for (int i = 0; i < getTo().size(); i++) { + try { + joiner.add(String.format("%sto%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getTo().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `body` to the URL query string + if (getBody() != null) { + try { + joiner.add(String.format("%sbody%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBody()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSms.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSms.java new file mode 100644 index 0000000..3f5670c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSms.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSms + */ +@JsonPropertyOrder({ + SendSms.JSON_PROPERTY_REFERENCE, + SendSms.JSON_PROPERTY_MESSAGE_ID, + SendSms.JSON_PROPERTY_SMS_COUNT, + SendSms.JSON_PROPERTY_USED_CREDITS, + SendSms.JSON_PROPERTY_REMAINING_CREDITS +}) +@JsonTypeName("sendSms") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSms { + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private Long messageId; + + public static final String JSON_PROPERTY_SMS_COUNT = "smsCount"; + private Long smsCount; + + public static final String JSON_PROPERTY_USED_CREDITS = "usedCredits"; + private Float usedCredits; + + public static final String JSON_PROPERTY_REMAINING_CREDITS = "remainingCredits"; + private Float remainingCredits; + + public SendSms() { + } + + public SendSms reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Get reference + * @return reference + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getReference() { + return reference; + } + + + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReference(String reference) { + this.reference = reference; + } + + + public SendSms messageId(Long messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Get messageId + * @return messageId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessageId(Long messageId) { + this.messageId = messageId; + } + + + public SendSms smsCount(Long smsCount) { + + this.smsCount = smsCount; + return this; + } + + /** + * Count of SMS's to send multiple text messages + * @return smsCount + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSmsCount() { + return smsCount; + } + + + @JsonProperty(JSON_PROPERTY_SMS_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsCount(Long smsCount) { + this.smsCount = smsCount; + } + + + public SendSms usedCredits(Float usedCredits) { + + this.usedCredits = usedCredits; + return this; + } + + /** + * SMS credits used per text message + * @return usedCredits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getUsedCredits() { + return usedCredits; + } + + + @JsonProperty(JSON_PROPERTY_USED_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedCredits(Float usedCredits) { + this.usedCredits = usedCredits; + } + + + public SendSms remainingCredits(Float remainingCredits) { + + this.remainingCredits = remainingCredits; + return this; + } + + /** + * Remaining SMS credits of the user + * @return remainingCredits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getRemainingCredits() { + return remainingCredits; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemainingCredits(Float remainingCredits) { + this.remainingCredits = remainingCredits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSms sendSms = (SendSms) o; + return Objects.equals(this.reference, sendSms.reference) && + Objects.equals(this.messageId, sendSms.messageId) && + Objects.equals(this.smsCount, sendSms.smsCount) && + Objects.equals(this.usedCredits, sendSms.usedCredits) && + Objects.equals(this.remainingCredits, sendSms.remainingCredits); + } + + @Override + public int hashCode() { + return Objects.hash(reference, messageId, smsCount, usedCredits, remainingCredits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSms {\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" smsCount: ").append(toIndentedString(smsCount)).append("\n"); + sb.append(" usedCredits: ").append(toIndentedString(usedCredits)).append("\n"); + sb.append(" remainingCredits: ").append(toIndentedString(remainingCredits)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `reference` to the URL query string + if (getReference() != null) { + try { + joiner.add(String.format("%sreference%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReference()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsCount` to the URL query string + if (getSmsCount() != null) { + try { + joiner.add(String.format("%ssmsCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `usedCredits` to the URL query string + if (getUsedCredits() != null) { + try { + joiner.add(String.format("%susedCredits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsedCredits()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remainingCredits` to the URL query string + if (getRemainingCredits() != null) { + try { + joiner.add(String.format("%sremainingCredits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemainingCredits()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmail.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmail.java new file mode 100644 index 0000000..e05c489 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmail.java @@ -0,0 +1,861 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import software.xdev.brevo.model.SendSmtpEmailAttachmentInner; +import software.xdev.brevo.model.SendSmtpEmailBccInner; +import software.xdev.brevo.model.SendSmtpEmailCcInner; +import software.xdev.brevo.model.SendSmtpEmailMessageVersionsInner; +import software.xdev.brevo.model.SendSmtpEmailReplyTo; +import software.xdev.brevo.model.SendSmtpEmailSender; +import software.xdev.brevo.model.SendSmtpEmailToInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmail + */ +@JsonPropertyOrder({ + SendSmtpEmail.JSON_PROPERTY_SENDER, + SendSmtpEmail.JSON_PROPERTY_TO, + SendSmtpEmail.JSON_PROPERTY_BCC, + SendSmtpEmail.JSON_PROPERTY_CC, + SendSmtpEmail.JSON_PROPERTY_HTML_CONTENT, + SendSmtpEmail.JSON_PROPERTY_TEXT_CONTENT, + SendSmtpEmail.JSON_PROPERTY_SUBJECT, + SendSmtpEmail.JSON_PROPERTY_REPLY_TO, + SendSmtpEmail.JSON_PROPERTY_ATTACHMENT, + SendSmtpEmail.JSON_PROPERTY_HEADERS, + SendSmtpEmail.JSON_PROPERTY_TEMPLATE_ID, + SendSmtpEmail.JSON_PROPERTY_PARAMS, + SendSmtpEmail.JSON_PROPERTY_MESSAGE_VERSIONS, + SendSmtpEmail.JSON_PROPERTY_TAGS, + SendSmtpEmail.JSON_PROPERTY_SCHEDULED_AT, + SendSmtpEmail.JSON_PROPERTY_BATCH_ID +}) +@JsonTypeName("sendSmtpEmail") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmail { + public static final String JSON_PROPERTY_SENDER = "sender"; + private SendSmtpEmailSender sender; + + public static final String JSON_PROPERTY_TO = "to"; + private List to; + + public static final String JSON_PROPERTY_BCC = "bcc"; + private List bcc; + + public static final String JSON_PROPERTY_CC = "cc"; + private List cc; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_TEXT_CONTENT = "textContent"; + private String textContent; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private SendSmtpEmailReplyTo replyTo; + + public static final String JSON_PROPERTY_ATTACHMENT = "attachment"; + private List attachment; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private Map headers = new HashMap<>(); + + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Long templateId; + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Map params = new HashMap<>(); + + public static final String JSON_PROPERTY_MESSAGE_VERSIONS = "messageVersions"; + private List messageVersions; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private OffsetDateTime scheduledAt; + + public static final String JSON_PROPERTY_BATCH_ID = "batchId"; + private String batchId; + + public SendSmtpEmail() { + } + + public SendSmtpEmail sender(SendSmtpEmailSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SendSmtpEmailSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(SendSmtpEmailSender sender) { + this.sender = sender; + } + + + public SendSmtpEmail to(List to) { + + this.to = to; + return this; + } + + public SendSmtpEmail addToItem(SendSmtpEmailToInner toItem) { + if (this.to == null) { + this.to = new ArrayList<>(); + } + this.to.add(toItem); + return this; + } + + /** + * **Mandatory if messageVersions are not passed, ignored if messageVersions are passed** List of email addresses and names (_optional_) of the recipients. For example, **[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]** + * @return to + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(List to) { + this.to = to; + } + + + public SendSmtpEmail bcc(List bcc) { + + this.bcc = bcc; + return this; + } + + public SendSmtpEmail addBccItem(SendSmtpEmailBccInner bccItem) { + if (this.bcc == null) { + this.bcc = new ArrayList<>(); + } + this.bcc.add(bccItem); + return this; + } + + /** + * List of email addresses and names (_optional_) of the recipients in bcc + * @return bcc + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBcc() { + return bcc; + } + + + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBcc(List bcc) { + this.bcc = bcc; + } + + + public SendSmtpEmail cc(List cc) { + + this.cc = cc; + return this; + } + + public SendSmtpEmail addCcItem(SendSmtpEmailCcInner ccItem) { + if (this.cc == null) { + this.cc = new ArrayList<>(); + } + this.cc.add(ccItem); + return this; + } + + /** + * List of email addresses and names (_optional_) of the recipients in cc + * @return cc + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCc() { + return cc; + } + + + @JsonProperty(JSON_PROPERTY_CC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCc(List cc) { + this.cc = cc; + } + + + public SendSmtpEmail htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * HTML body of the message. **Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed** + * @return htmlContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public SendSmtpEmail textContent(String textContent) { + + this.textContent = textContent; + return this; + } + + /** + * Plain Text body of the message. **Ignored if 'templateId' is passed** + * @return textContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTextContent() { + return textContent; + } + + + @JsonProperty(JSON_PROPERTY_TEXT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextContent(String textContent) { + this.textContent = textContent; + } + + + public SendSmtpEmail subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the message. **Mandatory if 'templateId' is not passed** + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public SendSmtpEmail replyTo(SendSmtpEmailReplyTo replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Get replyTo + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SendSmtpEmailReplyTo getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(SendSmtpEmailReplyTo replyTo) { + this.replyTo = replyTo; + } + + + public SendSmtpEmail attachment(List attachment) { + + this.attachment = attachment; + return this; + } + + public SendSmtpEmail addAttachmentItem(SendSmtpEmailAttachmentInner attachmentItem) { + if (this.attachment == null) { + this.attachment = new ArrayList<>(); + } + this.attachment.add(attachmentItem); + return this; + } + + /** + * Pass the _absolute URL_ (**no local file**) or the _base64 content_ of the attachment along with the attachment name. **Mandatory if attachment content is passed**. For example, **[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]**. Allowed extensions for attachment file: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm. If `templateId` is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then `attachment` is ignored + * @return attachment + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachment() { + return attachment; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachment(List attachment) { + this.attachment = attachment; + } + + + public SendSmtpEmail headers(Map headers) { + + this.headers = headers; + return this; + } + + public SendSmtpEmail putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * Pass the set of custom headers (_not the standard headers_) that shall be sent along the mail headers in the original email. **'sender.ip'** header can be set (**only for dedicated ip users**) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, **{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}**. + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(Map headers) { + this.headers = headers; + } + + + public SendSmtpEmail templateId(Long templateId) { + + this.templateId = templateId; + return this; + } + + /** + * Id of the template. + * @return templateId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + + public SendSmtpEmail params(Map params) { + + this.params = params; + return this; + } + + public SendSmtpEmail putParamsItem(String key, Object paramsItem) { + if (this.params == null) { + this.params = new HashMap<>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Pass the set of attributes to customize the template. For example, **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. It's **considered only if template is in New Template Language format**. + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Map params) { + this.params = params; + } + + + public SendSmtpEmail messageVersions(List messageVersions) { + + this.messageVersions = messageVersions; + return this; + } + + public SendSmtpEmail addMessageVersionsItem(SendSmtpEmailMessageVersionsInner messageVersionsItem) { + if (this.messageVersions == null) { + this.messageVersions = new ArrayList<>(); + } + this.messageVersions.add(messageVersionsItem); + return this; + } + + /** + * You can customize and send out multiple versions of a mail. **templateId** can be customized only if global parameter contains templateId. **htmlContent and textContent** can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed **100 KB** limit and that of cumulative params shall not exceed **1000 KB**. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - **https://developers.brevo.com/docs/batch-send-transactional-emails** + * @return messageVersions + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMessageVersions() { + return messageVersions; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_VERSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageVersions(List messageVersions) { + this.messageVersions = messageVersions; + } + + + public SendSmtpEmail tags(List tags) { + + this.tags = tags; + return this; + } + + public SendSmtpEmail addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tag your emails to find them more easily + * @return tags + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + + public SendSmtpEmail scheduledAt(OffsetDateTime scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(OffsetDateTime scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public SendSmtpEmail batchId(String batchId) { + + this.batchId = batchId; + return this; + } + + /** + * Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. + * @return batchId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBatchId() { + return batchId; + } + + + @JsonProperty(JSON_PROPERTY_BATCH_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatchId(String batchId) { + this.batchId = batchId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmail sendSmtpEmail = (SendSmtpEmail) o; + return Objects.equals(this.sender, sendSmtpEmail.sender) && + Objects.equals(this.to, sendSmtpEmail.to) && + Objects.equals(this.bcc, sendSmtpEmail.bcc) && + Objects.equals(this.cc, sendSmtpEmail.cc) && + Objects.equals(this.htmlContent, sendSmtpEmail.htmlContent) && + Objects.equals(this.textContent, sendSmtpEmail.textContent) && + Objects.equals(this.subject, sendSmtpEmail.subject) && + Objects.equals(this.replyTo, sendSmtpEmail.replyTo) && + Objects.equals(this.attachment, sendSmtpEmail.attachment) && + Objects.equals(this.headers, sendSmtpEmail.headers) && + Objects.equals(this.templateId, sendSmtpEmail.templateId) && + Objects.equals(this.params, sendSmtpEmail.params) && + Objects.equals(this.messageVersions, sendSmtpEmail.messageVersions) && + Objects.equals(this.tags, sendSmtpEmail.tags) && + Objects.equals(this.scheduledAt, sendSmtpEmail.scheduledAt) && + Objects.equals(this.batchId, sendSmtpEmail.batchId); + } + + @Override + public int hashCode() { + return Objects.hash(sender, to, bcc, cc, htmlContent, textContent, subject, replyTo, attachment, headers, templateId, params, messageVersions, tags, scheduledAt, batchId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmail {\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n"); + sb.append(" cc: ").append(toIndentedString(cc)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" textContent: ").append(toIndentedString(textContent)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" attachment: ").append(toIndentedString(attachment)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" messageVersions: ").append(toIndentedString(messageVersions)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" batchId: ").append(toIndentedString(batchId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `to` to the URL query string + if (getTo() != null) { + for (int i = 0; i < getTo().size(); i++) { + if (getTo().get(i) != null) { + joiner.add(getTo().get(i).toUrlQueryString(String.format("%sto%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `bcc` to the URL query string + if (getBcc() != null) { + for (int i = 0; i < getBcc().size(); i++) { + if (getBcc().get(i) != null) { + joiner.add(getBcc().get(i).toUrlQueryString(String.format("%sbcc%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `cc` to the URL query string + if (getCc() != null) { + for (int i = 0; i < getCc().size(); i++) { + if (getCc().get(i) != null) { + joiner.add(getCc().get(i).toUrlQueryString(String.format("%scc%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `textContent` to the URL query string + if (getTextContent() != null) { + try { + joiner.add(String.format("%stextContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTextContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + joiner.add(getReplyTo().toUrlQueryString(prefix + "replyTo" + suffix)); + } + + // add `attachment` to the URL query string + if (getAttachment() != null) { + for (int i = 0; i < getAttachment().size(); i++) { + if (getAttachment().get(i) != null) { + joiner.add(getAttachment().get(i).toUrlQueryString(String.format("%sattachment%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (String _key : getHeaders().keySet()) { + try { + joiner.add(String.format("%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getHeaders().get(_key), URLEncoder.encode(String.valueOf(getHeaders().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `params` to the URL query string + if (getParams() != null) { + for (String _key : getParams().keySet()) { + try { + joiner.add(String.format("%sparams%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getParams().get(_key), URLEncoder.encode(String.valueOf(getParams().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `messageVersions` to the URL query string + if (getMessageVersions() != null) { + for (int i = 0; i < getMessageVersions().size(); i++) { + if (getMessageVersions().get(i) != null) { + joiner.add(getMessageVersions().get(i).toUrlQueryString(String.format("%smessageVersions%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + try { + joiner.add(String.format("%stags%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getTags().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batchId` to the URL query string + if (getBatchId() != null) { + try { + joiner.add(String.format("%sbatchId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatchId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailAttachmentInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailAttachmentInner.java new file mode 100644 index 0000000..0a44787 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailAttachmentInner.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmailAttachmentInner + */ +@JsonPropertyOrder({ + SendSmtpEmailAttachmentInner.JSON_PROPERTY_URL, + SendSmtpEmailAttachmentInner.JSON_PROPERTY_CONTENT, + SendSmtpEmailAttachmentInner.JSON_PROPERTY_NAME +}) +@JsonTypeName("sendSmtpEmail_attachment_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailAttachmentInner { + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private byte[] content; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SendSmtpEmailAttachmentInner() { + } + + public SendSmtpEmailAttachmentInner url(String url) { + + this.url = url; + return this; + } + + /** + * Absolute url of the attachment (**no local file**). + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public SendSmtpEmailAttachmentInner content(byte[] content) { + + this.content = content; + return this; + } + + /** + * Base64 encoded chunk data of the attachment generated on the fly + * @return content + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public byte[] getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(byte[] content) { + this.content = content; + } + + + public SendSmtpEmailAttachmentInner name(String name) { + + this.name = name; + return this; + } + + /** + * **Required if content is passed**. Name of the attachment + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailAttachmentInner sendSmtpEmailAttachmentInner = (SendSmtpEmailAttachmentInner) o; + return Objects.equals(this.url, sendSmtpEmailAttachmentInner.url) && + Arrays.equals(this.content, sendSmtpEmailAttachmentInner.content) && + Objects.equals(this.name, sendSmtpEmailAttachmentInner.name); + } + + @Override + public int hashCode() { + return Objects.hash(url, Arrays.hashCode(content), name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailAttachmentInner {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailBccInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailBccInner.java new file mode 100644 index 0000000..9165113 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailBccInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmailBccInner + */ +@JsonPropertyOrder({ + SendSmtpEmailBccInner.JSON_PROPERTY_EMAIL, + SendSmtpEmailBccInner.JSON_PROPERTY_NAME +}) +@JsonTypeName("sendSmtpEmail_bcc_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailBccInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SendSmtpEmailBccInner() { + } + + public SendSmtpEmailBccInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the recipient in bcc + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public SendSmtpEmailBccInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the recipient in bcc. **Maximum allowed characters are 70**. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailBccInner sendSmtpEmailBccInner = (SendSmtpEmailBccInner) o; + return Objects.equals(this.email, sendSmtpEmailBccInner.email) && + Objects.equals(this.name, sendSmtpEmailBccInner.name); + } + + @Override + public int hashCode() { + return Objects.hash(email, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailBccInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailCcInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailCcInner.java new file mode 100644 index 0000000..6ea10ee --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailCcInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmailCcInner + */ +@JsonPropertyOrder({ + SendSmtpEmailCcInner.JSON_PROPERTY_EMAIL, + SendSmtpEmailCcInner.JSON_PROPERTY_NAME +}) +@JsonTypeName("sendSmtpEmail_cc_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailCcInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SendSmtpEmailCcInner() { + } + + public SendSmtpEmailCcInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the recipient in cc + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public SendSmtpEmailCcInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the recipient in cc. **Maximum allowed characters are 70**. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailCcInner sendSmtpEmailCcInner = (SendSmtpEmailCcInner) o; + return Objects.equals(this.email, sendSmtpEmailCcInner.email) && + Objects.equals(this.name, sendSmtpEmailCcInner.name); + } + + @Override + public int hashCode() { + return Objects.hash(email, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailCcInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailMessageVersionsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailMessageVersionsInner.java new file mode 100644 index 0000000..1ce3bcf --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailMessageVersionsInner.java @@ -0,0 +1,402 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import software.xdev.brevo.model.SendSmtpEmailBccInner; +import software.xdev.brevo.model.SendSmtpEmailCcInner; +import software.xdev.brevo.model.SendSmtpEmailReplyTo; +import software.xdev.brevo.model.SendSmtpEmailToInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmailMessageVersionsInner + */ +@JsonPropertyOrder({ + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_TO, + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_PARAMS, + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_BCC, + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_CC, + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_REPLY_TO, + SendSmtpEmailMessageVersionsInner.JSON_PROPERTY_SUBJECT +}) +@JsonTypeName("sendSmtpEmail_messageVersions_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailMessageVersionsInner { + public static final String JSON_PROPERTY_TO = "to"; + private List to = new ArrayList<>(); + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Map params = new HashMap<>(); + + public static final String JSON_PROPERTY_BCC = "bcc"; + private List bcc; + + public static final String JSON_PROPERTY_CC = "cc"; + private List cc; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private SendSmtpEmailReplyTo replyTo; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public SendSmtpEmailMessageVersionsInner() { + } + + public SendSmtpEmailMessageVersionsInner to(List to) { + + this.to = to; + return this; + } + + public SendSmtpEmailMessageVersionsInner addToItem(SendSmtpEmailToInner toItem) { + if (this.to == null) { + this.to = new ArrayList<>(); + } + this.to.add(toItem); + return this; + } + + /** + * List of email addresses and names (_optional_) of the recipients. For example, **[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]** + * @return to + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTo(List to) { + this.to = to; + } + + + public SendSmtpEmailMessageVersionsInner params(Map params) { + + this.params = params; + return this; + } + + public SendSmtpEmailMessageVersionsInner putParamsItem(String key, Object paramsItem) { + if (this.params == null) { + this.params = new HashMap<>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Pass the set of attributes to customize the template. For example, **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. It's **considered only if template is in New Template Language format**. + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Map params) { + this.params = params; + } + + + public SendSmtpEmailMessageVersionsInner bcc(List bcc) { + + this.bcc = bcc; + return this; + } + + public SendSmtpEmailMessageVersionsInner addBccItem(SendSmtpEmailBccInner bccItem) { + if (this.bcc == null) { + this.bcc = new ArrayList<>(); + } + this.bcc.add(bccItem); + return this; + } + + /** + * List of email addresses and names (_optional_) of the recipients in bcc + * @return bcc + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBcc() { + return bcc; + } + + + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBcc(List bcc) { + this.bcc = bcc; + } + + + public SendSmtpEmailMessageVersionsInner cc(List cc) { + + this.cc = cc; + return this; + } + + public SendSmtpEmailMessageVersionsInner addCcItem(SendSmtpEmailCcInner ccItem) { + if (this.cc == null) { + this.cc = new ArrayList<>(); + } + this.cc.add(ccItem); + return this; + } + + /** + * List of email addresses and names (_optional_) of the recipients in cc + * @return cc + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCc() { + return cc; + } + + + @JsonProperty(JSON_PROPERTY_CC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCc(List cc) { + this.cc = cc; + } + + + public SendSmtpEmailMessageVersionsInner replyTo(SendSmtpEmailReplyTo replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Get replyTo + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SendSmtpEmailReplyTo getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(SendSmtpEmailReplyTo replyTo) { + this.replyTo = replyTo; + } + + + public SendSmtpEmailMessageVersionsInner subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Custom subject specific to message version + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailMessageVersionsInner sendSmtpEmailMessageVersionsInner = (SendSmtpEmailMessageVersionsInner) o; + return Objects.equals(this.to, sendSmtpEmailMessageVersionsInner.to) && + Objects.equals(this.params, sendSmtpEmailMessageVersionsInner.params) && + Objects.equals(this.bcc, sendSmtpEmailMessageVersionsInner.bcc) && + Objects.equals(this.cc, sendSmtpEmailMessageVersionsInner.cc) && + Objects.equals(this.replyTo, sendSmtpEmailMessageVersionsInner.replyTo) && + Objects.equals(this.subject, sendSmtpEmailMessageVersionsInner.subject); + } + + @Override + public int hashCode() { + return Objects.hash(to, params, bcc, cc, replyTo, subject); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailMessageVersionsInner {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n"); + sb.append(" cc: ").append(toIndentedString(cc)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `to` to the URL query string + if (getTo() != null) { + for (int i = 0; i < getTo().size(); i++) { + if (getTo().get(i) != null) { + joiner.add(getTo().get(i).toUrlQueryString(String.format("%sto%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `params` to the URL query string + if (getParams() != null) { + for (String _key : getParams().keySet()) { + try { + joiner.add(String.format("%sparams%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getParams().get(_key), URLEncoder.encode(String.valueOf(getParams().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `bcc` to the URL query string + if (getBcc() != null) { + for (int i = 0; i < getBcc().size(); i++) { + if (getBcc().get(i) != null) { + joiner.add(getBcc().get(i).toUrlQueryString(String.format("%sbcc%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `cc` to the URL query string + if (getCc() != null) { + for (int i = 0; i < getCc().size(); i++) { + if (getCc().get(i) != null) { + joiner.add(getCc().get(i).toUrlQueryString(String.format("%scc%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + joiner.add(getReplyTo().toUrlQueryString(prefix + "replyTo" + suffix)); + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailReplyTo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailReplyTo.java new file mode 100644 index 0000000..4b90f84 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailReplyTo.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Email (**required**), along with name (_optional_), on which transactional mail recipients will be able to reply back. For example, **{\"email\":\"ann6533@example.com\", \"name\":\"Ann\"}** + */ +@JsonPropertyOrder({ + SendSmtpEmailReplyTo.JSON_PROPERTY_EMAIL, + SendSmtpEmailReplyTo.JSON_PROPERTY_NAME +}) +@JsonTypeName("sendSmtpEmail_replyTo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailReplyTo { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SendSmtpEmailReplyTo() { + } + + public SendSmtpEmailReplyTo email(String email) { + + this.email = email; + return this; + } + + /** + * Email address in reply to + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public SendSmtpEmailReplyTo name(String name) { + + this.name = name; + return this; + } + + /** + * Name in reply to. **Maximum allowed characters are 70**. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailReplyTo sendSmtpEmailReplyTo = (SendSmtpEmailReplyTo) o; + return Objects.equals(this.email, sendSmtpEmailReplyTo.email) && + Objects.equals(this.name, sendSmtpEmailReplyTo.name); + } + + @Override + public int hashCode() { + return Objects.hash(email, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailReplyTo {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailSender.java new file mode 100644 index 0000000..1b3f497 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * **Mandatory if `templateId` is not passed**. Pass name (_optional_) and email or id of sender from which emails will be sent. **`name` will be ignored if passed along with sender `id`**. For example, **{\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"}** **{\"id\":2}** + */ +@JsonPropertyOrder({ + SendSmtpEmailSender.JSON_PROPERTY_NAME, + SendSmtpEmailSender.JSON_PROPERTY_EMAIL, + SendSmtpEmailSender.JSON_PROPERTY_ID +}) +@JsonTypeName("sendSmtpEmail_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public SendSmtpEmailSender() { + } + + public SendSmtpEmailSender name(String name) { + + this.name = name; + return this; + } + + /** + * description: Name of the sender from which the emails will be sent. **Maximum allowed characters are 70**. Applicable only when email is passed. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public SendSmtpEmailSender email(String email) { + + this.email = email; + return this; + } + + /** + * Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public SendSmtpEmailSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailSender sendSmtpEmailSender = (SendSmtpEmailSender) o; + return Objects.equals(this.name, sendSmtpEmailSender.name) && + Objects.equals(this.email, sendSmtpEmailSender.email) && + Objects.equals(this.id, sendSmtpEmailSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailToInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailToInner.java new file mode 100644 index 0000000..36ed14c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendSmtpEmailToInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendSmtpEmailToInner + */ +@JsonPropertyOrder({ + SendSmtpEmailToInner.JSON_PROPERTY_EMAIL, + SendSmtpEmailToInner.JSON_PROPERTY_NAME +}) +@JsonTypeName("sendSmtpEmail_to_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendSmtpEmailToInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SendSmtpEmailToInner() { + } + + public SendSmtpEmailToInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the recipient + * @return email + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmail(String email) { + this.email = email; + } + + + public SendSmtpEmailToInner name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the recipient. **Maximum allowed characters are 70**. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmtpEmailToInner sendSmtpEmailToInner = (SendSmtpEmailToInner) o; + return Objects.equals(this.email, sendSmtpEmailToInner.email) && + Objects.equals(this.name, sendSmtpEmailToInner.name); + } + + @Override + public int hashCode() { + return Objects.hash(email, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmtpEmailToInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestEmail.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestEmail.java new file mode 100644 index 0000000..1de0a74 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestEmail.java @@ -0,0 +1,167 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendTestEmail + */ +@JsonPropertyOrder({ + SendTestEmail.JSON_PROPERTY_EMAIL_TO +}) +@JsonTypeName("sendTestEmail") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendTestEmail { + public static final String JSON_PROPERTY_EMAIL_TO = "emailTo"; + private List emailTo; + + public SendTestEmail() { + } + + public SendTestEmail emailTo(List emailTo) { + + this.emailTo = emailTo; + return this; + } + + public SendTestEmail addEmailToItem(String emailToItem) { + if (this.emailTo == null) { + this.emailTo = new ArrayList<>(); + } + this.emailTo.add(emailToItem); + return this; + } + + /** + * List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_. + * @return emailTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEmailTo() { + return emailTo; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailTo(List emailTo) { + this.emailTo = emailTo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendTestEmail sendTestEmail = (SendTestEmail) o; + return Objects.equals(this.emailTo, sendTestEmail.emailTo); + } + + @Override + public int hashCode() { + return Objects.hash(emailTo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendTestEmail {\n"); + sb.append(" emailTo: ").append(toIndentedString(emailTo)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `emailTo` to the URL query string + if (getEmailTo() != null) { + for (int i = 0; i < getEmailTo().size(); i++) { + try { + joiner.add(String.format("%semailTo%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEmailTo().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestSms.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestSms.java new file mode 100644 index 0000000..802156a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTestSms.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendTestSms + */ +@JsonPropertyOrder({ + SendTestSms.JSON_PROPERTY_PHONE_NUMBER +}) +@JsonTypeName("sendTestSms") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendTestSms { + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; + private String phoneNumber; + + public SendTestSms() { + } + + public SendTestSms phoneNumber(String phoneNumber) { + + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** + * @return phoneNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhoneNumber() { + return phoneNumber; + } + + + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendTestSms sendTestSms = (SendTestSms) o; + return Objects.equals(this.phoneNumber, sendTestSms.phoneNumber); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendTestSms {\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `phoneNumber` to the URL query string + if (getPhoneNumber() != null) { + try { + joiner.add(String.format("%sphoneNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhoneNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTransacSms.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTransacSms.java new file mode 100644 index 0000000..16db881 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendTransacSms.java @@ -0,0 +1,481 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendTransacSms + */ +@JsonPropertyOrder({ + SendTransacSms.JSON_PROPERTY_SENDER, + SendTransacSms.JSON_PROPERTY_RECIPIENT, + SendTransacSms.JSON_PROPERTY_CONTENT, + SendTransacSms.JSON_PROPERTY_TYPE, + SendTransacSms.JSON_PROPERTY_TAG, + SendTransacSms.JSON_PROPERTY_WEB_URL, + SendTransacSms.JSON_PROPERTY_UNICODE_ENABLED, + SendTransacSms.JSON_PROPERTY_ORGANISATION_PREFIX +}) +@JsonTypeName("sendTransacSms") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendTransacSms { + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + /** + * Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. + */ + public enum TypeEnum { + TRANSACTIONAL("transactional"), + + MARKETING("marketing"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.TRANSACTIONAL; + + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_WEB_URL = "webUrl"; + private String webUrl; + + public static final String JSON_PROPERTY_UNICODE_ENABLED = "unicodeEnabled"; + private Boolean unicodeEnabled = false; + + public static final String JSON_PROPERTY_ORGANISATION_PREFIX = "organisationPrefix"; + private String organisationPrefix; + + public SendTransacSms() { + } + + public SendTransacSms sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + * @return sender + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(String sender) { + this.sender = sender; + } + + + public SendTransacSms recipient(String recipient) { + + this.recipient = recipient; + return this; + } + + /** + * Mobile number to send SMS with the country code + * @return recipient + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + + public SendTransacSms content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the message. If more than **160 characters** long, will be sent as multiple text messages + * @return content + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; + } + + + public SendTransacSms type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + public SendTransacSms tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the message + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public SendTransacSms webUrl(String webUrl) { + + this.webUrl = webUrl; + return this; + } + + /** + * Webhook to call for each event triggered by the message (delivered etc.) + * @return webUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEB_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebUrl() { + return webUrl; + } + + + @JsonProperty(JSON_PROPERTY_WEB_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } + + + public SendTransacSms unicodeEnabled(Boolean unicodeEnabled) { + + this.unicodeEnabled = unicodeEnabled; + return this; + } + + /** + * Format of the message. It indicates whether the content should be treated as unicode or not. + * @return unicodeEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUnicodeEnabled() { + return unicodeEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnicodeEnabled(Boolean unicodeEnabled) { + this.unicodeEnabled = unicodeEnabled; + } + + + public SendTransacSms organisationPrefix(String organisationPrefix) { + + this.organisationPrefix = organisationPrefix; + return this; + } + + /** + * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + * @return organisationPrefix + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOrganisationPrefix() { + return organisationPrefix; + } + + + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrganisationPrefix(String organisationPrefix) { + this.organisationPrefix = organisationPrefix; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendTransacSms sendTransacSms = (SendTransacSms) o; + return Objects.equals(this.sender, sendTransacSms.sender) && + Objects.equals(this.recipient, sendTransacSms.recipient) && + Objects.equals(this.content, sendTransacSms.content) && + Objects.equals(this.type, sendTransacSms.type) && + Objects.equals(this.tag, sendTransacSms.tag) && + Objects.equals(this.webUrl, sendTransacSms.webUrl) && + Objects.equals(this.unicodeEnabled, sendTransacSms.unicodeEnabled) && + Objects.equals(this.organisationPrefix, sendTransacSms.organisationPrefix); + } + + @Override + public int hashCode() { + return Objects.hash(sender, recipient, content, type, tag, webUrl, unicodeEnabled, organisationPrefix); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendTransacSms {\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" webUrl: ").append(toIndentedString(webUrl)).append("\n"); + sb.append(" unicodeEnabled: ").append(toIndentedString(unicodeEnabled)).append("\n"); + sb.append(" organisationPrefix: ").append(toIndentedString(organisationPrefix)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipient` to the URL query string + if (getRecipient() != null) { + try { + joiner.add(String.format("%srecipient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecipient()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `type` to the URL query string + if (getType() != null) { + try { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `webUrl` to the URL query string + if (getWebUrl() != null) { + try { + joiner.add(String.format("%swebUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWebUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unicodeEnabled` to the URL query string + if (getUnicodeEnabled() != null) { + try { + joiner.add(String.format("%sunicodeEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnicodeEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `organisationPrefix` to the URL query string + if (getOrganisationPrefix() != null) { + try { + joiner.add(String.format("%sorganisationPrefix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrganisationPrefix()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessage201Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessage201Response.java new file mode 100644 index 0000000..5af2a3c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessage201Response.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendWhatsappMessage201Response + */ +@JsonPropertyOrder({ + SendWhatsappMessage201Response.JSON_PROPERTY_MESSAGE_ID +}) +@JsonTypeName("sendWhatsappMessage_201_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendWhatsappMessage201Response { + public static final String JSON_PROPERTY_MESSAGE_ID = "messageId"; + private String messageId; + + public SendWhatsappMessage201Response() { + } + + public SendWhatsappMessage201Response messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * messageId of sent message + * @return messageId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessageId() { + return messageId; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendWhatsappMessage201Response sendWhatsappMessage201Response = (SendWhatsappMessage201Response) o; + return Objects.equals(this.messageId, sendWhatsappMessage201Response.messageId); + } + + @Override + public int hashCode() { + return Objects.hash(messageId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendWhatsappMessage201Response {\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `messageId` to the URL query string + if (getMessageId() != null) { + try { + joiner.add(String.format("%smessageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageRequest.java new file mode 100644 index 0000000..832cabe --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageRequest.java @@ -0,0 +1,337 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.SendWhatsappMessageTemplate; +import software.xdev.brevo.model.SendWhatsappMessageText; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendWhatsappMessageRequest + */ +@JsonPropertyOrder({ + SendWhatsappMessageRequest.JSON_PROPERTY_TEMPLATE_ID, + SendWhatsappMessageRequest.JSON_PROPERTY_SENDER_NUMBER, + SendWhatsappMessageRequest.JSON_PROPERTY_PARAMS, + SendWhatsappMessageRequest.JSON_PROPERTY_CONTACT_NUMBERS, + SendWhatsappMessageRequest.JSON_PROPERTY_TEXT +}) +@JsonTypeName("sendWhatsappMessage_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendWhatsappMessageRequest { + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Integer templateId; + + public static final String JSON_PROPERTY_SENDER_NUMBER = "senderNumber"; + private String senderNumber; + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Object params; + + public static final String JSON_PROPERTY_CONTACT_NUMBERS = "contactNumbers"; + private List contactNumbers = new ArrayList<>(); + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public SendWhatsappMessageRequest() { + } + + public SendWhatsappMessageRequest templateId(Integer templateId) { + + this.templateId = templateId; + return this; + } + + /** + * ID of the template to send + * @return templateId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + + public SendWhatsappMessageRequest senderNumber(String senderNumber) { + + this.senderNumber = senderNumber; + return this; + } + + /** + * WhatsApp Number with country code. Example, 85264318721 + * @return senderNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderNumber() { + return senderNumber; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderNumber(String senderNumber) { + this.senderNumber = senderNumber; + } + + + public SendWhatsappMessageRequest params(Object params) { + + this.params = params; + return this; + } + + /** + * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Object params) { + this.params = params; + } + + + public SendWhatsappMessageRequest contactNumbers(List contactNumbers) { + + this.contactNumbers = contactNumbers; + return this; + } + + public SendWhatsappMessageRequest addContactNumbersItem(String contactNumbersItem) { + if (this.contactNumbers == null) { + this.contactNumbers = new ArrayList<>(); + } + this.contactNumbers.add(contactNumbersItem); + return this; + } + + /** + * List of phone numbers of the contacts + * @return contactNumbers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContactNumbers() { + return contactNumbers; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContactNumbers(List contactNumbers) { + this.contactNumbers = contactNumbers; + } + + + public SendWhatsappMessageRequest text(String text) { + + this.text = text; + return this; + } + + /** + * Text to be sent as message body (will be overridden if templateId is passed in the same request) + * @return text + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(String text) { + this.text = text; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendWhatsappMessageRequest sendWhatsappMessageRequest = (SendWhatsappMessageRequest) o; + return Objects.equals(this.templateId, sendWhatsappMessageRequest.templateId) && + Objects.equals(this.senderNumber, sendWhatsappMessageRequest.senderNumber) && + Objects.equals(this.params, sendWhatsappMessageRequest.params) && + Objects.equals(this.contactNumbers, sendWhatsappMessageRequest.contactNumbers) && + Objects.equals(this.text, sendWhatsappMessageRequest.text); + } + + @Override + public int hashCode() { + return Objects.hash(templateId, senderNumber, params, contactNumbers, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendWhatsappMessageRequest {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" senderNumber: ").append(toIndentedString(senderNumber)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contactNumbers: ").append(toIndentedString(contactNumbers)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `senderNumber` to the URL query string + if (getSenderNumber() != null) { + try { + joiner.add(String.format("%ssenderNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `params` to the URL query string + if (getParams() != null) { + try { + joiner.add(String.format("%sparams%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getParams()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactNumbers` to the URL query string + if (getContactNumbers() != null) { + for (int i = 0; i < getContactNumbers().size(); i++) { + try { + joiner.add(String.format("%scontactNumbers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactNumbers().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageTemplate.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageTemplate.java new file mode 100644 index 0000000..3e55c3d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageTemplate.java @@ -0,0 +1,293 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendWhatsappMessageTemplate + */ +@JsonPropertyOrder({ + SendWhatsappMessageTemplate.JSON_PROPERTY_TEMPLATE_ID, + SendWhatsappMessageTemplate.JSON_PROPERTY_SENDER_NUMBER, + SendWhatsappMessageTemplate.JSON_PROPERTY_PARAMS, + SendWhatsappMessageTemplate.JSON_PROPERTY_CONTACT_NUMBERS +}) +@JsonTypeName("sendWhatsappMessageTemplate") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendWhatsappMessageTemplate { + public static final String JSON_PROPERTY_TEMPLATE_ID = "templateId"; + private Integer templateId; + + public static final String JSON_PROPERTY_SENDER_NUMBER = "senderNumber"; + private String senderNumber; + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Object params; + + public static final String JSON_PROPERTY_CONTACT_NUMBERS = "contactNumbers"; + private List contactNumbers = new ArrayList<>(); + + public SendWhatsappMessageTemplate() { + } + + public SendWhatsappMessageTemplate templateId(Integer templateId) { + + this.templateId = templateId; + return this; + } + + /** + * ID of the template to send + * @return templateId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + + public SendWhatsappMessageTemplate senderNumber(String senderNumber) { + + this.senderNumber = senderNumber; + return this; + } + + /** + * WhatsApp Number with country code. Example, 85264318721 + * @return senderNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderNumber() { + return senderNumber; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderNumber(String senderNumber) { + this.senderNumber = senderNumber; + } + + + public SendWhatsappMessageTemplate params(Object params) { + + this.params = params; + return this; + } + + /** + * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Object params) { + this.params = params; + } + + + public SendWhatsappMessageTemplate contactNumbers(List contactNumbers) { + + this.contactNumbers = contactNumbers; + return this; + } + + public SendWhatsappMessageTemplate addContactNumbersItem(String contactNumbersItem) { + if (this.contactNumbers == null) { + this.contactNumbers = new ArrayList<>(); + } + this.contactNumbers.add(contactNumbersItem); + return this; + } + + /** + * List of phone numbers of the contacts + * @return contactNumbers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContactNumbers() { + return contactNumbers; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContactNumbers(List contactNumbers) { + this.contactNumbers = contactNumbers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendWhatsappMessageTemplate sendWhatsappMessageTemplate = (SendWhatsappMessageTemplate) o; + return Objects.equals(this.templateId, sendWhatsappMessageTemplate.templateId) && + Objects.equals(this.senderNumber, sendWhatsappMessageTemplate.senderNumber) && + Objects.equals(this.params, sendWhatsappMessageTemplate.params) && + Objects.equals(this.contactNumbers, sendWhatsappMessageTemplate.contactNumbers); + } + + @Override + public int hashCode() { + return Objects.hash(templateId, senderNumber, params, contactNumbers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendWhatsappMessageTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" senderNumber: ").append(toIndentedString(senderNumber)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contactNumbers: ").append(toIndentedString(contactNumbers)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `templateId` to the URL query string + if (getTemplateId() != null) { + try { + joiner.add(String.format("%stemplateId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `senderNumber` to the URL query string + if (getSenderNumber() != null) { + try { + joiner.add(String.format("%ssenderNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `params` to the URL query string + if (getParams() != null) { + try { + joiner.add(String.format("%sparams%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getParams()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactNumbers` to the URL query string + if (getContactNumbers() != null) { + for (int i = 0; i < getContactNumbers().size(); i++) { + try { + joiner.add(String.format("%scontactNumbers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactNumbers().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageText.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageText.java new file mode 100644 index 0000000..801e433 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SendWhatsappMessageText.java @@ -0,0 +1,251 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SendWhatsappMessageText + */ +@JsonPropertyOrder({ + SendWhatsappMessageText.JSON_PROPERTY_SENDER_NUMBER, + SendWhatsappMessageText.JSON_PROPERTY_TEXT, + SendWhatsappMessageText.JSON_PROPERTY_CONTACT_NUMBERS +}) +@JsonTypeName("sendWhatsappMessageText") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SendWhatsappMessageText { + public static final String JSON_PROPERTY_SENDER_NUMBER = "senderNumber"; + private String senderNumber; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_CONTACT_NUMBERS = "contactNumbers"; + private List contactNumbers = new ArrayList<>(); + + public SendWhatsappMessageText() { + } + + public SendWhatsappMessageText senderNumber(String senderNumber) { + + this.senderNumber = senderNumber; + return this; + } + + /** + * WhatsApp Number with country code. Example, 85264318721 + * @return senderNumber + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSenderNumber() { + return senderNumber; + } + + + @JsonProperty(JSON_PROPERTY_SENDER_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSenderNumber(String senderNumber) { + this.senderNumber = senderNumber; + } + + + public SendWhatsappMessageText text(String text) { + + this.text = text; + return this; + } + + /** + * Text to be sent as message body (will be overridden if templateId is passed in the same request) + * @return text + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(String text) { + this.text = text; + } + + + public SendWhatsappMessageText contactNumbers(List contactNumbers) { + + this.contactNumbers = contactNumbers; + return this; + } + + public SendWhatsappMessageText addContactNumbersItem(String contactNumbersItem) { + if (this.contactNumbers == null) { + this.contactNumbers = new ArrayList<>(); + } + this.contactNumbers.add(contactNumbersItem); + return this; + } + + /** + * List of phone numbers of the contacts + * @return contactNumbers + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContactNumbers() { + return contactNumbers; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_NUMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContactNumbers(List contactNumbers) { + this.contactNumbers = contactNumbers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendWhatsappMessageText sendWhatsappMessageText = (SendWhatsappMessageText) o; + return Objects.equals(this.senderNumber, sendWhatsappMessageText.senderNumber) && + Objects.equals(this.text, sendWhatsappMessageText.text) && + Objects.equals(this.contactNumbers, sendWhatsappMessageText.contactNumbers); + } + + @Override + public int hashCode() { + return Objects.hash(senderNumber, text, contactNumbers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendWhatsappMessageText {\n"); + sb.append(" senderNumber: ").append(toIndentedString(senderNumber)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" contactNumbers: ").append(toIndentedString(contactNumbers)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `senderNumber` to the URL query string + if (getSenderNumber() != null) { + try { + joiner.add(String.format("%ssenderNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSenderNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `text` to the URL query string + if (getText() != null) { + try { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactNumbers` to the URL query string + if (getContactNumbers() != null) { + for (int i = 0; i < getContactNumbers().size(); i++) { + try { + joiner.add(String.format("%scontactNumbers%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactNumbers().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountAppsToggleRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountAppsToggleRequest.java new file mode 100644 index 0000000..24c1269 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountAppsToggleRequest.java @@ -0,0 +1,656 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of enable/disable applications on the sub-account + */ +@JsonPropertyOrder({ + SubAccountAppsToggleRequest.JSON_PROPERTY_INBOX, + SubAccountAppsToggleRequest.JSON_PROPERTY_WHATSAPP, + SubAccountAppsToggleRequest.JSON_PROPERTY_AUTOMATION, + SubAccountAppsToggleRequest.JSON_PROPERTY_EMAIL_CAMPAIGNS, + SubAccountAppsToggleRequest.JSON_PROPERTY_SMS_CAMPAIGNS, + SubAccountAppsToggleRequest.JSON_PROPERTY_LANDING_PAGES, + SubAccountAppsToggleRequest.JSON_PROPERTY_TRANSACTIONAL_EMAILS, + SubAccountAppsToggleRequest.JSON_PROPERTY_TRANSACTIONAL_SMS, + SubAccountAppsToggleRequest.JSON_PROPERTY_FACEBOOK_ADS, + SubAccountAppsToggleRequest.JSON_PROPERTY_WEB_PUSH, + SubAccountAppsToggleRequest.JSON_PROPERTY_MEETINGS, + SubAccountAppsToggleRequest.JSON_PROPERTY_CONVERSATIONS, + SubAccountAppsToggleRequest.JSON_PROPERTY_CRM +}) +@JsonTypeName("subAccountAppsToggleRequest") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountAppsToggleRequest { + public static final String JSON_PROPERTY_INBOX = "inbox"; + private Boolean inbox; + + public static final String JSON_PROPERTY_WHATSAPP = "whatsapp"; + private Boolean whatsapp; + + public static final String JSON_PROPERTY_AUTOMATION = "automation"; + private Boolean automation; + + public static final String JSON_PROPERTY_EMAIL_CAMPAIGNS = "email-campaigns"; + private Boolean emailCampaigns; + + public static final String JSON_PROPERTY_SMS_CAMPAIGNS = "sms-campaigns"; + private Boolean smsCampaigns; + + public static final String JSON_PROPERTY_LANDING_PAGES = "landing-pages"; + private Boolean landingPages; + + public static final String JSON_PROPERTY_TRANSACTIONAL_EMAILS = "transactional-emails"; + private Boolean transactionalEmails; + + public static final String JSON_PROPERTY_TRANSACTIONAL_SMS = "transactional-sms"; + private Boolean transactionalSms; + + public static final String JSON_PROPERTY_FACEBOOK_ADS = "facebook-ads"; + private Boolean facebookAds; + + public static final String JSON_PROPERTY_WEB_PUSH = "web-push"; + private Boolean webPush; + + public static final String JSON_PROPERTY_MEETINGS = "meetings"; + private Boolean meetings; + + public static final String JSON_PROPERTY_CONVERSATIONS = "conversations"; + private Boolean conversations; + + public static final String JSON_PROPERTY_CRM = "crm"; + private Boolean crm; + + public SubAccountAppsToggleRequest() { + } + + public SubAccountAppsToggleRequest inbox(Boolean inbox) { + + this.inbox = inbox; + return this; + } + + /** + * Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2 + * @return inbox + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInbox() { + return inbox; + } + + + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInbox(Boolean inbox) { + this.inbox = inbox; + } + + + public SubAccountAppsToggleRequest whatsapp(Boolean whatsapp) { + + this.whatsapp = whatsapp; + return this; + } + + /** + * Set this field to enable or disable Whatsapp campaigns on the sub-account + * @return whatsapp + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHATSAPP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getWhatsapp() { + return whatsapp; + } + + + @JsonProperty(JSON_PROPERTY_WHATSAPP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhatsapp(Boolean whatsapp) { + this.whatsapp = whatsapp; + } + + + public SubAccountAppsToggleRequest automation(Boolean automation) { + + this.automation = automation; + return this; + } + + /** + * Set this field to enable or disable Automation on the sub-account + * @return automation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAutomation() { + return automation; + } + + + @JsonProperty(JSON_PROPERTY_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomation(Boolean automation) { + this.automation = automation; + } + + + public SubAccountAppsToggleRequest emailCampaigns(Boolean emailCampaigns) { + + this.emailCampaigns = emailCampaigns; + return this; + } + + /** + * Set this field to enable or disable Email Campaigns on the sub-account + * @return emailCampaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmailCampaigns() { + return emailCampaigns; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailCampaigns(Boolean emailCampaigns) { + this.emailCampaigns = emailCampaigns; + } + + + public SubAccountAppsToggleRequest smsCampaigns(Boolean smsCampaigns) { + + this.smsCampaigns = smsCampaigns; + return this; + } + + /** + * Set this field to enable or disable SMS Marketing on the sub-account + * @return smsCampaigns + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsCampaigns() { + return smsCampaigns; + } + + + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsCampaigns(Boolean smsCampaigns) { + this.smsCampaigns = smsCampaigns; + } + + + public SubAccountAppsToggleRequest landingPages(Boolean landingPages) { + + this.landingPages = landingPages; + return this; + } + + /** + * Set this field to enable or disable Landing pages on the sub-account + * @return landingPages + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANDING_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getLandingPages() { + return landingPages; + } + + + @JsonProperty(JSON_PROPERTY_LANDING_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLandingPages(Boolean landingPages) { + this.landingPages = landingPages; + } + + + public SubAccountAppsToggleRequest transactionalEmails(Boolean transactionalEmails) { + + this.transactionalEmails = transactionalEmails; + return this; + } + + /** + * Set this field to enable or disable Transactional Email on the sub-account + * @return transactionalEmails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTransactionalEmails() { + return transactionalEmails; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionalEmails(Boolean transactionalEmails) { + this.transactionalEmails = transactionalEmails; + } + + + public SubAccountAppsToggleRequest transactionalSms(Boolean transactionalSms) { + + this.transactionalSms = transactionalSms; + return this; + } + + /** + * Set this field to enable or disable Transactional SMS on the sub-account + * @return transactionalSms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTransactionalSms() { + return transactionalSms; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionalSms(Boolean transactionalSms) { + this.transactionalSms = transactionalSms; + } + + + public SubAccountAppsToggleRequest facebookAds(Boolean facebookAds) { + + this.facebookAds = facebookAds; + return this; + } + + /** + * Set this field to enable or disable Facebook ads on the sub-account + * @return facebookAds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FACEBOOK_ADS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getFacebookAds() { + return facebookAds; + } + + + @JsonProperty(JSON_PROPERTY_FACEBOOK_ADS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFacebookAds(Boolean facebookAds) { + this.facebookAds = facebookAds; + } + + + public SubAccountAppsToggleRequest webPush(Boolean webPush) { + + this.webPush = webPush; + return this; + } + + /** + * Set this field to enable or disable Web Push on the sub-account + * @return webPush + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEB_PUSH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getWebPush() { + return webPush; + } + + + @JsonProperty(JSON_PROPERTY_WEB_PUSH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebPush(Boolean webPush) { + this.webPush = webPush; + } + + + public SubAccountAppsToggleRequest meetings(Boolean meetings) { + + this.meetings = meetings; + return this; + } + + /** + * Set this field to enable or disable Meetings on the sub-account + * @return meetings + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEETINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMeetings() { + return meetings; + } + + + @JsonProperty(JSON_PROPERTY_MEETINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMeetings(Boolean meetings) { + this.meetings = meetings; + } + + + public SubAccountAppsToggleRequest conversations(Boolean conversations) { + + this.conversations = conversations; + return this; + } + + /** + * Set this field to enable or disable Conversations on the sub-account + * @return conversations + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONVERSATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getConversations() { + return conversations; + } + + + @JsonProperty(JSON_PROPERTY_CONVERSATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConversations(Boolean conversations) { + this.conversations = conversations; + } + + + public SubAccountAppsToggleRequest crm(Boolean crm) { + + this.crm = crm; + return this; + } + + /** + * Set this field to enable or disable Sales CRM on the sub-account + * @return crm + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CRM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCrm() { + return crm; + } + + + @JsonProperty(JSON_PROPERTY_CRM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrm(Boolean crm) { + this.crm = crm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountAppsToggleRequest subAccountAppsToggleRequest = (SubAccountAppsToggleRequest) o; + return Objects.equals(this.inbox, subAccountAppsToggleRequest.inbox) && + Objects.equals(this.whatsapp, subAccountAppsToggleRequest.whatsapp) && + Objects.equals(this.automation, subAccountAppsToggleRequest.automation) && + Objects.equals(this.emailCampaigns, subAccountAppsToggleRequest.emailCampaigns) && + Objects.equals(this.smsCampaigns, subAccountAppsToggleRequest.smsCampaigns) && + Objects.equals(this.landingPages, subAccountAppsToggleRequest.landingPages) && + Objects.equals(this.transactionalEmails, subAccountAppsToggleRequest.transactionalEmails) && + Objects.equals(this.transactionalSms, subAccountAppsToggleRequest.transactionalSms) && + Objects.equals(this.facebookAds, subAccountAppsToggleRequest.facebookAds) && + Objects.equals(this.webPush, subAccountAppsToggleRequest.webPush) && + Objects.equals(this.meetings, subAccountAppsToggleRequest.meetings) && + Objects.equals(this.conversations, subAccountAppsToggleRequest.conversations) && + Objects.equals(this.crm, subAccountAppsToggleRequest.crm); + } + + @Override + public int hashCode() { + return Objects.hash(inbox, whatsapp, automation, emailCampaigns, smsCampaigns, landingPages, transactionalEmails, transactionalSms, facebookAds, webPush, meetings, conversations, crm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountAppsToggleRequest {\n"); + sb.append(" inbox: ").append(toIndentedString(inbox)).append("\n"); + sb.append(" whatsapp: ").append(toIndentedString(whatsapp)).append("\n"); + sb.append(" automation: ").append(toIndentedString(automation)).append("\n"); + sb.append(" emailCampaigns: ").append(toIndentedString(emailCampaigns)).append("\n"); + sb.append(" smsCampaigns: ").append(toIndentedString(smsCampaigns)).append("\n"); + sb.append(" landingPages: ").append(toIndentedString(landingPages)).append("\n"); + sb.append(" transactionalEmails: ").append(toIndentedString(transactionalEmails)).append("\n"); + sb.append(" transactionalSms: ").append(toIndentedString(transactionalSms)).append("\n"); + sb.append(" facebookAds: ").append(toIndentedString(facebookAds)).append("\n"); + sb.append(" webPush: ").append(toIndentedString(webPush)).append("\n"); + sb.append(" meetings: ").append(toIndentedString(meetings)).append("\n"); + sb.append(" conversations: ").append(toIndentedString(conversations)).append("\n"); + sb.append(" crm: ").append(toIndentedString(crm)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `inbox` to the URL query string + if (getInbox() != null) { + try { + joiner.add(String.format("%sinbox%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInbox()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `whatsapp` to the URL query string + if (getWhatsapp() != null) { + try { + joiner.add(String.format("%swhatsapp%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWhatsapp()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `automation` to the URL query string + if (getAutomation() != null) { + try { + joiner.add(String.format("%sautomation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAutomation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email-campaigns` to the URL query string + if (getEmailCampaigns() != null) { + try { + joiner.add(String.format("%semail-campaigns%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailCampaigns()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sms-campaigns` to the URL query string + if (getSmsCampaigns() != null) { + try { + joiner.add(String.format("%ssms-campaigns%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsCampaigns()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `landing-pages` to the URL query string + if (getLandingPages() != null) { + try { + joiner.add(String.format("%slanding-pages%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLandingPages()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `transactional-emails` to the URL query string + if (getTransactionalEmails() != null) { + try { + joiner.add(String.format("%stransactional-emails%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTransactionalEmails()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `transactional-sms` to the URL query string + if (getTransactionalSms() != null) { + try { + joiner.add(String.format("%stransactional-sms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTransactionalSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `facebook-ads` to the URL query string + if (getFacebookAds() != null) { + try { + joiner.add(String.format("%sfacebook-ads%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFacebookAds()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `web-push` to the URL query string + if (getWebPush() != null) { + try { + joiner.add(String.format("%sweb-push%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWebPush()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `meetings` to the URL query string + if (getMeetings() != null) { + try { + joiner.add(String.format("%smeetings%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMeetings()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `conversations` to the URL query string + if (getConversations() != null) { + try { + joiner.add(String.format("%sconversations%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getConversations()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `crm` to the URL query string + if (getCrm() != null) { + try { + joiner.add(String.format("%scrm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCrm()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponse.java new file mode 100644 index 0000000..3e3c69e --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponse.java @@ -0,0 +1,274 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SubAccountDetailsResponse + */ +@JsonPropertyOrder({ + SubAccountDetailsResponse.JSON_PROPERTY_NAME, + SubAccountDetailsResponse.JSON_PROPERTY_EMAIL, + SubAccountDetailsResponse.JSON_PROPERTY_COMPANY_NAME, + SubAccountDetailsResponse.JSON_PROPERTY_PLAN_INFO +}) +@JsonTypeName("subAccountDetailsResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponse { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_PLAN_INFO = "planInfo"; + private SubAccountDetailsResponsePlanInfo planInfo; + + public SubAccountDetailsResponse() { + } + + public SubAccountDetailsResponse name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the sub-account user + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public SubAccountDetailsResponse email(String email) { + + this.email = email; + return this; + } + + /** + * Email id of the sub-account organization + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public SubAccountDetailsResponse companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Sub-account company name + * @return companyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public SubAccountDetailsResponse planInfo(SubAccountDetailsResponsePlanInfo planInfo) { + + this.planInfo = planInfo; + return this; + } + + /** + * Get planInfo + * @return planInfo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLAN_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfo getPlanInfo() { + return planInfo; + } + + + @JsonProperty(JSON_PROPERTY_PLAN_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlanInfo(SubAccountDetailsResponsePlanInfo planInfo) { + this.planInfo = planInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponse subAccountDetailsResponse = (SubAccountDetailsResponse) o; + return Objects.equals(this.name, subAccountDetailsResponse.name) && + Objects.equals(this.email, subAccountDetailsResponse.email) && + Objects.equals(this.companyName, subAccountDetailsResponse.companyName) && + Objects.equals(this.planInfo, subAccountDetailsResponse.planInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, companyName, planInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" planInfo: ").append(toIndentedString(planInfo)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `planInfo` to the URL query string + if (getPlanInfo() != null) { + joiner.add(getPlanInfo().toUrlQueryString(prefix + "planInfo" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfo.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfo.java new file mode 100644 index 0000000..ca1c924 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfo.java @@ -0,0 +1,228 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoCredits; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoFeatures; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Sub-account plan details + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfo.JSON_PROPERTY_CREDITS, + SubAccountDetailsResponsePlanInfo.JSON_PROPERTY_FEATURES, + SubAccountDetailsResponsePlanInfo.JSON_PROPERTY_PLAN_TYPE +}) +@JsonTypeName("subAccountDetailsResponse_planInfo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfo { + public static final String JSON_PROPERTY_CREDITS = "credits"; + private SubAccountDetailsResponsePlanInfoCredits credits; + + public static final String JSON_PROPERTY_FEATURES = "features"; + private SubAccountDetailsResponsePlanInfoFeatures features; + + public static final String JSON_PROPERTY_PLAN_TYPE = "planType"; + private String planType; + + public SubAccountDetailsResponsePlanInfo() { + } + + public SubAccountDetailsResponsePlanInfo credits(SubAccountDetailsResponsePlanInfoCredits credits) { + + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoCredits getCredits() { + return credits; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredits(SubAccountDetailsResponsePlanInfoCredits credits) { + this.credits = credits; + } + + + public SubAccountDetailsResponsePlanInfo features(SubAccountDetailsResponsePlanInfoFeatures features) { + + this.features = features; + return this; + } + + /** + * Get features + * @return features + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoFeatures getFeatures() { + return features; + } + + + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeatures(SubAccountDetailsResponsePlanInfoFeatures features) { + this.features = features; + } + + + public SubAccountDetailsResponsePlanInfo planType(String planType) { + + this.planType = planType; + return this; + } + + /** + * type of the plan + * @return planType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLAN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPlanType() { + return planType; + } + + + @JsonProperty(JSON_PROPERTY_PLAN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlanType(String planType) { + this.planType = planType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfo subAccountDetailsResponsePlanInfo = (SubAccountDetailsResponsePlanInfo) o; + return Objects.equals(this.credits, subAccountDetailsResponsePlanInfo.credits) && + Objects.equals(this.features, subAccountDetailsResponsePlanInfo.features) && + Objects.equals(this.planType, subAccountDetailsResponsePlanInfo.planType); + } + + @Override + public int hashCode() { + return Objects.hash(credits, features, planType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfo {\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); + sb.append(" planType: ").append(toIndentedString(planType)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `credits` to the URL query string + if (getCredits() != null) { + joiner.add(getCredits().toUrlQueryString(prefix + "credits" + suffix)); + } + + // add `features` to the URL query string + if (getFeatures() != null) { + joiner.add(getFeatures().toUrlQueryString(prefix + "features" + suffix)); + } + + // add `planType` to the URL query string + if (getPlanType() != null) { + try { + joiner.add(String.format("%splanType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPlanType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCredits.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCredits.java new file mode 100644 index 0000000..bd29fac --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCredits.java @@ -0,0 +1,190 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoCreditsEmails; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Credits quota and remaining credits on the sub-account + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoCredits.JSON_PROPERTY_SMS, + SubAccountDetailsResponsePlanInfoCredits.JSON_PROPERTY_EMAILS +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_credits") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoCredits { + public static final String JSON_PROPERTY_SMS = "sms"; + private Long sms; + + public static final String JSON_PROPERTY_EMAILS = "emails"; + private SubAccountDetailsResponsePlanInfoCreditsEmails emails; + + public SubAccountDetailsResponsePlanInfoCredits() { + } + + public SubAccountDetailsResponsePlanInfoCredits sms(Long sms) { + + this.sms = sms; + return this; + } + + /** + * SMS credits remaining on the sub-account + * @return sms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSms(Long sms) { + this.sms = sms; + } + + + public SubAccountDetailsResponsePlanInfoCredits emails(SubAccountDetailsResponsePlanInfoCreditsEmails emails) { + + this.emails = emails; + return this; + } + + /** + * Get emails + * @return emails + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoCreditsEmails getEmails() { + return emails; + } + + + @JsonProperty(JSON_PROPERTY_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmails(SubAccountDetailsResponsePlanInfoCreditsEmails emails) { + this.emails = emails; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoCredits subAccountDetailsResponsePlanInfoCredits = (SubAccountDetailsResponsePlanInfoCredits) o; + return Objects.equals(this.sms, subAccountDetailsResponsePlanInfoCredits.sms) && + Objects.equals(this.emails, subAccountDetailsResponsePlanInfoCredits.emails); + } + + @Override + public int hashCode() { + return Objects.hash(sms, emails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoCredits {\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" emails: ").append(toIndentedString(emails)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emails` to the URL query string + if (getEmails() != null) { + joiner.add(getEmails().toUrlQueryString(prefix + "emails" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCreditsEmails.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCreditsEmails.java new file mode 100644 index 0000000..2b3dd5d --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoCreditsEmails.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Email credits remaining on the sub-account + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoCreditsEmails.JSON_PROPERTY_QUANTITY, + SubAccountDetailsResponsePlanInfoCreditsEmails.JSON_PROPERTY_REMAINING +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_credits_emails") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoCreditsEmails { + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public SubAccountDetailsResponsePlanInfoCreditsEmails() { + } + + public SubAccountDetailsResponsePlanInfoCreditsEmails quantity(Long quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Quantity of email messaging limits provided + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + + public SubAccountDetailsResponsePlanInfoCreditsEmails remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Available email messaging limits for use + * @return remaining + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoCreditsEmails subAccountDetailsResponsePlanInfoCreditsEmails = (SubAccountDetailsResponsePlanInfoCreditsEmails) o; + return Objects.equals(this.quantity, subAccountDetailsResponsePlanInfoCreditsEmails.quantity) && + Objects.equals(this.remaining, subAccountDetailsResponsePlanInfoCreditsEmails.remaining); + } + + @Override + public int hashCode() { + return Objects.hash(quantity, remaining); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoCreditsEmails {\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeatures.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeatures.java new file mode 100644 index 0000000..a3c7dba --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeatures.java @@ -0,0 +1,224 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoFeaturesInbox; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoFeaturesLandingPage; +import software.xdev.brevo.model.SubAccountDetailsResponsePlanInfoFeaturesUsers; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Features available on the sub-account + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoFeatures.JSON_PROPERTY_INBOX, + SubAccountDetailsResponsePlanInfoFeatures.JSON_PROPERTY_LANDING_PAGE, + SubAccountDetailsResponsePlanInfoFeatures.JSON_PROPERTY_USERS +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_features") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoFeatures { + public static final String JSON_PROPERTY_INBOX = "inbox"; + private SubAccountDetailsResponsePlanInfoFeaturesInbox inbox; + + public static final String JSON_PROPERTY_LANDING_PAGE = "landingPage"; + private SubAccountDetailsResponsePlanInfoFeaturesLandingPage landingPage; + + public static final String JSON_PROPERTY_USERS = "users"; + private SubAccountDetailsResponsePlanInfoFeaturesUsers users; + + public SubAccountDetailsResponsePlanInfoFeatures() { + } + + public SubAccountDetailsResponsePlanInfoFeatures inbox(SubAccountDetailsResponsePlanInfoFeaturesInbox inbox) { + + this.inbox = inbox; + return this; + } + + /** + * Get inbox + * @return inbox + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoFeaturesInbox getInbox() { + return inbox; + } + + + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInbox(SubAccountDetailsResponsePlanInfoFeaturesInbox inbox) { + this.inbox = inbox; + } + + + public SubAccountDetailsResponsePlanInfoFeatures landingPage(SubAccountDetailsResponsePlanInfoFeaturesLandingPage landingPage) { + + this.landingPage = landingPage; + return this; + } + + /** + * Get landingPage + * @return landingPage + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANDING_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoFeaturesLandingPage getLandingPage() { + return landingPage; + } + + + @JsonProperty(JSON_PROPERTY_LANDING_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLandingPage(SubAccountDetailsResponsePlanInfoFeaturesLandingPage landingPage) { + this.landingPage = landingPage; + } + + + public SubAccountDetailsResponsePlanInfoFeatures users(SubAccountDetailsResponsePlanInfoFeaturesUsers users) { + + this.users = users; + return this; + } + + /** + * Get users + * @return users + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountDetailsResponsePlanInfoFeaturesUsers getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(SubAccountDetailsResponsePlanInfoFeaturesUsers users) { + this.users = users; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoFeatures subAccountDetailsResponsePlanInfoFeatures = (SubAccountDetailsResponsePlanInfoFeatures) o; + return Objects.equals(this.inbox, subAccountDetailsResponsePlanInfoFeatures.inbox) && + Objects.equals(this.landingPage, subAccountDetailsResponsePlanInfoFeatures.landingPage) && + Objects.equals(this.users, subAccountDetailsResponsePlanInfoFeatures.users); + } + + @Override + public int hashCode() { + return Objects.hash(inbox, landingPage, users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoFeatures {\n"); + sb.append(" inbox: ").append(toIndentedString(inbox)).append("\n"); + sb.append(" landingPage: ").append(toIndentedString(landingPage)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `inbox` to the URL query string + if (getInbox() != null) { + joiner.add(getInbox().toUrlQueryString(prefix + "inbox" + suffix)); + } + + // add `landingPage` to the URL query string + if (getLandingPage() != null) { + joiner.add(getLandingPage().toUrlQueryString(prefix + "landingPage" + suffix)); + } + + // add `users` to the URL query string + if (getUsers() != null) { + joiner.add(getUsers().toUrlQueryString(prefix + "users" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesInbox.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesInbox.java new file mode 100644 index 0000000..0232d2a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesInbox.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Inbox details / Not available on ENTv2 + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoFeaturesInbox.JSON_PROPERTY_QUANTITY, + SubAccountDetailsResponsePlanInfoFeaturesInbox.JSON_PROPERTY_REMAINING +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_features_inbox") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoFeaturesInbox { + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public SubAccountDetailsResponsePlanInfoFeaturesInbox() { + } + + public SubAccountDetailsResponsePlanInfoFeaturesInbox quantity(Long quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Quantity of inbox provided + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + + public SubAccountDetailsResponsePlanInfoFeaturesInbox remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Available inboxes for use + * @return remaining + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoFeaturesInbox subAccountDetailsResponsePlanInfoFeaturesInbox = (SubAccountDetailsResponsePlanInfoFeaturesInbox) o; + return Objects.equals(this.quantity, subAccountDetailsResponsePlanInfoFeaturesInbox.quantity) && + Objects.equals(this.remaining, subAccountDetailsResponsePlanInfoFeaturesInbox.remaining); + } + + @Override + public int hashCode() { + return Objects.hash(quantity, remaining); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoFeaturesInbox {\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.java new file mode 100644 index 0000000..bc8dc17 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Landing page details / Not available on ENTv2 + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoFeaturesLandingPage.JSON_PROPERTY_QUANTITY, + SubAccountDetailsResponsePlanInfoFeaturesLandingPage.JSON_PROPERTY_REMAINING +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_features_landingPage") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoFeaturesLandingPage { + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public SubAccountDetailsResponsePlanInfoFeaturesLandingPage() { + } + + public SubAccountDetailsResponsePlanInfoFeaturesLandingPage quantity(Long quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Quantity of landing pages provided + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + + public SubAccountDetailsResponsePlanInfoFeaturesLandingPage remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Available landing pages for use + * @return remaining + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoFeaturesLandingPage subAccountDetailsResponsePlanInfoFeaturesLandingPage = (SubAccountDetailsResponsePlanInfoFeaturesLandingPage) o; + return Objects.equals(this.quantity, subAccountDetailsResponsePlanInfoFeaturesLandingPage.quantity) && + Objects.equals(this.remaining, subAccountDetailsResponsePlanInfoFeaturesLandingPage.remaining); + } + + @Override + public int hashCode() { + return Objects.hash(quantity, remaining); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoFeaturesLandingPage {\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesUsers.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesUsers.java new file mode 100644 index 0000000..660e301 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountDetailsResponsePlanInfoFeaturesUsers.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Multi-account details + */ +@JsonPropertyOrder({ + SubAccountDetailsResponsePlanInfoFeaturesUsers.JSON_PROPERTY_QUANTITY, + SubAccountDetailsResponsePlanInfoFeaturesUsers.JSON_PROPERTY_REMAINING +}) +@JsonTypeName("subAccountDetailsResponse_planInfo_features_users") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountDetailsResponsePlanInfoFeaturesUsers { + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_REMAINING = "remaining"; + private Long remaining; + + public SubAccountDetailsResponsePlanInfoFeaturesUsers() { + } + + public SubAccountDetailsResponsePlanInfoFeaturesUsers quantity(Long quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Quantity of multi-account's provided + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + + public SubAccountDetailsResponsePlanInfoFeaturesUsers remaining(Long remaining) { + + this.remaining = remaining; + return this; + } + + /** + * Available multi-accounts for use + * @return remaining + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getRemaining() { + return remaining; + } + + + @JsonProperty(JSON_PROPERTY_REMAINING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemaining(Long remaining) { + this.remaining = remaining; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountDetailsResponsePlanInfoFeaturesUsers subAccountDetailsResponsePlanInfoFeaturesUsers = (SubAccountDetailsResponsePlanInfoFeaturesUsers) o; + return Objects.equals(this.quantity, subAccountDetailsResponsePlanInfoFeaturesUsers.quantity) && + Objects.equals(this.remaining, subAccountDetailsResponsePlanInfoFeaturesUsers.remaining); + } + + @Override + public int hashCode() { + return Objects.hash(quantity, remaining); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountDetailsResponsePlanInfoFeaturesUsers {\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" remaining: ").append(toIndentedString(remaining)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quantity` to the URL query string + if (getQuantity() != null) { + try { + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `remaining` to the URL query string + if (getRemaining() != null) { + try { + joiner.add(String.format("%sremaining%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRemaining()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequest.java new file mode 100644 index 0000000..e40f5bd --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequest.java @@ -0,0 +1,186 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.SubAccountUpdatePlanRequestCredits; +import software.xdev.brevo.model.SubAccountUpdatePlanRequestFeatures; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Details of the plan to be changed + */ +@JsonPropertyOrder({ + SubAccountUpdatePlanRequest.JSON_PROPERTY_CREDITS, + SubAccountUpdatePlanRequest.JSON_PROPERTY_FEATURES +}) +@JsonTypeName("subAccountUpdatePlanRequest") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountUpdatePlanRequest { + public static final String JSON_PROPERTY_CREDITS = "credits"; + private SubAccountUpdatePlanRequestCredits credits; + + public static final String JSON_PROPERTY_FEATURES = "features"; + private SubAccountUpdatePlanRequestFeatures features; + + public SubAccountUpdatePlanRequest() { + } + + public SubAccountUpdatePlanRequest credits(SubAccountUpdatePlanRequestCredits credits) { + + this.credits = credits; + return this; + } + + /** + * Get credits + * @return credits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountUpdatePlanRequestCredits getCredits() { + return credits; + } + + + @JsonProperty(JSON_PROPERTY_CREDITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredits(SubAccountUpdatePlanRequestCredits credits) { + this.credits = credits; + } + + + public SubAccountUpdatePlanRequest features(SubAccountUpdatePlanRequestFeatures features) { + + this.features = features; + return this; + } + + /** + * Get features + * @return features + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubAccountUpdatePlanRequestFeatures getFeatures() { + return features; + } + + + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeatures(SubAccountUpdatePlanRequestFeatures features) { + this.features = features; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountUpdatePlanRequest subAccountUpdatePlanRequest = (SubAccountUpdatePlanRequest) o; + return Objects.equals(this.credits, subAccountUpdatePlanRequest.credits) && + Objects.equals(this.features, subAccountUpdatePlanRequest.features); + } + + @Override + public int hashCode() { + return Objects.hash(credits, features); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountUpdatePlanRequest {\n"); + sb.append(" credits: ").append(toIndentedString(credits)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `credits` to the URL query string + if (getCredits() != null) { + joiner.add(getCredits().toUrlQueryString(prefix + "credits" + suffix)); + } + + // add `features` to the URL query string + if (getFeatures() != null) { + joiner.add(getFeatures().toUrlQueryString(prefix + "features" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestCredits.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestCredits.java new file mode 100644 index 0000000..5e12de2 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestCredits.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Credit details to update + */ +@JsonPropertyOrder({ + SubAccountUpdatePlanRequestCredits.JSON_PROPERTY_EMAIL +}) +@JsonTypeName("subAccountUpdatePlanRequest_credits") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountUpdatePlanRequestCredits { + public static final String JSON_PROPERTY_EMAIL = "email"; + private Long email; + + public SubAccountUpdatePlanRequestCredits() { + } + + public SubAccountUpdatePlanRequestCredits email(Long email) { + + this.email = email; + return this; + } + + /** + * Number of email credits + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(Long email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountUpdatePlanRequestCredits subAccountUpdatePlanRequestCredits = (SubAccountUpdatePlanRequestCredits) o; + return Objects.equals(this.email, subAccountUpdatePlanRequestCredits.email); + } + + @Override + public int hashCode() { + return Objects.hash(email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountUpdatePlanRequestCredits {\n"); + sb.append(" email: ").append(toIndentedString(email)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestFeatures.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestFeatures.java new file mode 100644 index 0000000..36622ef --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountUpdatePlanRequestFeatures.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Features details to update + */ +@JsonPropertyOrder({ + SubAccountUpdatePlanRequestFeatures.JSON_PROPERTY_USERS, + SubAccountUpdatePlanRequestFeatures.JSON_PROPERTY_LANDING_PAGE, + SubAccountUpdatePlanRequestFeatures.JSON_PROPERTY_INBOX +}) +@JsonTypeName("subAccountUpdatePlanRequest_features") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountUpdatePlanRequestFeatures { + public static final String JSON_PROPERTY_USERS = "users"; + private Long users; + + public static final String JSON_PROPERTY_LANDING_PAGE = "landingPage"; + private Long landingPage; + + public static final String JSON_PROPERTY_INBOX = "inbox"; + private Long inbox; + + public SubAccountUpdatePlanRequestFeatures() { + } + + public SubAccountUpdatePlanRequestFeatures users(Long users) { + + this.users = users; + return this; + } + + /** + * Number of multi-users + * @return users + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(Long users) { + this.users = users; + } + + + public SubAccountUpdatePlanRequestFeatures landingPage(Long landingPage) { + + this.landingPage = landingPage; + return this; + } + + /** + * Number of landing pages / Not required on ENTv2 + * @return landingPage + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANDING_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLandingPage() { + return landingPage; + } + + + @JsonProperty(JSON_PROPERTY_LANDING_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLandingPage(Long landingPage) { + this.landingPage = landingPage; + } + + + public SubAccountUpdatePlanRequestFeatures inbox(Long inbox) { + + this.inbox = inbox; + return this; + } + + /** + * Number of inboxes / Not required on ENTv2 + * @return inbox + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInbox() { + return inbox; + } + + + @JsonProperty(JSON_PROPERTY_INBOX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInbox(Long inbox) { + this.inbox = inbox; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountUpdatePlanRequestFeatures subAccountUpdatePlanRequestFeatures = (SubAccountUpdatePlanRequestFeatures) o; + return Objects.equals(this.users, subAccountUpdatePlanRequestFeatures.users) && + Objects.equals(this.landingPage, subAccountUpdatePlanRequestFeatures.landingPage) && + Objects.equals(this.inbox, subAccountUpdatePlanRequestFeatures.inbox); + } + + @Override + public int hashCode() { + return Objects.hash(users, landingPage, inbox); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountUpdatePlanRequestFeatures {\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" landingPage: ").append(toIndentedString(landingPage)).append("\n"); + sb.append(" inbox: ").append(toIndentedString(inbox)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `users` to the URL query string + if (getUsers() != null) { + try { + joiner.add(String.format("%susers%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsers()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `landingPage` to the URL query string + if (getLandingPage() != null) { + try { + joiner.add(String.format("%slandingPage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLandingPage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inbox` to the URL query string + if (getInbox() != null) { + try { + joiner.add(String.format("%sinbox%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInbox()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponse.java new file mode 100644 index 0000000..fd77a17 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponse.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.SubAccountsResponseSubAccountsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SubAccountsResponse + */ +@JsonPropertyOrder({ + SubAccountsResponse.JSON_PROPERTY_COUNT, + SubAccountsResponse.JSON_PROPERTY_SUB_ACCOUNTS +}) +@JsonTypeName("subAccountsResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountsResponse { + public static final String JSON_PROPERTY_COUNT = "count"; + private Integer count; + + public static final String JSON_PROPERTY_SUB_ACCOUNTS = "subAccounts"; + private List subAccounts; + + public SubAccountsResponse() { + } + + public SubAccountsResponse count(Integer count) { + + this.count = count; + return this; + } + + /** + * Total number of subaccounts + * @return count + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCount(Integer count) { + this.count = count; + } + + + public SubAccountsResponse subAccounts(List subAccounts) { + + this.subAccounts = subAccounts; + return this; + } + + public SubAccountsResponse addSubAccountsItem(SubAccountsResponseSubAccountsInner subAccountsItem) { + if (this.subAccounts == null) { + this.subAccounts = new ArrayList<>(); + } + this.subAccounts.add(subAccountsItem); + return this; + } + + /** + * Get subAccounts + * @return subAccounts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSubAccounts() { + return subAccounts; + } + + + @JsonProperty(JSON_PROPERTY_SUB_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubAccounts(List subAccounts) { + this.subAccounts = subAccounts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountsResponse subAccountsResponse = (SubAccountsResponse) o; + return Objects.equals(this.count, subAccountsResponse.count) && + Objects.equals(this.subAccounts, subAccountsResponse.subAccounts); + } + + @Override + public int hashCode() { + return Objects.hash(count, subAccounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountsResponse {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" subAccounts: ").append(toIndentedString(subAccounts)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `count` to the URL query string + if (getCount() != null) { + try { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCount()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subAccounts` to the URL query string + if (getSubAccounts() != null) { + for (int i = 0; i < getSubAccounts().size(); i++) { + if (getSubAccounts().get(i) != null) { + joiner.add(getSubAccounts().get(i).toUrlQueryString(String.format("%ssubAccounts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponseSubAccountsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponseSubAccountsInner.java new file mode 100644 index 0000000..19f7740 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/SubAccountsResponseSubAccountsInner.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SubAccountsResponseSubAccountsInner + */ +@JsonPropertyOrder({ + SubAccountsResponseSubAccountsInner.JSON_PROPERTY_ID, + SubAccountsResponseSubAccountsInner.JSON_PROPERTY_COMPANY_NAME, + SubAccountsResponseSubAccountsInner.JSON_PROPERTY_ACTIVE, + SubAccountsResponseSubAccountsInner.JSON_PROPERTY_CREATED_AT +}) +@JsonTypeName("subAccountsResponse_subAccounts_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubAccountsResponseSubAccountsInner { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_ACTIVE = "active"; + private Boolean active; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private Long createdAt; + + public SubAccountsResponseSubAccountsInner() { + } + + public SubAccountsResponseSubAccountsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * id of the sub-account + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(Long id) { + this.id = id; + } + + + public SubAccountsResponseSubAccountsInner companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * Name of the sub-account company + * @return companyName + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public SubAccountsResponseSubAccountsInner active(Boolean active) { + + this.active = active; + return this; + } + + /** + * Whether the sub-account is active or not + * @return active + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getActive() { + return active; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActive(Boolean active) { + this.active = active; + } + + + public SubAccountsResponseSubAccountsInner createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the sub-account was created + * @return createdAt + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubAccountsResponseSubAccountsInner subAccountsResponseSubAccountsInner = (SubAccountsResponseSubAccountsInner) o; + return Objects.equals(this.id, subAccountsResponseSubAccountsInner.id) && + Objects.equals(this.companyName, subAccountsResponseSubAccountsInner.companyName) && + Objects.equals(this.active, subAccountsResponseSubAccountsInner.active) && + Objects.equals(this.createdAt, subAccountsResponseSubAccountsInner.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, companyName, active, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAccountsResponseSubAccountsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `active` to the URL query string + if (getActive() != null) { + try { + joiner.add(String.format("%sactive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + try { + joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCreatedAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/Task.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Task.java new file mode 100644 index 0000000..5913f60 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/Task.java @@ -0,0 +1,400 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Task Details + */ +@JsonPropertyOrder({ + Task.JSON_PROPERTY_ID, + Task.JSON_PROPERTY_TASK_TYPE_ID, + Task.JSON_PROPERTY_NAME, + Task.JSON_PROPERTY_CONTACTS_IDS, + Task.JSON_PROPERTY_DEALS_IDS, + Task.JSON_PROPERTY_COMPANIES_IDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Task { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TASK_TYPE_ID = "taskTypeId"; + private String taskTypeId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CONTACTS_IDS = "contactsIds"; + private List contactsIds; + + public static final String JSON_PROPERTY_DEALS_IDS = "dealsIds"; + private List dealsIds; + + public static final String JSON_PROPERTY_COMPANIES_IDS = "companiesIds"; + private List companiesIds; + + public Task() { + } + + public Task id(String id) { + + this.id = id; + return this; + } + + /** + * Unique task id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public Task taskTypeId(String taskTypeId) { + + this.taskTypeId = taskTypeId; + return this; + } + + /** + * Id for type of task e.g Call / Email / Meeting etc. + * @return taskTypeId + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTaskTypeId() { + return taskTypeId; + } + + + @JsonProperty(JSON_PROPERTY_TASK_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTaskTypeId(String taskTypeId) { + this.taskTypeId = taskTypeId; + } + + + public Task name(String name) { + + this.name = name; + return this; + } + + /** + * Name of task + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public Task contactsIds(List contactsIds) { + + this.contactsIds = contactsIds; + return this; + } + + public Task addContactsIdsItem(Integer contactsIdsItem) { + if (this.contactsIds == null) { + this.contactsIds = new ArrayList<>(); + } + this.contactsIds.add(contactsIdsItem); + return this; + } + + /** + * Contact ids for contacts linked to this task + * @return contactsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContactsIds() { + return contactsIds; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactsIds(List contactsIds) { + this.contactsIds = contactsIds; + } + + + public Task dealsIds(List dealsIds) { + + this.dealsIds = dealsIds; + return this; + } + + public Task addDealsIdsItem(String dealsIdsItem) { + if (this.dealsIds == null) { + this.dealsIds = new ArrayList<>(); + } + this.dealsIds.add(dealsIdsItem); + return this; + } + + /** + * Deal ids for deals a task is linked to + * @return dealsIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDealsIds() { + return dealsIds; + } + + + @JsonProperty(JSON_PROPERTY_DEALS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDealsIds(List dealsIds) { + this.dealsIds = dealsIds; + } + + + public Task companiesIds(List companiesIds) { + + this.companiesIds = companiesIds; + return this; + } + + public Task addCompaniesIdsItem(String companiesIdsItem) { + if (this.companiesIds == null) { + this.companiesIds = new ArrayList<>(); + } + this.companiesIds.add(companiesIdsItem); + return this; + } + + /** + * Companies ids for companies a task is linked to + * @return companiesIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCompaniesIds() { + return companiesIds; + } + + + @JsonProperty(JSON_PROPERTY_COMPANIES_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompaniesIds(List companiesIds) { + this.companiesIds = companiesIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Task task = (Task) o; + return Objects.equals(this.id, task.id) && + Objects.equals(this.taskTypeId, task.taskTypeId) && + Objects.equals(this.name, task.name) && + Objects.equals(this.contactsIds, task.contactsIds) && + Objects.equals(this.dealsIds, task.dealsIds) && + Objects.equals(this.companiesIds, task.companiesIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, taskTypeId, name, contactsIds, dealsIds, companiesIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Task {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" taskTypeId: ").append(toIndentedString(taskTypeId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" contactsIds: ").append(toIndentedString(contactsIds)).append("\n"); + sb.append(" dealsIds: ").append(toIndentedString(dealsIds)).append("\n"); + sb.append(" companiesIds: ").append(toIndentedString(companiesIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `taskTypeId` to the URL query string + if (getTaskTypeId() != null) { + try { + joiner.add(String.format("%staskTypeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTaskTypeId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contactsIds` to the URL query string + if (getContactsIds() != null) { + for (int i = 0; i < getContactsIds().size(); i++) { + try { + joiner.add(String.format("%scontactsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getContactsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `dealsIds` to the URL query string + if (getDealsIds() != null) { + for (int i = 0; i < getDealsIds().size(); i++) { + try { + joiner.add(String.format("%sdealsIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDealsIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `companiesIds` to the URL query string + if (getCompaniesIds() != null) { + for (int i = 0; i < getCompaniesIds().size(); i++) { + try { + joiner.add(String.format("%scompaniesIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCompaniesIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskList.java new file mode 100644 index 0000000..d71e350 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskList.java @@ -0,0 +1,163 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.Task; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * List of tasks + */ +@JsonPropertyOrder({ + TaskList.JSON_PROPERTY_ITEMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TaskList { + public static final String JSON_PROPERTY_ITEMS = "items"; + private List items; + + public TaskList() { + } + + public TaskList items(List items) { + + this.items = items; + return this; + } + + public TaskList addItemsItem(Task itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * List of tasks + * @return items + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getItems() { + return items; + } + + + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskList taskList = (TaskList) o; + return Objects.equals(this.items, taskList.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskList {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `items` to the URL query string + if (getItems() != null) { + for (int i = 0; i < getItems().size(); i++) { + if (getItems().get(i) != null) { + joiner.add(getItems().get(i).toUrlQueryString(String.format("%sitems%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskReminder.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskReminder.java new file mode 100644 index 0000000..c00819f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskReminder.java @@ -0,0 +1,324 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Task reminder date/time for a task + */ +@JsonPropertyOrder({ + TaskReminder.JSON_PROPERTY_VALUE, + TaskReminder.JSON_PROPERTY_UNIT, + TaskReminder.JSON_PROPERTY_TYPES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TaskReminder { + public static final String JSON_PROPERTY_VALUE = "value"; + private Integer value; + + /** + * Unit of time before reminder is to be sent + */ + public enum UnitEnum { + MINUTES("minutes"), + + HOURS("hours"), + + WEEKS("weeks"), + + DAYS("days"); + + private String value; + + UnitEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UnitEnum fromValue(String value) { + for (UnitEnum b : UnitEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_UNIT = "unit"; + private UnitEnum unit; + + /** + * Gets or Sets types + */ + public enum TypesEnum { + EMAIL("email"), + + PUSH("push"); + + private String value; + + TypesEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypesEnum fromValue(String value) { + for (TypesEnum b : TypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPES = "types"; + private List types = new ArrayList<>(); + + public TaskReminder() { + } + + public TaskReminder value(Integer value) { + + this.value = value; + return this; + } + + /** + * Value of time unit before reminder is to be sent + * @return value + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(Integer value) { + this.value = value; + } + + + public TaskReminder unit(UnitEnum unit) { + + this.unit = unit; + return this; + } + + /** + * Unit of time before reminder is to be sent + * @return unit + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UnitEnum getUnit() { + return unit; + } + + + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnit(UnitEnum unit) { + this.unit = unit; + } + + + public TaskReminder types(List types) { + + this.types = types; + return this; + } + + public TaskReminder addTypesItem(TypesEnum typesItem) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.add(typesItem); + return this; + } + + /** + * Type of task reminder e.g email, push + * @return types + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTypes() { + return types; + } + + + @JsonProperty(JSON_PROPERTY_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTypes(List types) { + this.types = types; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskReminder taskReminder = (TaskReminder) o; + return Objects.equals(this.value, taskReminder.value) && + Objects.equals(this.unit, taskReminder.unit) && + Objects.equals(this.types, taskReminder.types); + } + + @Override + public int hashCode() { + return Objects.hash(value, unit, types); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskReminder {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); + sb.append(" types: ").append(toIndentedString(types)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unit` to the URL query string + if (getUnit() != null) { + try { + joiner.add(String.format("%sunit%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnit()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `types` to the URL query string + if (getTypes() != null) { + for (int i = 0; i < getTypes().size(); i++) { + try { + joiner.add(String.format("%stypes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getTypes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskTypes.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskTypes.java new file mode 100644 index 0000000..d2fd9bc --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/TaskTypes.java @@ -0,0 +1,193 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Task types details + */ +@JsonPropertyOrder({ + TaskTypes.JSON_PROPERTY_ID, + TaskTypes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TaskTypes { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public TaskTypes() { + } + + public TaskTypes id(String id) { + + this.id = id; + return this; + } + + /** + * Id of task type + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public TaskTypes title(String title) { + + this.title = title; + return this; + } + + /** + * Title of task type + * @return title + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaskTypes taskTypes = (TaskTypes) o; + return Objects.equals(this.id, taskTypes.id) && + Objects.equals(this.title, taskTypes.title); + } + + @Override + public int hashCode() { + return Objects.hash(id, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaskTypes {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `title` to the URL query string + if (getTitle() != null) { + try { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTitle()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttribute.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttribute.java new file mode 100644 index 0000000..ca8e1b6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttribute.java @@ -0,0 +1,206 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.UpdateAttributeEnumerationInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateAttribute + */ +@JsonPropertyOrder({ + UpdateAttribute.JSON_PROPERTY_VALUE, + UpdateAttribute.JSON_PROPERTY_ENUMERATION +}) +@JsonTypeName("updateAttribute") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateAttribute { + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public static final String JSON_PROPERTY_ENUMERATION = "enumeration"; + private List enumeration; + + public UpdateAttribute() { + } + + public UpdateAttribute value(String value) { + + this.value = value; + return this; + } + + /** + * Value of the attribute to update. **Use only if the attribute's category is 'calculated' or 'global'** + * @return value + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + + public UpdateAttribute enumeration(List enumeration) { + + this.enumeration = enumeration; + return this; + } + + public UpdateAttribute addEnumerationItem(UpdateAttributeEnumerationInner enumerationItem) { + if (this.enumeration == null) { + this.enumeration = new ArrayList<>(); + } + this.enumeration.add(enumerationItem); + return this; + } + + /** + * List of the values and labels that the attribute can take. **Use only if the attribute's category is \"category\"**. For example, **[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]** + * @return enumeration + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEnumeration() { + return enumeration; + } + + + @JsonProperty(JSON_PROPERTY_ENUMERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumeration(List enumeration) { + this.enumeration = enumeration; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAttribute updateAttribute = (UpdateAttribute) o; + return Objects.equals(this.value, updateAttribute.value) && + Objects.equals(this.enumeration, updateAttribute.enumeration); + } + + @Override + public int hashCode() { + return Objects.hash(value, enumeration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAttribute {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" enumeration: ").append(toIndentedString(enumeration)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `enumeration` to the URL query string + if (getEnumeration() != null) { + for (int i = 0; i < getEnumeration().size(); i++) { + if (getEnumeration().get(i) != null) { + joiner.add(getEnumeration().get(i).toUrlQueryString(String.format("%senumeration%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttributeEnumerationInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttributeEnumerationInner.java new file mode 100644 index 0000000..a87fcda --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateAttributeEnumerationInner.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateAttributeEnumerationInner + */ +@JsonPropertyOrder({ + UpdateAttributeEnumerationInner.JSON_PROPERTY_VALUE, + UpdateAttributeEnumerationInner.JSON_PROPERTY_LABEL +}) +@JsonTypeName("updateAttribute_enumeration_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateAttributeEnumerationInner { + public static final String JSON_PROPERTY_VALUE = "value"; + private Integer value; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public UpdateAttributeEnumerationInner() { + } + + public UpdateAttributeEnumerationInner value(Integer value) { + + this.value = value; + return this; + } + + /** + * Id of the value + * @return value + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(Integer value) { + this.value = value; + } + + + public UpdateAttributeEnumerationInner label(String label) { + + this.label = label; + return this; + } + + /** + * Label of the value + * @return label + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getLabel() { + return label; + } + + + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLabel(String label) { + this.label = label; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAttributeEnumerationInner updateAttributeEnumerationInner = (UpdateAttributeEnumerationInner) o; + return Objects.equals(this.value, updateAttributeEnumerationInner.value) && + Objects.equals(this.label, updateAttributeEnumerationInner.label); + } + + @Override + public int hashCode() { + return Objects.hash(value, label); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAttributeEnumerationInner {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + try { + joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `label` to the URL query string + if (getLabel() != null) { + try { + joiner.add(String.format("%slabel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLabel()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContacts.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContacts.java new file mode 100644 index 0000000..42d43f6 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContacts.java @@ -0,0 +1,164 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.UpdateBatchContactsContactsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateBatchContacts + */ +@JsonPropertyOrder({ + UpdateBatchContacts.JSON_PROPERTY_CONTACTS +}) +@JsonTypeName("updateBatchContacts") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateBatchContacts { + public static final String JSON_PROPERTY_CONTACTS = "contacts"; + private List contacts; + + public UpdateBatchContacts() { + } + + public UpdateBatchContacts contacts(List contacts) { + + this.contacts = contacts; + return this; + } + + public UpdateBatchContacts addContactsItem(UpdateBatchContactsContactsInner contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * List of contacts to be updated + * @return contacts + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getContacts() { + return contacts; + } + + + @JsonProperty(JSON_PROPERTY_CONTACTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContacts(List contacts) { + this.contacts = contacts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateBatchContacts updateBatchContacts = (UpdateBatchContacts) o; + return Objects.equals(this.contacts, updateBatchContacts.contacts); + } + + @Override + public int hashCode() { + return Objects.hash(contacts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateBatchContacts {\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `contacts` to the URL query string + if (getContacts() != null) { + for (int i = 0; i < getContacts().size(); i++) { + if (getContacts().get(i) != null) { + joiner.add(getContacts().get(i).toUrlQueryString(String.format("%scontacts%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsContactsInner.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsContactsInner.java new file mode 100644 index 0000000..3a84d82 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsContactsInner.java @@ -0,0 +1,583 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateBatchContactsContactsInner + */ +@JsonPropertyOrder({ + UpdateBatchContactsContactsInner.JSON_PROPERTY_EMAIL, + UpdateBatchContactsContactsInner.JSON_PROPERTY_ID, + UpdateBatchContactsContactsInner.JSON_PROPERTY_SMS, + UpdateBatchContactsContactsInner.JSON_PROPERTY_EXT_ID, + UpdateBatchContactsContactsInner.JSON_PROPERTY_ATTRIBUTES, + UpdateBatchContactsContactsInner.JSON_PROPERTY_EMAIL_BLACKLISTED, + UpdateBatchContactsContactsInner.JSON_PROPERTY_SMS_BLACKLISTED, + UpdateBatchContactsContactsInner.JSON_PROPERTY_LIST_IDS, + UpdateBatchContactsContactsInner.JSON_PROPERTY_UNLINK_LIST_IDS, + UpdateBatchContactsContactsInner.JSON_PROPERTY_SMTP_BLACKLIST_SENDER +}) +@JsonTypeName("updateBatchContacts_contacts_inner") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateBatchContactsContactsInner { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_SMS = "sms"; + private String sms; + + public static final String JSON_PROPERTY_EXT_ID = "ext_id"; + private String extId; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map attributes = new HashMap<>(); + + public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted"; + private Boolean emailBlacklisted; + + public static final String JSON_PROPERTY_SMS_BLACKLISTED = "smsBlacklisted"; + private Boolean smsBlacklisted; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_UNLINK_LIST_IDS = "unlinkListIds"; + private List unlinkListIds; + + public static final String JSON_PROPERTY_SMTP_BLACKLIST_SENDER = "smtpBlacklistSender"; + private List smtpBlacklistSender; + + public UpdateBatchContactsContactsInner() { + } + + public UpdateBatchContactsContactsInner email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public UpdateBatchContactsContactsInner id(Long id) { + + this.id = id; + return this; + } + + /** + * id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + + public UpdateBatchContactsContactsInner sms(String sms) { + + this.sms = sms; + return this; + } + + /** + * SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + * @return sms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSms() { + return sms; + } + + + @JsonProperty(JSON_PROPERTY_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSms(String sms) { + this.sms = sms; + } + + + public UpdateBatchContactsContactsInner extId(String extId) { + + this.extId = extId; + return this; + } + + /** + * Pass your own Id to update ext_id of a contact. + * @return extId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExtId() { + return extId; + } + + + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtId(String extId) { + this.extId = extId; + } + + + public UpdateBatchContactsContactsInner attributes(Map attributes) { + + this.attributes = attributes; + return this; + } + + public UpdateBatchContactsContactsInner putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + + public UpdateBatchContactsContactsInner emailBlacklisted(Boolean emailBlacklisted) { + + this.emailBlacklisted = emailBlacklisted; + return this; + } + + /** + * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) + * @return emailBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmailBlacklisted() { + return emailBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailBlacklisted(Boolean emailBlacklisted) { + this.emailBlacklisted = emailBlacklisted; + } + + + public UpdateBatchContactsContactsInner smsBlacklisted(Boolean smsBlacklisted) { + + this.smsBlacklisted = smsBlacklisted; + return this; + } + + /** + * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) + * @return smsBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsBlacklisted() { + return smsBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsBlacklisted(Boolean smsBlacklisted) { + this.smsBlacklisted = smsBlacklisted; + } + + + public UpdateBatchContactsContactsInner listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public UpdateBatchContactsContactsInner addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Ids of the lists to add the contact to + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public UpdateBatchContactsContactsInner unlinkListIds(List unlinkListIds) { + + this.unlinkListIds = unlinkListIds; + return this; + } + + public UpdateBatchContactsContactsInner addUnlinkListIdsItem(Long unlinkListIdsItem) { + if (this.unlinkListIds == null) { + this.unlinkListIds = new ArrayList<>(); + } + this.unlinkListIds.add(unlinkListIdsItem); + return this; + } + + /** + * Ids of the lists to remove the contact from + * @return unlinkListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkListIds() { + return unlinkListIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkListIds(List unlinkListIds) { + this.unlinkListIds = unlinkListIds; + } + + + public UpdateBatchContactsContactsInner smtpBlacklistSender(List smtpBlacklistSender) { + + this.smtpBlacklistSender = smtpBlacklistSender; + return this; + } + + public UpdateBatchContactsContactsInner addSmtpBlacklistSenderItem(String smtpBlacklistSenderItem) { + if (this.smtpBlacklistSender == null) { + this.smtpBlacklistSender = new ArrayList<>(); + } + this.smtpBlacklistSender.add(smtpBlacklistSenderItem); + return this; + } + + /** + * transactional email forbidden sender for contact. Use only for email Contact + * @return smtpBlacklistSender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSmtpBlacklistSender() { + return smtpBlacklistSender; + } + + + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmtpBlacklistSender(List smtpBlacklistSender) { + this.smtpBlacklistSender = smtpBlacklistSender; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateBatchContactsContactsInner updateBatchContactsContactsInner = (UpdateBatchContactsContactsInner) o; + return Objects.equals(this.email, updateBatchContactsContactsInner.email) && + Objects.equals(this.id, updateBatchContactsContactsInner.id) && + Objects.equals(this.sms, updateBatchContactsContactsInner.sms) && + Objects.equals(this.extId, updateBatchContactsContactsInner.extId) && + Objects.equals(this.attributes, updateBatchContactsContactsInner.attributes) && + Objects.equals(this.emailBlacklisted, updateBatchContactsContactsInner.emailBlacklisted) && + Objects.equals(this.smsBlacklisted, updateBatchContactsContactsInner.smsBlacklisted) && + Objects.equals(this.listIds, updateBatchContactsContactsInner.listIds) && + Objects.equals(this.unlinkListIds, updateBatchContactsContactsInner.unlinkListIds) && + Objects.equals(this.smtpBlacklistSender, updateBatchContactsContactsInner.smtpBlacklistSender); + } + + @Override + public int hashCode() { + return Objects.hash(email, id, sms, extId, attributes, emailBlacklisted, smsBlacklisted, listIds, unlinkListIds, smtpBlacklistSender); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateBatchContactsContactsInner {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sms: ").append(toIndentedString(sms)).append("\n"); + sb.append(" extId: ").append(toIndentedString(extId)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" emailBlacklisted: ").append(toIndentedString(emailBlacklisted)).append("\n"); + sb.append(" smsBlacklisted: ").append(toIndentedString(smsBlacklisted)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" unlinkListIds: ").append(toIndentedString(unlinkListIds)).append("\n"); + sb.append(" smtpBlacklistSender: ").append(toIndentedString(smtpBlacklistSender)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sms` to the URL query string + if (getSms() != null) { + try { + joiner.add(String.format("%ssms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ext_id` to the URL query string + if (getExtId() != null) { + try { + joiner.add(String.format("%sext_id%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExtId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (String _key : getAttributes().keySet()) { + try { + joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `emailBlacklisted` to the URL query string + if (getEmailBlacklisted() != null) { + try { + joiner.add(String.format("%semailBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklisted` to the URL query string + if (getSmsBlacklisted() != null) { + try { + joiner.add(String.format("%ssmsBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkListIds` to the URL query string + if (getUnlinkListIds() != null) { + for (int i = 0; i < getUnlinkListIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `smtpBlacklistSender` to the URL query string + if (getSmtpBlacklistSender() != null) { + for (int i = 0; i < getSmtpBlacklistSender().size(); i++) { + try { + joiner.add(String.format("%ssmtpBlacklistSender%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSmtpBlacklistSender().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsModel.java new file mode 100644 index 0000000..04fd9c7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateBatchContactsModel.java @@ -0,0 +1,221 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateBatchContactsModel + */ +@JsonPropertyOrder({ + UpdateBatchContactsModel.JSON_PROPERTY_SUCCESS_IDS, + UpdateBatchContactsModel.JSON_PROPERTY_FAILURE_IDS +}) +@JsonTypeName("updateBatchContactsModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateBatchContactsModel { + public static final String JSON_PROPERTY_SUCCESS_IDS = "successIds"; + private List successIds; + + public static final String JSON_PROPERTY_FAILURE_IDS = "failureIds"; + private List failureIds; + + public UpdateBatchContactsModel() { + } + + public UpdateBatchContactsModel successIds(List successIds) { + + this.successIds = successIds; + return this; + } + + public UpdateBatchContactsModel addSuccessIdsItem(Long successIdsItem) { + if (this.successIds == null) { + this.successIds = new ArrayList<>(); + } + this.successIds.add(successIdsItem); + return this; + } + + /** + * Get successIds + * @return successIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUCCESS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSuccessIds() { + return successIds; + } + + + @JsonProperty(JSON_PROPERTY_SUCCESS_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccessIds(List successIds) { + this.successIds = successIds; + } + + + public UpdateBatchContactsModel failureIds(List failureIds) { + + this.failureIds = failureIds; + return this; + } + + public UpdateBatchContactsModel addFailureIdsItem(Long failureIdsItem) { + if (this.failureIds == null) { + this.failureIds = new ArrayList<>(); + } + this.failureIds.add(failureIdsItem); + return this; + } + + /** + * Get failureIds + * @return failureIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILURE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFailureIds() { + return failureIds; + } + + + @JsonProperty(JSON_PROPERTY_FAILURE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureIds(List failureIds) { + this.failureIds = failureIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateBatchContactsModel updateBatchContactsModel = (UpdateBatchContactsModel) o; + return Objects.equals(this.successIds, updateBatchContactsModel.successIds) && + Objects.equals(this.failureIds, updateBatchContactsModel.failureIds); + } + + @Override + public int hashCode() { + return Objects.hash(successIds, failureIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateBatchContactsModel {\n"); + sb.append(" successIds: ").append(toIndentedString(successIds)).append("\n"); + sb.append(" failureIds: ").append(toIndentedString(failureIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `successIds` to the URL query string + if (getSuccessIds() != null) { + for (int i = 0; i < getSuccessIds().size(); i++) { + try { + joiner.add(String.format("%ssuccessIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSuccessIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `failureIds` to the URL query string + if (getFailureIds() != null) { + for (int i = 0; i < getFailureIds().size(); i++) { + try { + joiner.add(String.format("%sfailureIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getFailureIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCampaignStatus.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCampaignStatus.java new file mode 100644 index 0000000..fc099df --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCampaignStatus.java @@ -0,0 +1,199 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Status of the campaign + */ +@JsonPropertyOrder({ + UpdateCampaignStatus.JSON_PROPERTY_STATUS +}) +@JsonTypeName("updateCampaignStatus") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateCampaignStatus { + /** + * Note:- **replicateTemplate** status will be available **only for template type campaigns.** + */ + public enum StatusEnum { + SUSPENDED("suspended"), + + ARCHIVE("archive"), + + DARCHIVE("darchive"), + + SENT("sent"), + + QUEUED("queued"), + + REPLICATE("replicate"), + + REPLICATETEMPLATE("replicateTemplate"), + + DRAFT("draft"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public UpdateCampaignStatus() { + } + + public UpdateCampaignStatus status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Note:- **replicateTemplate** status will be available **only for template type campaigns.** + * @return status + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCampaignStatus updateCampaignStatus = (UpdateCampaignStatus) o; + return Objects.equals(this.status, updateCampaignStatus.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCampaignStatus {\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChild.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChild.java new file mode 100644 index 0000000..6131840 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChild.java @@ -0,0 +1,320 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateChild + */ +@JsonPropertyOrder({ + UpdateChild.JSON_PROPERTY_EMAIL, + UpdateChild.JSON_PROPERTY_FIRST_NAME, + UpdateChild.JSON_PROPERTY_LAST_NAME, + UpdateChild.JSON_PROPERTY_COMPANY_NAME, + UpdateChild.JSON_PROPERTY_PASSWORD +}) +@JsonTypeName("updateChild") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateChild { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_COMPANY_NAME = "companyName"; + private String companyName; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public UpdateChild() { + } + + public UpdateChild email(String email) { + + this.email = email; + return this; + } + + /** + * New Email address to update the child account + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public UpdateChild firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * New First name to use to update the child account + * @return firstName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public UpdateChild lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * New Last name to use to update the child account + * @return lastName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public UpdateChild companyName(String companyName) { + + this.companyName = companyName; + return this; + } + + /** + * New Company name to use to update the child account + * @return companyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCompanyName() { + return companyName; + } + + + @JsonProperty(JSON_PROPERTY_COMPANY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + public UpdateChild password(String password) { + + this.password = password; + return this; + } + + /** + * New password for the child account to login + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateChild updateChild = (UpdateChild) o; + return Objects.equals(this.email, updateChild.email) && + Objects.equals(this.firstName, updateChild.firstName) && + Objects.equals(this.lastName, updateChild.lastName) && + Objects.equals(this.companyName, updateChild.companyName) && + Objects.equals(this.password, updateChild.password); + } + + @Override + public int hashCode() { + return Objects.hash(email, firstName, lastName, companyName, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateChild {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" password: ").append("*").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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + try { + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + try { + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `companyName` to the URL query string + if (getCompanyName() != null) { + try { + joiner.add(String.format("%scompanyName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCompanyName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildAccountStatus.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildAccountStatus.java new file mode 100644 index 0000000..1a456a8 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildAccountStatus.java @@ -0,0 +1,278 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateChildAccountStatus + */ +@JsonPropertyOrder({ + UpdateChildAccountStatus.JSON_PROPERTY_TRANSACTIONAL_EMAIL, + UpdateChildAccountStatus.JSON_PROPERTY_TRANSACTIONAL_SMS, + UpdateChildAccountStatus.JSON_PROPERTY_MARKETING_AUTOMATION, + UpdateChildAccountStatus.JSON_PROPERTY_SMS_CAMPAIGN +}) +@JsonTypeName("updateChildAccountStatus") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateChildAccountStatus { + public static final String JSON_PROPERTY_TRANSACTIONAL_EMAIL = "transactionalEmail"; + private Boolean transactionalEmail; + + public static final String JSON_PROPERTY_TRANSACTIONAL_SMS = "transactionalSms"; + private Boolean transactionalSms; + + public static final String JSON_PROPERTY_MARKETING_AUTOMATION = "marketingAutomation"; + private Boolean marketingAutomation; + + public static final String JSON_PROPERTY_SMS_CAMPAIGN = "smsCampaign"; + private Boolean smsCampaign; + + public UpdateChildAccountStatus() { + } + + public UpdateChildAccountStatus transactionalEmail(Boolean transactionalEmail) { + + this.transactionalEmail = transactionalEmail; + return this; + } + + /** + * Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) + * @return transactionalEmail + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTransactionalEmail() { + return transactionalEmail; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionalEmail(Boolean transactionalEmail) { + this.transactionalEmail = transactionalEmail; + } + + + public UpdateChildAccountStatus transactionalSms(Boolean transactionalSms) { + + this.transactionalSms = transactionalSms; + return this; + } + + /** + * Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) + * @return transactionalSms + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTransactionalSms() { + return transactionalSms; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTIONAL_SMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionalSms(Boolean transactionalSms) { + this.transactionalSms = transactionalSms; + } + + + public UpdateChildAccountStatus marketingAutomation(Boolean marketingAutomation) { + + this.marketingAutomation = marketingAutomation; + return this; + } + + /** + * Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) + * @return marketingAutomation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MARKETING_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMarketingAutomation() { + return marketingAutomation; + } + + + @JsonProperty(JSON_PROPERTY_MARKETING_AUTOMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMarketingAutomation(Boolean marketingAutomation) { + this.marketingAutomation = marketingAutomation; + } + + + public UpdateChildAccountStatus smsCampaign(Boolean smsCampaign) { + + this.smsCampaign = smsCampaign; + return this; + } + + /** + * Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) + * @return smsCampaign + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsCampaign() { + return smsCampaign; + } + + + @JsonProperty(JSON_PROPERTY_SMS_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsCampaign(Boolean smsCampaign) { + this.smsCampaign = smsCampaign; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateChildAccountStatus updateChildAccountStatus = (UpdateChildAccountStatus) o; + return Objects.equals(this.transactionalEmail, updateChildAccountStatus.transactionalEmail) && + Objects.equals(this.transactionalSms, updateChildAccountStatus.transactionalSms) && + Objects.equals(this.marketingAutomation, updateChildAccountStatus.marketingAutomation) && + Objects.equals(this.smsCampaign, updateChildAccountStatus.smsCampaign); + } + + @Override + public int hashCode() { + return Objects.hash(transactionalEmail, transactionalSms, marketingAutomation, smsCampaign); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateChildAccountStatus {\n"); + sb.append(" transactionalEmail: ").append(toIndentedString(transactionalEmail)).append("\n"); + sb.append(" transactionalSms: ").append(toIndentedString(transactionalSms)).append("\n"); + sb.append(" marketingAutomation: ").append(toIndentedString(marketingAutomation)).append("\n"); + sb.append(" smsCampaign: ").append(toIndentedString(smsCampaign)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transactionalEmail` to the URL query string + if (getTransactionalEmail() != null) { + try { + joiner.add(String.format("%stransactionalEmail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTransactionalEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `transactionalSms` to the URL query string + if (getTransactionalSms() != null) { + try { + joiner.add(String.format("%stransactionalSms%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTransactionalSms()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `marketingAutomation` to the URL query string + if (getMarketingAutomation() != null) { + try { + joiner.add(String.format("%smarketingAutomation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMarketingAutomation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsCampaign` to the URL query string + if (getSmsCampaign() != null) { + try { + joiner.add(String.format("%ssmsCampaign%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsCampaign()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildDomain.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildDomain.java new file mode 100644 index 0000000..5a422f7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateChildDomain.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateChildDomain + */ +@JsonPropertyOrder({ + UpdateChildDomain.JSON_PROPERTY_DOMAIN +}) +@JsonTypeName("updateChildDomain") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateChildDomain { + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public UpdateChildDomain() { + } + + public UpdateChildDomain domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Value for the sender domain that will replace the existing domain + * @return domain + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(String domain) { + this.domain = domain; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateChildDomain updateChildDomain = (UpdateChildDomain) o; + return Objects.equals(this.domain, updateChildDomain.domain); + } + + @Override + public int hashCode() { + return Objects.hash(domain); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateChildDomain {\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateContact.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateContact.java new file mode 100644 index 0000000..7fad7c1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateContact.java @@ -0,0 +1,457 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateContact + */ +@JsonPropertyOrder({ + UpdateContact.JSON_PROPERTY_ATTRIBUTES, + UpdateContact.JSON_PROPERTY_EXT_ID, + UpdateContact.JSON_PROPERTY_EMAIL_BLACKLISTED, + UpdateContact.JSON_PROPERTY_SMS_BLACKLISTED, + UpdateContact.JSON_PROPERTY_LIST_IDS, + UpdateContact.JSON_PROPERTY_UNLINK_LIST_IDS, + UpdateContact.JSON_PROPERTY_SMTP_BLACKLIST_SENDER +}) +@JsonTypeName("updateContact") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateContact { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map attributes = new HashMap<>(); + + public static final String JSON_PROPERTY_EXT_ID = "ext_id"; + private String extId; + + public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted"; + private Boolean emailBlacklisted; + + public static final String JSON_PROPERTY_SMS_BLACKLISTED = "smsBlacklisted"; + private Boolean smsBlacklisted; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_UNLINK_LIST_IDS = "unlinkListIds"; + private List unlinkListIds; + + public static final String JSON_PROPERTY_SMTP_BLACKLIST_SENDER = "smtpBlacklistSender"; + private List smtpBlacklistSender; + + public UpdateContact() { + } + + public UpdateContact attributes(Map attributes) { + + this.attributes = attributes; + return this; + } + + public UpdateContact putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** + * @return attributes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getAttributes() { + return attributes; + } + + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + + public UpdateContact extId(String extId) { + + this.extId = extId; + return this; + } + + /** + * Pass your own Id to update ext_id of a contact. + * @return extId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExtId() { + return extId; + } + + + @JsonProperty(JSON_PROPERTY_EXT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExtId(String extId) { + this.extId = extId; + } + + + public UpdateContact emailBlacklisted(Boolean emailBlacklisted) { + + this.emailBlacklisted = emailBlacklisted; + return this; + } + + /** + * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) + * @return emailBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEmailBlacklisted() { + return emailBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailBlacklisted(Boolean emailBlacklisted) { + this.emailBlacklisted = emailBlacklisted; + } + + + public UpdateContact smsBlacklisted(Boolean smsBlacklisted) { + + this.smsBlacklisted = smsBlacklisted; + return this; + } + + /** + * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) + * @return smsBlacklisted + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSmsBlacklisted() { + return smsBlacklisted; + } + + + @JsonProperty(JSON_PROPERTY_SMS_BLACKLISTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsBlacklisted(Boolean smsBlacklisted) { + this.smsBlacklisted = smsBlacklisted; + } + + + public UpdateContact listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public UpdateContact addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Ids of the lists to add the contact to + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public UpdateContact unlinkListIds(List unlinkListIds) { + + this.unlinkListIds = unlinkListIds; + return this; + } + + public UpdateContact addUnlinkListIdsItem(Long unlinkListIdsItem) { + if (this.unlinkListIds == null) { + this.unlinkListIds = new ArrayList<>(); + } + this.unlinkListIds.add(unlinkListIdsItem); + return this; + } + + /** + * Ids of the lists to remove the contact from + * @return unlinkListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNLINK_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUnlinkListIds() { + return unlinkListIds; + } + + + @JsonProperty(JSON_PROPERTY_UNLINK_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnlinkListIds(List unlinkListIds) { + this.unlinkListIds = unlinkListIds; + } + + + public UpdateContact smtpBlacklistSender(List smtpBlacklistSender) { + + this.smtpBlacklistSender = smtpBlacklistSender; + return this; + } + + public UpdateContact addSmtpBlacklistSenderItem(String smtpBlacklistSenderItem) { + if (this.smtpBlacklistSender == null) { + this.smtpBlacklistSender = new ArrayList<>(); + } + this.smtpBlacklistSender.add(smtpBlacklistSenderItem); + return this; + } + + /** + * transactional email forbidden sender for contact. Use only for email Contact + * @return smtpBlacklistSender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSmtpBlacklistSender() { + return smtpBlacklistSender; + } + + + @JsonProperty(JSON_PROPERTY_SMTP_BLACKLIST_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmtpBlacklistSender(List smtpBlacklistSender) { + this.smtpBlacklistSender = smtpBlacklistSender; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateContact updateContact = (UpdateContact) o; + return Objects.equals(this.attributes, updateContact.attributes) && + Objects.equals(this.extId, updateContact.extId) && + Objects.equals(this.emailBlacklisted, updateContact.emailBlacklisted) && + Objects.equals(this.smsBlacklisted, updateContact.smsBlacklisted) && + Objects.equals(this.listIds, updateContact.listIds) && + Objects.equals(this.unlinkListIds, updateContact.unlinkListIds) && + Objects.equals(this.smtpBlacklistSender, updateContact.smtpBlacklistSender); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, extId, emailBlacklisted, smsBlacklisted, listIds, unlinkListIds, smtpBlacklistSender); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateContact {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" extId: ").append(toIndentedString(extId)).append("\n"); + sb.append(" emailBlacklisted: ").append(toIndentedString(emailBlacklisted)).append("\n"); + sb.append(" smsBlacklisted: ").append(toIndentedString(smsBlacklisted)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" unlinkListIds: ").append(toIndentedString(unlinkListIds)).append("\n"); + sb.append(" smtpBlacklistSender: ").append(toIndentedString(smtpBlacklistSender)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `attributes` to the URL query string + if (getAttributes() != null) { + for (String _key : getAttributes().keySet()) { + try { + joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `ext_id` to the URL query string + if (getExtId() != null) { + try { + joiner.add(String.format("%sext_id%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExtId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `emailBlacklisted` to the URL query string + if (getEmailBlacklisted() != null) { + try { + joiner.add(String.format("%semailBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmailBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `smsBlacklisted` to the URL query string + if (getSmsBlacklisted() != null) { + try { + joiner.add(String.format("%ssmsBlacklisted%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmsBlacklisted()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `unlinkListIds` to the URL query string + if (getUnlinkListIds() != null) { + for (int i = 0; i < getUnlinkListIds().size(); i++) { + try { + joiner.add(String.format("%sunlinkListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getUnlinkListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `smtpBlacklistSender` to the URL query string + if (getSmtpBlacklistSender() != null) { + for (int i = 0; i < getSmtpBlacklistSender().size(); i++) { + try { + joiner.add(String.format("%ssmtpBlacklistSender%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSmtpBlacklistSender().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollection200Response.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollection200Response.java new file mode 100644 index 0000000..f87abfc --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollection200Response.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateCouponCollection200Response + */ +@JsonPropertyOrder({ + UpdateCouponCollection200Response.JSON_PROPERTY_ID, + UpdateCouponCollection200Response.JSON_PROPERTY_NAME, + UpdateCouponCollection200Response.JSON_PROPERTY_DEFAULT_COUPON +}) +@JsonTypeName("updateCouponCollection_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateCouponCollection200Response { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DEFAULT_COUPON = "defaultCoupon"; + private String defaultCoupon; + + public UpdateCouponCollection200Response() { + } + + public UpdateCouponCollection200Response id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the collection + * @return id + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + + public UpdateCouponCollection200Response name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the collection + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + + public UpdateCouponCollection200Response defaultCoupon(String defaultCoupon) { + + this.defaultCoupon = defaultCoupon; + return this; + } + + /** + * The default coupon of the collection + * @return defaultCoupon + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDefaultCoupon() { + return defaultCoupon; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultCoupon(String defaultCoupon) { + this.defaultCoupon = defaultCoupon; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCouponCollection200Response updateCouponCollection200Response = (UpdateCouponCollection200Response) o; + return Objects.equals(this.id, updateCouponCollection200Response.id) && + Objects.equals(this.name, updateCouponCollection200Response.name) && + Objects.equals(this.defaultCoupon, updateCouponCollection200Response.defaultCoupon); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, defaultCoupon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCouponCollection200Response {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" defaultCoupon: ").append(toIndentedString(defaultCoupon)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `defaultCoupon` to the URL query string + if (getDefaultCoupon() != null) { + try { + joiner.add(String.format("%sdefaultCoupon%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultCoupon()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollectionRequest.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollectionRequest.java new file mode 100644 index 0000000..852aa38 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateCouponCollectionRequest.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateCouponCollectionRequest + */ +@JsonPropertyOrder({ + UpdateCouponCollectionRequest.JSON_PROPERTY_DEFAULT_COUPON +}) +@JsonTypeName("updateCouponCollection_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateCouponCollectionRequest { + public static final String JSON_PROPERTY_DEFAULT_COUPON = "defaultCoupon"; + private String defaultCoupon; + + public UpdateCouponCollectionRequest() { + } + + public UpdateCouponCollectionRequest defaultCoupon(String defaultCoupon) { + + this.defaultCoupon = defaultCoupon; + return this; + } + + /** + * A default coupon to be used in case there are no coupons left + * @return defaultCoupon + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDefaultCoupon() { + return defaultCoupon; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_COUPON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultCoupon(String defaultCoupon) { + this.defaultCoupon = defaultCoupon; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCouponCollectionRequest updateCouponCollectionRequest = (UpdateCouponCollectionRequest) o; + return Objects.equals(this.defaultCoupon, updateCouponCollectionRequest.defaultCoupon); + } + + @Override + public int hashCode() { + return Objects.hash(defaultCoupon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCouponCollectionRequest {\n"); + sb.append(" defaultCoupon: ").append(toIndentedString(defaultCoupon)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `defaultCoupon` to the URL query string + if (getDefaultCoupon() != null) { + try { + joiner.add(String.format("%sdefaultCoupon%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultCoupon()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaign.java new file mode 100644 index 0000000..40f5dd1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaign.java @@ -0,0 +1,1459 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import software.xdev.brevo.model.UpdateEmailCampaignRecipients; +import software.xdev.brevo.model.UpdateEmailCampaignSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateEmailCampaign + */ +@JsonPropertyOrder({ + UpdateEmailCampaign.JSON_PROPERTY_TAG, + UpdateEmailCampaign.JSON_PROPERTY_SENDER, + UpdateEmailCampaign.JSON_PROPERTY_NAME, + UpdateEmailCampaign.JSON_PROPERTY_HTML_CONTENT, + UpdateEmailCampaign.JSON_PROPERTY_HTML_URL, + UpdateEmailCampaign.JSON_PROPERTY_SCHEDULED_AT, + UpdateEmailCampaign.JSON_PROPERTY_SUBJECT, + UpdateEmailCampaign.JSON_PROPERTY_PREVIEW_TEXT, + UpdateEmailCampaign.JSON_PROPERTY_REPLY_TO, + UpdateEmailCampaign.JSON_PROPERTY_TO_FIELD, + UpdateEmailCampaign.JSON_PROPERTY_RECIPIENTS, + UpdateEmailCampaign.JSON_PROPERTY_ATTACHMENT_URL, + UpdateEmailCampaign.JSON_PROPERTY_INLINE_IMAGE_ACTIVATION, + UpdateEmailCampaign.JSON_PROPERTY_MIRROR_ACTIVE, + UpdateEmailCampaign.JSON_PROPERTY_RECURRING, + UpdateEmailCampaign.JSON_PROPERTY_FOOTER, + UpdateEmailCampaign.JSON_PROPERTY_HEADER, + UpdateEmailCampaign.JSON_PROPERTY_UTM_CAMPAIGN, + UpdateEmailCampaign.JSON_PROPERTY_PARAMS, + UpdateEmailCampaign.JSON_PROPERTY_SEND_AT_BEST_TIME, + UpdateEmailCampaign.JSON_PROPERTY_AB_TESTING, + UpdateEmailCampaign.JSON_PROPERTY_SUBJECT_A, + UpdateEmailCampaign.JSON_PROPERTY_SUBJECT_B, + UpdateEmailCampaign.JSON_PROPERTY_SPLIT_RULE, + UpdateEmailCampaign.JSON_PROPERTY_WINNER_CRITERIA, + UpdateEmailCampaign.JSON_PROPERTY_WINNER_DELAY, + UpdateEmailCampaign.JSON_PROPERTY_IP_WARMUP_ENABLE, + UpdateEmailCampaign.JSON_PROPERTY_INITIAL_QUOTA, + UpdateEmailCampaign.JSON_PROPERTY_INCREASE_RATE, + UpdateEmailCampaign.JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID, + UpdateEmailCampaign.JSON_PROPERTY_UPDATE_FORM_ID +}) +@JsonTypeName("updateEmailCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateEmailCampaign { + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private UpdateEmailCampaignSender sender; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_HTML_URL = "htmlUrl"; + private String htmlUrl; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_PREVIEW_TEXT = "previewText"; + private String previewText; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private UpdateEmailCampaignRecipients recipients; + + public static final String JSON_PROPERTY_ATTACHMENT_URL = "attachmentUrl"; + private String attachmentUrl; + + public static final String JSON_PROPERTY_INLINE_IMAGE_ACTIVATION = "inlineImageActivation"; + private Boolean inlineImageActivation = false; + + public static final String JSON_PROPERTY_MIRROR_ACTIVE = "mirrorActive"; + private Boolean mirrorActive; + + public static final String JSON_PROPERTY_RECURRING = "recurring"; + private Boolean recurring = false; + + public static final String JSON_PROPERTY_FOOTER = "footer"; + private String footer; + + public static final String JSON_PROPERTY_HEADER = "header"; + private String header; + + public static final String JSON_PROPERTY_UTM_CAMPAIGN = "utmCampaign"; + private String utmCampaign; + + public static final String JSON_PROPERTY_PARAMS = "params"; + private Map params = new HashMap<>(); + + public static final String JSON_PROPERTY_SEND_AT_BEST_TIME = "sendAtBestTime"; + private Boolean sendAtBestTime; + + public static final String JSON_PROPERTY_AB_TESTING = "abTesting"; + private Boolean abTesting = false; + + public static final String JSON_PROPERTY_SUBJECT_A = "subjectA"; + private String subjectA; + + public static final String JSON_PROPERTY_SUBJECT_B = "subjectB"; + private String subjectB; + + public static final String JSON_PROPERTY_SPLIT_RULE = "splitRule"; + private Long splitRule; + + /** + * Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + */ + public enum WinnerCriteriaEnum { + OPEN("open"), + + CLICK("click"); + + private String value; + + WinnerCriteriaEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WinnerCriteriaEnum fromValue(String value) { + for (WinnerCriteriaEnum b : WinnerCriteriaEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_WINNER_CRITERIA = "winnerCriteria"; + private WinnerCriteriaEnum winnerCriteria; + + public static final String JSON_PROPERTY_WINNER_DELAY = "winnerDelay"; + private Long winnerDelay; + + public static final String JSON_PROPERTY_IP_WARMUP_ENABLE = "ipWarmupEnable"; + private Boolean ipWarmupEnable = false; + + public static final String JSON_PROPERTY_INITIAL_QUOTA = "initialQuota"; + private Long initialQuota; + + public static final String JSON_PROPERTY_INCREASE_RATE = "increaseRate"; + private Long increaseRate; + + public static final String JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID = "unsubscriptionPageId"; + private String unsubscriptionPageId; + + public static final String JSON_PROPERTY_UPDATE_FORM_ID = "updateFormId"; + private String updateFormId; + + public UpdateEmailCampaign() { + } + + public UpdateEmailCampaign tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the campaign + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public UpdateEmailCampaign sender(UpdateEmailCampaignSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UpdateEmailCampaignSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(UpdateEmailCampaignSender sender) { + this.sender = sender; + } + + + public UpdateEmailCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateEmailCampaign htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty** + * @return htmlContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public UpdateEmailCampaign htmlUrl(String htmlUrl) { + + this.htmlUrl = htmlUrl; + return this; + } + + /** + * Url which contents the body of the email message. **REQUIRED if htmlContent is empty** + * @return htmlUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlUrl() { + return htmlUrl; + } + + + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlUrl(String htmlUrl) { + this.htmlUrl = htmlUrl; + } + + + public UpdateEmailCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public UpdateEmailCampaign subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the campaign + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public UpdateEmailCampaign previewText(String previewText) { + + this.previewText = previewText; + return this; + } + + /** + * Preview text or preheader of the email campaign + * @return previewText + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPreviewText() { + return previewText; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewText(String previewText) { + this.previewText = previewText; + } + + + public UpdateEmailCampaign replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email on which campaign recipients will be able to reply to + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public UpdateEmailCampaign toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public UpdateEmailCampaign recipients(UpdateEmailCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UpdateEmailCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(UpdateEmailCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public UpdateEmailCampaign attachmentUrl(String attachmentUrl) { + + this.attachmentUrl = attachmentUrl; + return this; + } + + /** + * Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' + * @return attachmentUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttachmentUrl() { + return attachmentUrl; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachmentUrl(String attachmentUrl) { + this.attachmentUrl = attachmentUrl; + } + + + public UpdateEmailCampaign inlineImageActivation(Boolean inlineImageActivation) { + + this.inlineImageActivation = inlineImageActivation; + return this; + } + + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_. + * @return inlineImageActivation + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInlineImageActivation() { + return inlineImageActivation; + } + + + @JsonProperty(JSON_PROPERTY_INLINE_IMAGE_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInlineImageActivation(Boolean inlineImageActivation) { + this.inlineImageActivation = inlineImageActivation; + } + + + public UpdateEmailCampaign mirrorActive(Boolean mirrorActive) { + + this.mirrorActive = mirrorActive; + return this; + } + + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * @return mirrorActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMirrorActive() { + return mirrorActive; + } + + + @JsonProperty(JSON_PROPERTY_MIRROR_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMirrorActive(Boolean mirrorActive) { + this.mirrorActive = mirrorActive; + } + + + public UpdateEmailCampaign recurring(Boolean recurring) { + + this.recurring = recurring; + return this; + } + + /** + * **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * @return recurring + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRecurring() { + return recurring; + } + + + @JsonProperty(JSON_PROPERTY_RECURRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurring(Boolean recurring) { + this.recurring = recurring; + } + + + public UpdateEmailCampaign footer(String footer) { + + this.footer = footer; + return this; + } + + /** + * Footer of the email campaign + * @return footer + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFooter() { + return footer; + } + + + @JsonProperty(JSON_PROPERTY_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFooter(String footer) { + this.footer = footer; + } + + + public UpdateEmailCampaign header(String header) { + + this.header = header; + return this; + } + + /** + * Header of the email campaign + * @return header + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeader() { + return header; + } + + + @JsonProperty(JSON_PROPERTY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeader(String header) { + this.header = header; + } + + + public UpdateEmailCampaign utmCampaign(String utmCampaign) { + + this.utmCampaign = utmCampaign; + return this; + } + + /** + * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + * @return utmCampaign + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTM_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUtmCampaign() { + return utmCampaign; + } + + + @JsonProperty(JSON_PROPERTY_UTM_CAMPAIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtmCampaign(String utmCampaign) { + this.utmCampaign = utmCampaign; + } + + + public UpdateEmailCampaign params(Map params) { + + this.params = params; + return this; + } + + public UpdateEmailCampaign putParamsItem(String key, Object paramsItem) { + if (this.params == null) { + this.params = new HashMap<>(); + } + this.params.put(key, paramsItem); + return this; + } + + /** + * Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** + * @return params + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getParams() { + return params; + } + + + @JsonProperty(JSON_PROPERTY_PARAMS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setParams(Map params) { + this.params = params; + } + + + public UpdateEmailCampaign sendAtBestTime(Boolean sendAtBestTime) { + + this.sendAtBestTime = sendAtBestTime; + return this; + } + + /** + * Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.** + * @return sendAtBestTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSendAtBestTime() { + return sendAtBestTime; + } + + + @JsonProperty(JSON_PROPERTY_SEND_AT_BEST_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSendAtBestTime(Boolean sendAtBestTime) { + this.sendAtBestTime = sendAtBestTime; + } + + + public UpdateEmailCampaign abTesting(Boolean abTesting) { + + this.abTesting = abTesting; + return this; + } + + /** + * Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + * @return abTesting + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAbTesting() { + return abTesting; + } + + + @JsonProperty(JSON_PROPERTY_AB_TESTING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbTesting(Boolean abTesting) { + this.abTesting = abTesting; + } + + + public UpdateEmailCampaign subjectA(String subjectA) { + + this.subjectA = subjectA; + return this; + } + + /** + * Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value + * @return subjectA + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectA() { + return subjectA; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_A) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectA(String subjectA) { + this.subjectA = subjectA; + } + + + public UpdateEmailCampaign subjectB(String subjectB) { + + this.subjectB = subjectB; + return this; + } + + /** + * Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value + * @return subjectB + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubjectB() { + return subjectB; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT_B) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubjectB(String subjectB) { + this.subjectB = subjectB; + } + + + public UpdateEmailCampaign splitRule(Long splitRule) { + + this.splitRule = splitRule; + return this; + } + + /** + * Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + * minimum: 1 + * maximum: 50 + * @return splitRule + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSplitRule() { + return splitRule; + } + + + @JsonProperty(JSON_PROPERTY_SPLIT_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitRule(Long splitRule) { + this.splitRule = splitRule; + } + + + public UpdateEmailCampaign winnerCriteria(WinnerCriteriaEnum winnerCriteria) { + + this.winnerCriteria = winnerCriteria; + return this; + } + + /** + * Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + * @return winnerCriteria + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WinnerCriteriaEnum getWinnerCriteria() { + return winnerCriteria; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerCriteria(WinnerCriteriaEnum winnerCriteria) { + this.winnerCriteria = winnerCriteria; + } + + + public UpdateEmailCampaign winnerDelay(Long winnerDelay) { + + this.winnerDelay = winnerDelay; + return this; + } + + /** + * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed + * minimum: 1 + * maximum: 168 + * @return winnerDelay + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getWinnerDelay() { + return winnerDelay; + } + + + @JsonProperty(JSON_PROPERTY_WINNER_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWinnerDelay(Long winnerDelay) { + this.winnerDelay = winnerDelay; + } + + + public UpdateEmailCampaign ipWarmupEnable(Boolean ipWarmupEnable) { + + this.ipWarmupEnable = ipWarmupEnable; + return this; + } + + /** + * **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. + * @return ipWarmupEnable + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP_WARMUP_ENABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIpWarmupEnable() { + return ipWarmupEnable; + } + + + @JsonProperty(JSON_PROPERTY_IP_WARMUP_ENABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpWarmupEnable(Boolean ipWarmupEnable) { + this.ipWarmupEnable = ipWarmupEnable; + } + + + public UpdateEmailCampaign initialQuota(Long initialQuota) { + + this.initialQuota = initialQuota; + return this; + } + + /** + * Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + * @return initialQuota + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INITIAL_QUOTA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInitialQuota() { + return initialQuota; + } + + + @JsonProperty(JSON_PROPERTY_INITIAL_QUOTA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInitialQuota(Long initialQuota) { + this.initialQuota = initialQuota; + } + + + public UpdateEmailCampaign increaseRate(Long increaseRate) { + + this.increaseRate = increaseRate; + return this; + } + + /** + * Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + * minimum: 0 + * maximum: 100 + * @return increaseRate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCREASE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getIncreaseRate() { + return increaseRate; + } + + + @JsonProperty(JSON_PROPERTY_INCREASE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncreaseRate(Long increaseRate) { + this.increaseRate = increaseRate; + } + + + public UpdateEmailCampaign unsubscriptionPageId(String unsubscriptionPageId) { + + this.unsubscriptionPageId = unsubscriptionPageId; + return this; + } + + /** + * Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. + * @return unsubscriptionPageId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUnsubscriptionPageId() { + return unsubscriptionPageId; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIPTION_PAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscriptionPageId(String unsubscriptionPageId) { + this.unsubscriptionPageId = unsubscriptionPageId; + } + + + public UpdateEmailCampaign updateFormId(String updateFormId) { + + this.updateFormId = updateFormId; + return this; + } + + /** + * **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. + * @return updateFormId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATE_FORM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUpdateFormId() { + return updateFormId; + } + + + @JsonProperty(JSON_PROPERTY_UPDATE_FORM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateFormId(String updateFormId) { + this.updateFormId = updateFormId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailCampaign updateEmailCampaign = (UpdateEmailCampaign) o; + return Objects.equals(this.tag, updateEmailCampaign.tag) && + Objects.equals(this.sender, updateEmailCampaign.sender) && + Objects.equals(this.name, updateEmailCampaign.name) && + Objects.equals(this.htmlContent, updateEmailCampaign.htmlContent) && + Objects.equals(this.htmlUrl, updateEmailCampaign.htmlUrl) && + Objects.equals(this.scheduledAt, updateEmailCampaign.scheduledAt) && + Objects.equals(this.subject, updateEmailCampaign.subject) && + Objects.equals(this.previewText, updateEmailCampaign.previewText) && + Objects.equals(this.replyTo, updateEmailCampaign.replyTo) && + Objects.equals(this.toField, updateEmailCampaign.toField) && + Objects.equals(this.recipients, updateEmailCampaign.recipients) && + Objects.equals(this.attachmentUrl, updateEmailCampaign.attachmentUrl) && + Objects.equals(this.inlineImageActivation, updateEmailCampaign.inlineImageActivation) && + Objects.equals(this.mirrorActive, updateEmailCampaign.mirrorActive) && + Objects.equals(this.recurring, updateEmailCampaign.recurring) && + Objects.equals(this.footer, updateEmailCampaign.footer) && + Objects.equals(this.header, updateEmailCampaign.header) && + Objects.equals(this.utmCampaign, updateEmailCampaign.utmCampaign) && + Objects.equals(this.params, updateEmailCampaign.params) && + Objects.equals(this.sendAtBestTime, updateEmailCampaign.sendAtBestTime) && + Objects.equals(this.abTesting, updateEmailCampaign.abTesting) && + Objects.equals(this.subjectA, updateEmailCampaign.subjectA) && + Objects.equals(this.subjectB, updateEmailCampaign.subjectB) && + Objects.equals(this.splitRule, updateEmailCampaign.splitRule) && + Objects.equals(this.winnerCriteria, updateEmailCampaign.winnerCriteria) && + Objects.equals(this.winnerDelay, updateEmailCampaign.winnerDelay) && + Objects.equals(this.ipWarmupEnable, updateEmailCampaign.ipWarmupEnable) && + Objects.equals(this.initialQuota, updateEmailCampaign.initialQuota) && + Objects.equals(this.increaseRate, updateEmailCampaign.increaseRate) && + Objects.equals(this.unsubscriptionPageId, updateEmailCampaign.unsubscriptionPageId) && + Objects.equals(this.updateFormId, updateEmailCampaign.updateFormId); + } + + @Override + public int hashCode() { + return Objects.hash(tag, sender, name, htmlContent, htmlUrl, scheduledAt, subject, previewText, replyTo, toField, recipients, attachmentUrl, inlineImageActivation, mirrorActive, recurring, footer, header, utmCampaign, params, sendAtBestTime, abTesting, subjectA, subjectB, splitRule, winnerCriteria, winnerDelay, ipWarmupEnable, initialQuota, increaseRate, unsubscriptionPageId, updateFormId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEmailCampaign {\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" previewText: ").append(toIndentedString(previewText)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" attachmentUrl: ").append(toIndentedString(attachmentUrl)).append("\n"); + sb.append(" inlineImageActivation: ").append(toIndentedString(inlineImageActivation)).append("\n"); + sb.append(" mirrorActive: ").append(toIndentedString(mirrorActive)).append("\n"); + sb.append(" recurring: ").append(toIndentedString(recurring)).append("\n"); + sb.append(" footer: ").append(toIndentedString(footer)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" utmCampaign: ").append(toIndentedString(utmCampaign)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" sendAtBestTime: ").append(toIndentedString(sendAtBestTime)).append("\n"); + sb.append(" abTesting: ").append(toIndentedString(abTesting)).append("\n"); + sb.append(" subjectA: ").append(toIndentedString(subjectA)).append("\n"); + sb.append(" subjectB: ").append(toIndentedString(subjectB)).append("\n"); + sb.append(" splitRule: ").append(toIndentedString(splitRule)).append("\n"); + sb.append(" winnerCriteria: ").append(toIndentedString(winnerCriteria)).append("\n"); + sb.append(" winnerDelay: ").append(toIndentedString(winnerDelay)).append("\n"); + sb.append(" ipWarmupEnable: ").append(toIndentedString(ipWarmupEnable)).append("\n"); + sb.append(" initialQuota: ").append(toIndentedString(initialQuota)).append("\n"); + sb.append(" increaseRate: ").append(toIndentedString(increaseRate)).append("\n"); + sb.append(" unsubscriptionPageId: ").append(toIndentedString(unsubscriptionPageId)).append("\n"); + sb.append(" updateFormId: ").append(toIndentedString(updateFormId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlUrl` to the URL query string + if (getHtmlUrl() != null) { + try { + joiner.add(String.format("%shtmlUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `previewText` to the URL query string + if (getPreviewText() != null) { + try { + joiner.add(String.format("%spreviewText%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPreviewText()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `attachmentUrl` to the URL query string + if (getAttachmentUrl() != null) { + try { + joiner.add(String.format("%sattachmentUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttachmentUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `inlineImageActivation` to the URL query string + if (getInlineImageActivation() != null) { + try { + joiner.add(String.format("%sinlineImageActivation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInlineImageActivation()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `mirrorActive` to the URL query string + if (getMirrorActive() != null) { + try { + joiner.add(String.format("%smirrorActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMirrorActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recurring` to the URL query string + if (getRecurring() != null) { + try { + joiner.add(String.format("%srecurring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRecurring()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `footer` to the URL query string + if (getFooter() != null) { + try { + joiner.add(String.format("%sfooter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header` to the URL query string + if (getHeader() != null) { + try { + joiner.add(String.format("%sheader%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `utmCampaign` to the URL query string + if (getUtmCampaign() != null) { + try { + joiner.add(String.format("%sutmCampaign%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUtmCampaign()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `params` to the URL query string + if (getParams() != null) { + for (String _key : getParams().keySet()) { + try { + joiner.add(String.format("%sparams%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getParams().get(_key), URLEncoder.encode(String.valueOf(getParams().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `sendAtBestTime` to the URL query string + if (getSendAtBestTime() != null) { + try { + joiner.add(String.format("%ssendAtBestTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSendAtBestTime()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `abTesting` to the URL query string + if (getAbTesting() != null) { + try { + joiner.add(String.format("%sabTesting%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAbTesting()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectA` to the URL query string + if (getSubjectA() != null) { + try { + joiner.add(String.format("%ssubjectA%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectA()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subjectB` to the URL query string + if (getSubjectB() != null) { + try { + joiner.add(String.format("%ssubjectB%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubjectB()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `splitRule` to the URL query string + if (getSplitRule() != null) { + try { + joiner.add(String.format("%ssplitRule%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSplitRule()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerCriteria` to the URL query string + if (getWinnerCriteria() != null) { + try { + joiner.add(String.format("%swinnerCriteria%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerCriteria()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `winnerDelay` to the URL query string + if (getWinnerDelay() != null) { + try { + joiner.add(String.format("%swinnerDelay%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWinnerDelay()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ipWarmupEnable` to the URL query string + if (getIpWarmupEnable() != null) { + try { + joiner.add(String.format("%sipWarmupEnable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIpWarmupEnable()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `initialQuota` to the URL query string + if (getInitialQuota() != null) { + try { + joiner.add(String.format("%sinitialQuota%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInitialQuota()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `increaseRate` to the URL query string + if (getIncreaseRate() != null) { + try { + joiner.add(String.format("%sincreaseRate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIncreaseRate()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscriptionPageId` to the URL query string + if (getUnsubscriptionPageId() != null) { + try { + joiner.add(String.format("%sunsubscriptionPageId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscriptionPageId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `updateFormId` to the URL query string + if (getUpdateFormId() != null) { + try { + joiner.add(String.format("%supdateFormId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUpdateFormId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignRecipients.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignRecipients.java new file mode 100644 index 0000000..1f41247 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignRecipients.java @@ -0,0 +1,275 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Segment ids and List ids to include/exclude from campaign + */ +@JsonPropertyOrder({ + UpdateEmailCampaignRecipients.JSON_PROPERTY_EXCLUSION_LIST_IDS, + UpdateEmailCampaignRecipients.JSON_PROPERTY_LIST_IDS, + UpdateEmailCampaignRecipients.JSON_PROPERTY_SEGMENT_IDS +}) +@JsonTypeName("updateEmailCampaign_recipients") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateEmailCampaignRecipients { + public static final String JSON_PROPERTY_EXCLUSION_LIST_IDS = "exclusionListIds"; + private List exclusionListIds; + + public static final String JSON_PROPERTY_LIST_IDS = "listIds"; + private List listIds; + + public static final String JSON_PROPERTY_SEGMENT_IDS = "segmentIds"; + private List segmentIds; + + public UpdateEmailCampaignRecipients() { + } + + public UpdateEmailCampaignRecipients exclusionListIds(List exclusionListIds) { + + this.exclusionListIds = exclusionListIds; + return this; + } + + public UpdateEmailCampaignRecipients addExclusionListIdsItem(Long exclusionListIdsItem) { + if (this.exclusionListIds == null) { + this.exclusionListIds = new ArrayList<>(); + } + this.exclusionListIds.add(exclusionListIdsItem); + return this; + } + + /** + * List ids which have to be excluded from a campaign + * @return exclusionListIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExclusionListIds() { + return exclusionListIds; + } + + + @JsonProperty(JSON_PROPERTY_EXCLUSION_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExclusionListIds(List exclusionListIds) { + this.exclusionListIds = exclusionListIds; + } + + + public UpdateEmailCampaignRecipients listIds(List listIds) { + + this.listIds = listIds; + return this; + } + + public UpdateEmailCampaignRecipients addListIdsItem(Long listIdsItem) { + if (this.listIds == null) { + this.listIds = new ArrayList<>(); + } + this.listIds.add(listIdsItem); + return this; + } + + /** + * Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty** + * @return listIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getListIds() { + return listIds; + } + + + @JsonProperty(JSON_PROPERTY_LIST_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setListIds(List listIds) { + this.listIds = listIds; + } + + + public UpdateEmailCampaignRecipients segmentIds(List segmentIds) { + + this.segmentIds = segmentIds; + return this; + } + + public UpdateEmailCampaignRecipients addSegmentIdsItem(Long segmentIdsItem) { + if (this.segmentIds == null) { + this.segmentIds = new ArrayList<>(); + } + this.segmentIds.add(segmentIdsItem); + return this; + } + + /** + * **Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to. + * @return segmentIds + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSegmentIds() { + return segmentIds; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentIds(List segmentIds) { + this.segmentIds = segmentIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailCampaignRecipients updateEmailCampaignRecipients = (UpdateEmailCampaignRecipients) o; + return Objects.equals(this.exclusionListIds, updateEmailCampaignRecipients.exclusionListIds) && + Objects.equals(this.listIds, updateEmailCampaignRecipients.listIds) && + Objects.equals(this.segmentIds, updateEmailCampaignRecipients.segmentIds); + } + + @Override + public int hashCode() { + return Objects.hash(exclusionListIds, listIds, segmentIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEmailCampaignRecipients {\n"); + sb.append(" exclusionListIds: ").append(toIndentedString(exclusionListIds)).append("\n"); + sb.append(" listIds: ").append(toIndentedString(listIds)).append("\n"); + sb.append(" segmentIds: ").append(toIndentedString(segmentIds)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `exclusionListIds` to the URL query string + if (getExclusionListIds() != null) { + for (int i = 0; i < getExclusionListIds().size(); i++) { + try { + joiner.add(String.format("%sexclusionListIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getExclusionListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `listIds` to the URL query string + if (getListIds() != null) { + for (int i = 0; i < getListIds().size(); i++) { + try { + joiner.add(String.format("%slistIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getListIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `segmentIds` to the URL query string + if (getSegmentIds() != null) { + for (int i = 0; i < getSegmentIds().size(); i++) { + try { + joiner.add(String.format("%ssegmentIds%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getSegmentIds().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignSender.java new file mode 100644 index 0000000..e30ab3a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateEmailCampaignSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{\"name\":\"xyz\", \"email\":\"example@abc.com\"}** **{\"name\":\"xyz\", \"id\":123}** + */ +@JsonPropertyOrder({ + UpdateEmailCampaignSender.JSON_PROPERTY_NAME, + UpdateEmailCampaignSender.JSON_PROPERTY_EMAIL, + UpdateEmailCampaignSender.JSON_PROPERTY_ID +}) +@JsonTypeName("updateEmailCampaign_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateEmailCampaignSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public UpdateEmailCampaignSender() { + } + + public UpdateEmailCampaignSender name(String name) { + + this.name = name; + return this; + } + + /** + * Sender Name from which the campaign emails are sent + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateEmailCampaignSender email(String email) { + + this.email = email; + return this; + } + + /** + * Sender email from which the campaign emails are sent + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public UpdateEmailCampaignSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailCampaignSender updateEmailCampaignSender = (UpdateEmailCampaignSender) o; + return Objects.equals(this.name, updateEmailCampaignSender.name) && + Objects.equals(this.email, updateEmailCampaignSender.email) && + Objects.equals(this.id, updateEmailCampaignSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEmailCampaignSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateExternalFeed.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateExternalFeed.java new file mode 100644 index 0000000..891dab9 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateExternalFeed.java @@ -0,0 +1,539 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.GetExternalFeedByUUIDHeadersInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateExternalFeed + */ +@JsonPropertyOrder({ + UpdateExternalFeed.JSON_PROPERTY_NAME, + UpdateExternalFeed.JSON_PROPERTY_URL, + UpdateExternalFeed.JSON_PROPERTY_AUTH_TYPE, + UpdateExternalFeed.JSON_PROPERTY_USERNAME, + UpdateExternalFeed.JSON_PROPERTY_PASSWORD, + UpdateExternalFeed.JSON_PROPERTY_TOKEN, + UpdateExternalFeed.JSON_PROPERTY_HEADERS, + UpdateExternalFeed.JSON_PROPERTY_MAX_RETRIES, + UpdateExternalFeed.JSON_PROPERTY_CACHE +}) +@JsonTypeName("updateExternalFeed") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateExternalFeed { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + */ + public enum AuthTypeEnum { + BASIC("basic"), + + TOKEN("token"), + + NOAUTH("noAuth"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_AUTH_TYPE = "authType"; + private AuthTypeEnum authType; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers; + + public static final String JSON_PROPERTY_MAX_RETRIES = "maxRetries"; + private Integer maxRetries = 5; + + public static final String JSON_PROPERTY_CACHE = "cache"; + private Boolean cache = false; + + public UpdateExternalFeed() { + } + + public UpdateExternalFeed name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the feed + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateExternalFeed url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the feed + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public UpdateExternalFeed authType(AuthTypeEnum authType) { + + this.authType = authType; + return this; + } + + /** + * Auth type of the feed: * `basic` * `token` * `noAuth` + * @return authType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AuthTypeEnum getAuthType() { + return authType; + } + + + @JsonProperty(JSON_PROPERTY_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthType(AuthTypeEnum authType) { + this.authType = authType; + } + + + public UpdateExternalFeed username(String username) { + + this.username = username; + return this; + } + + /** + * Username for authType `basic` + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + + public UpdateExternalFeed password(String password) { + + this.password = password; + return this; + } + + /** + * Password for authType `basic` + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + + public UpdateExternalFeed token(String token) { + + this.token = token; + return this; + } + + /** + * Token for authType `token` + * @return token + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(String token) { + this.token = token; + } + + + public UpdateExternalFeed headers(List headers) { + + this.headers = headers; + return this; + } + + public UpdateExternalFeed addHeadersItem(GetExternalFeedByUUIDHeadersInner headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Custom headers for the feed + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + + public UpdateExternalFeed maxRetries(Integer maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Maximum number of retries on the feed url + * minimum: 0 + * maximum: 5 + * @return maxRetries + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxRetries() { + return maxRetries; + } + + + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + + public UpdateExternalFeed cache(Boolean cache) { + + this.cache = cache; + return this; + } + + /** + * Toggle caching of feed url response + * @return cache + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCache() { + return cache; + } + + + @JsonProperty(JSON_PROPERTY_CACHE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCache(Boolean cache) { + this.cache = cache; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateExternalFeed updateExternalFeed = (UpdateExternalFeed) o; + return Objects.equals(this.name, updateExternalFeed.name) && + Objects.equals(this.url, updateExternalFeed.url) && + Objects.equals(this.authType, updateExternalFeed.authType) && + Objects.equals(this.username, updateExternalFeed.username) && + Objects.equals(this.password, updateExternalFeed.password) && + Objects.equals(this.token, updateExternalFeed.token) && + Objects.equals(this.headers, updateExternalFeed.headers) && + Objects.equals(this.maxRetries, updateExternalFeed.maxRetries) && + Objects.equals(this.cache, updateExternalFeed.cache); + } + + @Override + public int hashCode() { + return Objects.hash(name, url, authType, username, password, token, headers, maxRetries, cache); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateExternalFeed {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" cache: ").append(toIndentedString(cache)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `authType` to the URL query string + if (getAuthType() != null) { + try { + joiner.add(String.format("%sauthType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `username` to the URL query string + if (getUsername() != null) { + try { + joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `password` to the URL query string + if (getPassword() != null) { + try { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `token` to the URL query string + if (getToken() != null) { + try { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToken()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + if (getHeaders().get(i) != null) { + joiner.add(getHeaders().get(i).toUrlQueryString(String.format("%sheaders%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `maxRetries` to the URL query string + if (getMaxRetries() != null) { + try { + joiner.add(String.format("%smaxRetries%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMaxRetries()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `cache` to the URL query string + if (getCache() != null) { + try { + joiner.add(String.format("%scache%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCache()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateList.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateList.java new file mode 100644 index 0000000..3667362 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateList.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateList + */ +@JsonPropertyOrder({ + UpdateList.JSON_PROPERTY_NAME, + UpdateList.JSON_PROPERTY_FOLDER_ID +}) +@JsonTypeName("updateList") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateList { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_FOLDER_ID = "folderId"; + private Long folderId; + + public UpdateList() { + } + + public UpdateList name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the list. Either of the two parameters (name, folderId) can be updated at a time. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateList folderId(Long folderId) { + + this.folderId = folderId; + return this; + } + + /** + * Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. + * @return folderId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFolderId() { + return folderId; + } + + + @JsonProperty(JSON_PROPERTY_FOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateList updateList = (UpdateList) o; + return Objects.equals(this.name, updateList.name) && + Objects.equals(this.folderId, updateList.folderId); + } + + @Override + public int hashCode() { + return Objects.hash(name, folderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateList {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" folderId: ").append(toIndentedString(folderId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `folderId` to the URL query string + if (getFolderId() != null) { + try { + joiner.add(String.format("%sfolderId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFolderId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSender.java new file mode 100644 index 0000000..c052d6c --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSender.java @@ -0,0 +1,248 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.CreateSenderIpsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateSender + */ +@JsonPropertyOrder({ + UpdateSender.JSON_PROPERTY_NAME, + UpdateSender.JSON_PROPERTY_EMAIL, + UpdateSender.JSON_PROPERTY_IPS +}) +@JsonTypeName("updateSender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_IPS = "ips"; + private List ips; + + public UpdateSender() { + } + + public UpdateSender name(String name) { + + this.name = name; + return this; + } + + /** + * From Name to update the sender + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateSender email(String email) { + + this.email = email; + return this; + } + + /** + * From Email to update the sender + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public UpdateSender ips(List ips) { + + this.ips = ips; + return this; + } + + public UpdateSender addIpsItem(CreateSenderIpsInner ipsItem) { + if (this.ips == null) { + this.ips = new ArrayList<>(); + } + this.ips.add(ipsItem); + return this; + } + + /** + * **Only in case of dedicated IP**. IPs to associate to the sender. If passed, will replace all the existing IPs. + * @return ips + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIps() { + return ips; + } + + + @JsonProperty(JSON_PROPERTY_IPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIps(List ips) { + this.ips = ips; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSender updateSender = (UpdateSender) o; + return Objects.equals(this.name, updateSender.name) && + Objects.equals(this.email, updateSender.email) && + Objects.equals(this.ips, updateSender.ips); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, ips); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" ips: ").append(toIndentedString(ips)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `ips` to the URL query string + if (getIps() != null) { + for (int i = 0; i < getIps().size(); i++) { + if (getIps().get(i) != null) { + joiner.add(getIps().get(i).toUrlQueryString(String.format("%sips%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmsCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmsCampaign.java new file mode 100644 index 0000000..9d56c5f --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmsCampaign.java @@ -0,0 +1,442 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateSmsCampaignRecipients; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateSmsCampaign + */ +@JsonPropertyOrder({ + UpdateSmsCampaign.JSON_PROPERTY_NAME, + UpdateSmsCampaign.JSON_PROPERTY_SENDER, + UpdateSmsCampaign.JSON_PROPERTY_CONTENT, + UpdateSmsCampaign.JSON_PROPERTY_RECIPIENTS, + UpdateSmsCampaign.JSON_PROPERTY_SCHEDULED_AT, + UpdateSmsCampaign.JSON_PROPERTY_UNICODE_ENABLED, + UpdateSmsCampaign.JSON_PROPERTY_ORGANISATION_PREFIX, + UpdateSmsCampaign.JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION +}) +@JsonTypeName("updateSmsCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSmsCampaign { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private CreateSmsCampaignRecipients recipients; + + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private String scheduledAt; + + public static final String JSON_PROPERTY_UNICODE_ENABLED = "unicodeEnabled"; + private Boolean unicodeEnabled = false; + + public static final String JSON_PROPERTY_ORGANISATION_PREFIX = "organisationPrefix"; + private String organisationPrefix; + + public static final String JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION = "unsubscribeInstruction"; + private String unsubscribeInstruction; + + public UpdateSmsCampaign() { + } + + public UpdateSmsCampaign name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the campaign + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateSmsCampaign sender(String sender) { + + this.sender = sender; + return this; + } + + /** + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + * @return sender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(String sender) { + this.sender = sender; + } + + + public UpdateSmsCampaign content(String content) { + + this.content = content; + return this; + } + + /** + * Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS + * @return content + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(String content) { + this.content = content; + } + + + public UpdateSmsCampaign recipients(CreateSmsCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateSmsCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(CreateSmsCampaignRecipients recipients) { + this.recipients = recipients; + } + + + public UpdateSmsCampaign scheduledAt(String scheduledAt) { + + this.scheduledAt = scheduledAt; + return this; + } + + /** + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + * @return scheduledAt + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScheduledAt() { + return scheduledAt; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScheduledAt(String scheduledAt) { + this.scheduledAt = scheduledAt; + } + + + public UpdateSmsCampaign unicodeEnabled(Boolean unicodeEnabled) { + + this.unicodeEnabled = unicodeEnabled; + return this; + } + + /** + * Format of the message. It indicates whether the content should be treated as unicode or not. + * @return unicodeEnabled + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUnicodeEnabled() { + return unicodeEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UNICODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnicodeEnabled(Boolean unicodeEnabled) { + this.unicodeEnabled = unicodeEnabled; + } + + + public UpdateSmsCampaign organisationPrefix(String organisationPrefix) { + + this.organisationPrefix = organisationPrefix; + return this; + } + + /** + * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + * @return organisationPrefix + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOrganisationPrefix() { + return organisationPrefix; + } + + + @JsonProperty(JSON_PROPERTY_ORGANISATION_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrganisationPrefix(String organisationPrefix) { + this.organisationPrefix = organisationPrefix; + } + + + public UpdateSmsCampaign unsubscribeInstruction(String unsubscribeInstruction) { + + this.unsubscribeInstruction = unsubscribeInstruction; + return this; + } + + /** + * Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** + * @return unsubscribeInstruction + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUnsubscribeInstruction() { + return unsubscribeInstruction; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsubscribeInstruction(String unsubscribeInstruction) { + this.unsubscribeInstruction = unsubscribeInstruction; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSmsCampaign updateSmsCampaign = (UpdateSmsCampaign) o; + return Objects.equals(this.name, updateSmsCampaign.name) && + Objects.equals(this.sender, updateSmsCampaign.sender) && + Objects.equals(this.content, updateSmsCampaign.content) && + Objects.equals(this.recipients, updateSmsCampaign.recipients) && + Objects.equals(this.scheduledAt, updateSmsCampaign.scheduledAt) && + Objects.equals(this.unicodeEnabled, updateSmsCampaign.unicodeEnabled) && + Objects.equals(this.organisationPrefix, updateSmsCampaign.organisationPrefix) && + Objects.equals(this.unsubscribeInstruction, updateSmsCampaign.unsubscribeInstruction); + } + + @Override + public int hashCode() { + return Objects.hash(name, sender, content, recipients, scheduledAt, unicodeEnabled, organisationPrefix, unsubscribeInstruction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSmsCampaign {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); + sb.append(" unicodeEnabled: ").append(toIndentedString(unicodeEnabled)).append("\n"); + sb.append(" organisationPrefix: ").append(toIndentedString(organisationPrefix)).append("\n"); + sb.append(" unsubscribeInstruction: ").append(toIndentedString(unsubscribeInstruction)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + try { + joiner.add(String.format("%ssender%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSender()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `content` to the URL query string + if (getContent() != null) { + try { + joiner.add(String.format("%scontent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + try { + joiner.add(String.format("%sscheduledAt%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScheduledAt()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unicodeEnabled` to the URL query string + if (getUnicodeEnabled() != null) { + try { + joiner.add(String.format("%sunicodeEnabled%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnicodeEnabled()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `organisationPrefix` to the URL query string + if (getOrganisationPrefix() != null) { + try { + joiner.add(String.format("%sorganisationPrefix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrganisationPrefix()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribeInstruction` to the URL query string + if (getUnsubscribeInstruction() != null) { + try { + joiner.add(String.format("%sunsubscribeInstruction%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribeInstruction()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplate.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplate.java new file mode 100644 index 0000000..7a49f8b --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplate.java @@ -0,0 +1,526 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.UpdateSmtpTemplateSender; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateSmtpTemplate + */ +@JsonPropertyOrder({ + UpdateSmtpTemplate.JSON_PROPERTY_TAG, + UpdateSmtpTemplate.JSON_PROPERTY_SENDER, + UpdateSmtpTemplate.JSON_PROPERTY_TEMPLATE_NAME, + UpdateSmtpTemplate.JSON_PROPERTY_HTML_CONTENT, + UpdateSmtpTemplate.JSON_PROPERTY_HTML_URL, + UpdateSmtpTemplate.JSON_PROPERTY_SUBJECT, + UpdateSmtpTemplate.JSON_PROPERTY_REPLY_TO, + UpdateSmtpTemplate.JSON_PROPERTY_TO_FIELD, + UpdateSmtpTemplate.JSON_PROPERTY_ATTACHMENT_URL, + UpdateSmtpTemplate.JSON_PROPERTY_IS_ACTIVE +}) +@JsonTypeName("updateSmtpTemplate") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSmtpTemplate { + public static final String JSON_PROPERTY_TAG = "tag"; + private String tag; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private UpdateSmtpTemplateSender sender; + + public static final String JSON_PROPERTY_TEMPLATE_NAME = "templateName"; + private String templateName; + + public static final String JSON_PROPERTY_HTML_CONTENT = "htmlContent"; + private String htmlContent; + + public static final String JSON_PROPERTY_HTML_URL = "htmlUrl"; + private String htmlUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_REPLY_TO = "replyTo"; + private String replyTo; + + public static final String JSON_PROPERTY_TO_FIELD = "toField"; + private String toField; + + public static final String JSON_PROPERTY_ATTACHMENT_URL = "attachmentUrl"; + private String attachmentUrl; + + public static final String JSON_PROPERTY_IS_ACTIVE = "isActive"; + private Boolean isActive; + + public UpdateSmtpTemplate() { + } + + public UpdateSmtpTemplate tag(String tag) { + + this.tag = tag; + return this; + } + + /** + * Tag of the template + * @return tag + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTag() { + return tag; + } + + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTag(String tag) { + this.tag = tag; + } + + + public UpdateSmtpTemplate sender(UpdateSmtpTemplateSender sender) { + + this.sender = sender; + return this; + } + + /** + * Get sender + * @return sender + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UpdateSmtpTemplateSender getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(UpdateSmtpTemplateSender sender) { + this.sender = sender; + } + + + public UpdateSmtpTemplate templateName(String templateName) { + + this.templateName = templateName; + return this; + } + + /** + * Name of the template + * @return templateName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateName() { + return templateName; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + + public UpdateSmtpTemplate htmlContent(String htmlContent) { + + this.htmlContent = htmlContent; + return this; + } + + /** + * **Required if htmlUrl is empty**. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) + * @return htmlContent + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlContent() { + return htmlContent; + } + + + @JsonProperty(JSON_PROPERTY_HTML_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + + public UpdateSmtpTemplate htmlUrl(String htmlUrl) { + + this.htmlUrl = htmlUrl; + return this; + } + + /** + * **Required if htmlContent is empty**. URL to the body of the email (HTML) + * @return htmlUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHtmlUrl() { + return htmlUrl; + } + + + @JsonProperty(JSON_PROPERTY_HTML_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHtmlUrl(String htmlUrl) { + this.htmlUrl = htmlUrl; + } + + + public UpdateSmtpTemplate subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Subject of the email + * @return subject + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public UpdateSmtpTemplate replyTo(String replyTo) { + + this.replyTo = replyTo; + return this; + } + + /** + * Email on which campaign recipients will be able to reply to + * @return replyTo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReplyTo() { + return replyTo; + } + + + @JsonProperty(JSON_PROPERTY_REPLY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplyTo(String replyTo) { + this.replyTo = replyTo; + } + + + public UpdateSmtpTemplate toField(String toField) { + + this.toField = toField; + return this; + } + + /** + * To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + * @return toField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getToField() { + return toField; + } + + + @JsonProperty(JSON_PROPERTY_TO_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToField(String toField) { + this.toField = toField; + } + + + public UpdateSmtpTemplate attachmentUrl(String attachmentUrl) { + + this.attachmentUrl = attachmentUrl; + return this; + } + + /** + * Absolute url of the attachment (**no local file**). Extensions allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * @return attachmentUrl + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttachmentUrl() { + return attachmentUrl; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachmentUrl(String attachmentUrl) { + this.attachmentUrl = attachmentUrl; + } + + + public UpdateSmtpTemplate isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Status of the template. isActive = false means template is inactive, isActive = true means template is active + * @return isActive + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSmtpTemplate updateSmtpTemplate = (UpdateSmtpTemplate) o; + return Objects.equals(this.tag, updateSmtpTemplate.tag) && + Objects.equals(this.sender, updateSmtpTemplate.sender) && + Objects.equals(this.templateName, updateSmtpTemplate.templateName) && + Objects.equals(this.htmlContent, updateSmtpTemplate.htmlContent) && + Objects.equals(this.htmlUrl, updateSmtpTemplate.htmlUrl) && + Objects.equals(this.subject, updateSmtpTemplate.subject) && + Objects.equals(this.replyTo, updateSmtpTemplate.replyTo) && + Objects.equals(this.toField, updateSmtpTemplate.toField) && + Objects.equals(this.attachmentUrl, updateSmtpTemplate.attachmentUrl) && + Objects.equals(this.isActive, updateSmtpTemplate.isActive); + } + + @Override + public int hashCode() { + return Objects.hash(tag, sender, templateName, htmlContent, htmlUrl, subject, replyTo, toField, attachmentUrl, isActive); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSmtpTemplate {\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" htmlContent: ").append(toIndentedString(htmlContent)).append("\n"); + sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n"); + sb.append(" toField: ").append(toIndentedString(toField)).append("\n"); + sb.append(" attachmentUrl: ").append(toIndentedString(attachmentUrl)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tag` to the URL query string + if (getTag() != null) { + try { + joiner.add(String.format("%stag%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTag()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `sender` to the URL query string + if (getSender() != null) { + joiner.add(getSender().toUrlQueryString(prefix + "sender" + suffix)); + } + + // add `templateName` to the URL query string + if (getTemplateName() != null) { + try { + joiner.add(String.format("%stemplateName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTemplateName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlContent` to the URL query string + if (getHtmlContent() != null) { + try { + joiner.add(String.format("%shtmlContent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlContent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `htmlUrl` to the URL query string + if (getHtmlUrl() != null) { + try { + joiner.add(String.format("%shtmlUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHtmlUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `subject` to the URL query string + if (getSubject() != null) { + try { + joiner.add(String.format("%ssubject%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubject()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `replyTo` to the URL query string + if (getReplyTo() != null) { + try { + joiner.add(String.format("%sreplyTo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReplyTo()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `toField` to the URL query string + if (getToField() != null) { + try { + joiner.add(String.format("%stoField%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getToField()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `attachmentUrl` to the URL query string + if (getAttachmentUrl() != null) { + try { + joiner.add(String.format("%sattachmentUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAttachmentUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `isActive` to the URL query string + if (getIsActive() != null) { + try { + joiner.add(String.format("%sisActive%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsActive()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplateSender.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplateSender.java new file mode 100644 index 0000000..8a55ef4 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateSmtpTemplateSender.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{\"name\":\"xyz\", \"email\":\"example@abc.com\"}** **{\"name\":\"xyz\", \"id\":123}** + */ +@JsonPropertyOrder({ + UpdateSmtpTemplateSender.JSON_PROPERTY_NAME, + UpdateSmtpTemplateSender.JSON_PROPERTY_EMAIL, + UpdateSmtpTemplateSender.JSON_PROPERTY_ID +}) +@JsonTypeName("updateSmtpTemplate_sender") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSmtpTemplateSender { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public UpdateSmtpTemplateSender() { + } + + public UpdateSmtpTemplateSender name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the sender + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public UpdateSmtpTemplateSender email(String email) { + + this.email = email; + return this; + } + + /** + * Email of the sender + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + + public UpdateSmtpTemplateSender id(Long id) { + + this.id = id; + return this; + } + + /** + * Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSmtpTemplateSender updateSmtpTemplateSender = (UpdateSmtpTemplateSender) o; + return Objects.equals(this.name, updateSmtpTemplateSender.name) && + Objects.equals(this.email, updateSmtpTemplateSender.email) && + Objects.equals(this.id, updateSmtpTemplateSender.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, email, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSmtpTemplateSender {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `email` to the URL query string + if (getEmail() != null) { + try { + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `id` to the URL query string + if (getId() != null) { + try { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateUserResponse.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateUserResponse.java new file mode 100644 index 0000000..7120802 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateUserResponse.java @@ -0,0 +1,263 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateUserResponse + */ +@JsonPropertyOrder({ + UpdateUserResponse.JSON_PROPERTY_STATUS, + UpdateUserResponse.JSON_PROPERTY_CREDIT_NOTES, + UpdateUserResponse.JSON_PROPERTY_INVOICE_ID +}) +@JsonTypeName("updateUserResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateUserResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_CREDIT_NOTES = "credit_notes"; + private List creditNotes; + + public static final String JSON_PROPERTY_INVOICE_ID = "invoice_id"; + private List invoiceId; + + public UpdateUserResponse() { + } + + public UpdateUserResponse status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the API operation. + * @return status + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(String status) { + this.status = status; + } + + + public UpdateUserResponse creditNotes(List creditNotes) { + + this.creditNotes = creditNotes; + return this; + } + + public UpdateUserResponse addCreditNotesItem(String creditNotesItem) { + if (this.creditNotes == null) { + this.creditNotes = new ArrayList<>(); + } + this.creditNotes.add(creditNotesItem); + return this; + } + + /** + * Credit note + * @return creditNotes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCreditNotes() { + return creditNotes; + } + + + @JsonProperty(JSON_PROPERTY_CREDIT_NOTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreditNotes(List creditNotes) { + this.creditNotes = creditNotes; + } + + + public UpdateUserResponse invoiceId(List invoiceId) { + + this.invoiceId = invoiceId; + return this; + } + + public UpdateUserResponse addInvoiceIdItem(String invoiceIdItem) { + if (this.invoiceId == null) { + this.invoiceId = new ArrayList<>(); + } + this.invoiceId.add(invoiceIdItem); + return this; + } + + /** + * Invoice id + * @return invoiceId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVOICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getInvoiceId() { + return invoiceId; + } + + + @JsonProperty(JSON_PROPERTY_INVOICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvoiceId(List invoiceId) { + this.invoiceId = invoiceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserResponse updateUserResponse = (UpdateUserResponse) o; + return Objects.equals(this.status, updateUserResponse.status) && + Objects.equals(this.creditNotes, updateUserResponse.creditNotes) && + Objects.equals(this.invoiceId, updateUserResponse.invoiceId); + } + + @Override + public int hashCode() { + return Objects.hash(status, creditNotes, invoiceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateUserResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creditNotes: ").append(toIndentedString(creditNotes)).append("\n"); + sb.append(" invoiceId: ").append(toIndentedString(invoiceId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + try { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `credit_notes` to the URL query string + if (getCreditNotes() != null) { + for (int i = 0; i < getCreditNotes().size(); i++) { + try { + joiner.add(String.format("%scredit_notes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getCreditNotes().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `invoice_id` to the URL query string + if (getInvoiceId() != null) { + for (int i = 0; i < getInvoiceId().size(); i++) { + try { + joiner.add(String.format("%sinvoice_id%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getInvoiceId().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWebhook.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWebhook.java new file mode 100644 index 0000000..1f410e7 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWebhook.java @@ -0,0 +1,496 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateWebhook + */ +@JsonPropertyOrder({ + UpdateWebhook.JSON_PROPERTY_URL, + UpdateWebhook.JSON_PROPERTY_DESCRIPTION, + UpdateWebhook.JSON_PROPERTY_EVENTS, + UpdateWebhook.JSON_PROPERTY_DOMAIN, + UpdateWebhook.JSON_PROPERTY_BATCHED, + UpdateWebhook.JSON_PROPERTY_AUTH, + UpdateWebhook.JSON_PROPERTY_HEADERS +}) +@JsonTypeName("updateWebhook") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateWebhook { + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** + * Gets or Sets events + */ + public enum EventsEnum { + SENT("sent"), + + HARDBOUNCE("hardBounce"), + + SOFTBOUNCE("softBounce"), + + BLOCKED("blocked"), + + SPAM("spam"), + + DELIVERED("delivered"), + + REQUEST("request"), + + CLICK("click"), + + INVALID("invalid"), + + DEFERRED("deferred"), + + OPENED("opened"), + + UNIQUEOPENED("uniqueOpened"), + + UNSUBSCRIBED("unsubscribed"), + + LISTADDITION("listAddition"), + + CONTACTUPDATED("contactUpdated"), + + CONTACTDELETED("contactDeleted"), + + INBOUNDEMAILPROCESSED("inboundEmailProcessed"); + + private String value; + + EventsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventsEnum fromValue(String value) { + for (EventsEnum b : EventsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EVENTS = "events"; + private List events; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private String domain; + + public static final String JSON_PROPERTY_BATCHED = "batched"; + private Boolean batched; + + public static final String JSON_PROPERTY_AUTH = "auth"; + private Object auth; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers; + + public UpdateWebhook() { + } + + public UpdateWebhook url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the webhook + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + + public UpdateWebhook description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the webhook + * @return description + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + + public UpdateWebhook events(List events) { + + this.events = events; + return this; + } + + public UpdateWebhook addEventsItem(EventsEnum eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` + * @return events + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEvents() { + return events; + } + + + @JsonProperty(JSON_PROPERTY_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvents(List events) { + this.events = events; + } + + + public UpdateWebhook domain(String domain) { + + this.domain = domain; + return this; + } + + /** + * Inbound domain of webhook, used in case of event type `inbound` + * @return domain + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(String domain) { + this.domain = domain; + } + + + public UpdateWebhook batched(Boolean batched) { + + this.batched = batched; + return this; + } + + /** + * Batching configuration of the webhook, we send batched webhooks if its true + * @return batched + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getBatched() { + return batched; + } + + + @JsonProperty(JSON_PROPERTY_BATCHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatched(Boolean batched) { + this.batched = batched; + } + + + public UpdateWebhook auth(Object auth) { + + this.auth = auth; + return this; + } + + /** + * Authentication header to be send with the webhook requests + * @return auth + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAuth() { + return auth; + } + + + @JsonProperty(JSON_PROPERTY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuth(Object auth) { + this.auth = auth; + } + + + public UpdateWebhook headers(List headers) { + + this.headers = headers; + return this; + } + + public UpdateWebhook addHeadersItem(Object headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Get headers + * @return headers + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateWebhook updateWebhook = (UpdateWebhook) o; + return Objects.equals(this.url, updateWebhook.url) && + Objects.equals(this.description, updateWebhook.description) && + Objects.equals(this.events, updateWebhook.events) && + Objects.equals(this.domain, updateWebhook.domain) && + Objects.equals(this.batched, updateWebhook.batched) && + Objects.equals(this.auth, updateWebhook.auth) && + Objects.equals(this.headers, updateWebhook.headers); + } + + @Override + public int hashCode() { + return Objects.hash(url, description, events, domain, batched, auth, headers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateWebhook {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" batched: ").append(toIndentedString(batched)).append("\n"); + sb.append(" auth: ").append(toIndentedString(auth)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `description` to the URL query string + if (getDescription() != null) { + try { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `events` to the URL query string + if (getEvents() != null) { + for (int i = 0; i < getEvents().size(); i++) { + try { + joiner.add(String.format("%sevents%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getEvents().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `domain` to the URL query string + if (getDomain() != null) { + try { + joiner.add(String.format("%sdomain%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDomain()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `batched` to the URL query string + if (getBatched() != null) { + try { + joiner.add(String.format("%sbatched%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBatched()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `auth` to the URL query string + if (getAuth() != null) { + try { + joiner.add(String.format("%sauth%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuth()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `headers` to the URL query string + if (getHeaders() != null) { + for (int i = 0; i < getHeaders().size(); i++) { + try { + joiner.add(String.format("%sheaders%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getHeaders().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWhatsAppCampaign.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWhatsAppCampaign.java new file mode 100644 index 0000000..8920d7a --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UpdateWhatsAppCampaign.java @@ -0,0 +1,309 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import software.xdev.brevo.model.CreateWhatsAppCampaignRecipients; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UpdateWhatsAppCampaign + */ +@JsonPropertyOrder({ + UpdateWhatsAppCampaign.JSON_PROPERTY_CAMPAIGN_NAME, + UpdateWhatsAppCampaign.JSON_PROPERTY_CAMPAIGN_STATUS, + UpdateWhatsAppCampaign.JSON_PROPERTY_RESCHEDULE_FOR, + UpdateWhatsAppCampaign.JSON_PROPERTY_RECIPIENTS +}) +@JsonTypeName("updateWhatsAppCampaign") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateWhatsAppCampaign { + public static final String JSON_PROPERTY_CAMPAIGN_NAME = "campaignName"; + private String campaignName; + + /** + * Status of the campaign + */ + public enum CampaignStatusEnum { + SCHEDULED("scheduled"), + + SUSPENDED("suspended"); + + private String value; + + CampaignStatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CampaignStatusEnum fromValue(String value) { + for (CampaignStatusEnum b : CampaignStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CAMPAIGN_STATUS = "campaignStatus"; + private CampaignStatusEnum campaignStatus = CampaignStatusEnum.SCHEDULED; + + public static final String JSON_PROPERTY_RESCHEDULE_FOR = "rescheduleFor"; + private String rescheduleFor; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private CreateWhatsAppCampaignRecipients recipients; + + public UpdateWhatsAppCampaign() { + } + + public UpdateWhatsAppCampaign campaignName(String campaignName) { + + this.campaignName = campaignName; + return this; + } + + /** + * Name of the campaign + * @return campaignName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCampaignName() { + return campaignName; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaignName(String campaignName) { + this.campaignName = campaignName; + } + + + public UpdateWhatsAppCampaign campaignStatus(CampaignStatusEnum campaignStatus) { + + this.campaignStatus = campaignStatus; + return this; + } + + /** + * Status of the campaign + * @return campaignStatus + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CampaignStatusEnum getCampaignStatus() { + return campaignStatus; + } + + + @JsonProperty(JSON_PROPERTY_CAMPAIGN_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaignStatus(CampaignStatusEnum campaignStatus) { + this.campaignStatus = campaignStatus; + } + + + public UpdateWhatsAppCampaign rescheduleFor(String rescheduleFor) { + + this.rescheduleFor = rescheduleFor; + return this; + } + + /** + * Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. + * @return rescheduleFor + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESCHEDULE_FOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRescheduleFor() { + return rescheduleFor; + } + + + @JsonProperty(JSON_PROPERTY_RESCHEDULE_FOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRescheduleFor(String rescheduleFor) { + this.rescheduleFor = rescheduleFor; + } + + + public UpdateWhatsAppCampaign recipients(CreateWhatsAppCampaignRecipients recipients) { + + this.recipients = recipients; + return this; + } + + /** + * Get recipients + * @return recipients + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CreateWhatsAppCampaignRecipients getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(CreateWhatsAppCampaignRecipients recipients) { + this.recipients = recipients; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateWhatsAppCampaign updateWhatsAppCampaign = (UpdateWhatsAppCampaign) o; + return Objects.equals(this.campaignName, updateWhatsAppCampaign.campaignName) && + Objects.equals(this.campaignStatus, updateWhatsAppCampaign.campaignStatus) && + Objects.equals(this.rescheduleFor, updateWhatsAppCampaign.rescheduleFor) && + Objects.equals(this.recipients, updateWhatsAppCampaign.recipients); + } + + @Override + public int hashCode() { + return Objects.hash(campaignName, campaignStatus, rescheduleFor, recipients); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateWhatsAppCampaign {\n"); + sb.append(" campaignName: ").append(toIndentedString(campaignName)).append("\n"); + sb.append(" campaignStatus: ").append(toIndentedString(campaignStatus)).append("\n"); + sb.append(" rescheduleFor: ").append(toIndentedString(rescheduleFor)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `campaignName` to the URL query string + if (getCampaignName() != null) { + try { + joiner.add(String.format("%scampaignName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `campaignStatus` to the URL query string + if (getCampaignStatus() != null) { + try { + joiner.add(String.format("%scampaignStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCampaignStatus()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `rescheduleFor` to the URL query string + if (getRescheduleFor() != null) { + try { + joiner.add(String.format("%srescheduleFor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRescheduleFor()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `recipients` to the URL query string + if (getRecipients() != null) { + joiner.add(getRecipients().toUrlQueryString(prefix + "recipients" + suffix)); + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageModel.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageModel.java new file mode 100644 index 0000000..2b897a1 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageModel.java @@ -0,0 +1,152 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UploadImageModel + */ +@JsonPropertyOrder({ + UploadImageModel.JSON_PROPERTY_URL +}) +@JsonTypeName("uploadImageModel") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UploadImageModel { + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public UploadImageModel() { + } + + public UploadImageModel url(String url) { + + this.url = url; + return this; + } + + /** + * URL of the image uploaded + * @return url + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadImageModel uploadImageModel = (UploadImageModel) o; + return Objects.equals(this.url, uploadImageModel.url); + } + + @Override + public int hashCode() { + return Objects.hash(url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadImageModel {\n"); + sb.append(" url: ").append(toIndentedString(url)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + try { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageToGallery.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageToGallery.java new file mode 100644 index 0000000..0db77dc --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/UploadImageToGallery.java @@ -0,0 +1,194 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * UploadImageToGallery + */ +@JsonPropertyOrder({ + UploadImageToGallery.JSON_PROPERTY_IMAGE_URL, + UploadImageToGallery.JSON_PROPERTY_NAME +}) +@JsonTypeName("uploadImageToGallery") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UploadImageToGallery { + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; + private String imageUrl; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public UploadImageToGallery() { + } + + public UploadImageToGallery imageUrl(String imageUrl) { + + this.imageUrl = imageUrl; + return this; + } + + /** + * The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. Allowed extensions for images are: #### jpeg, jpg, png, bmp, gif. + * @return imageUrl + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getImageUrl() { + return imageUrl; + } + + + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + + public UploadImageToGallery name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the image. + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadImageToGallery uploadImageToGallery = (UploadImageToGallery) o; + return Objects.equals(this.imageUrl, uploadImageToGallery.imageUrl) && + Objects.equals(this.name, uploadImageToGallery.name); + } + + @Override + public int hashCode() { + return Objects.hash(imageUrl, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadImageToGallery {\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `imageUrl` to the URL query string + if (getImageUrl() != null) { + try { + joiner.add(String.format("%simageUrl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getImageUrl()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/VariablesItems.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/VariablesItems.java new file mode 100644 index 0000000..e5c6f71 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/VariablesItems.java @@ -0,0 +1,236 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * VariablesItems + */ +@JsonPropertyOrder({ + VariablesItems.JSON_PROPERTY_NAME, + VariablesItems.JSON_PROPERTY_DEFAULT, + VariablesItems.JSON_PROPERTY_DATATYPE +}) +@JsonTypeName("variablesItems") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VariablesItems { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DEFAULT = "default"; + private String _default; + + public static final String JSON_PROPERTY_DATATYPE = "datatype"; + private String datatype; + + public VariablesItems() { + } + + public VariablesItems name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public VariablesItems _default(String _default) { + + this._default = _default; + return this; + } + + /** + * Get _default + * @return _default + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDefault() { + return _default; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefault(String _default) { + this._default = _default; + } + + + public VariablesItems datatype(String datatype) { + + this.datatype = datatype; + return this; + } + + /** + * Get datatype + * @return datatype + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATATYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDatatype() { + return datatype; + } + + + @JsonProperty(JSON_PROPERTY_DATATYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDatatype(String datatype) { + this.datatype = datatype; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VariablesItems variablesItems = (VariablesItems) o; + return Objects.equals(this.name, variablesItems.name) && + Objects.equals(this._default, variablesItems._default) && + Objects.equals(this.datatype, variablesItems.datatype); + } + + @Override + public int hashCode() { + return Objects.hash(name, _default, datatype); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VariablesItems {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" datatype: ").append(toIndentedString(datatype)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `default` to the URL query string + if (getDefault() != null) { + try { + joiner.add(String.format("%sdefault%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefault()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `datatype` to the URL query string + if (getDatatype() != null) { + try { + joiner.add(String.format("%sdatatype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDatatype()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampStats.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampStats.java new file mode 100644 index 0000000..589bd58 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampStats.java @@ -0,0 +1,319 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * WhatsappCampStats + */ +@JsonPropertyOrder({ + WhatsappCampStats.JSON_PROPERTY_SENT, + WhatsappCampStats.JSON_PROPERTY_DELIVERED, + WhatsappCampStats.JSON_PROPERTY_READ, + WhatsappCampStats.JSON_PROPERTY_UNSUBSCRIBE, + WhatsappCampStats.JSON_PROPERTY_NOT_SENT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WhatsappCampStats { + public static final String JSON_PROPERTY_SENT = "sent"; + private Integer sent; + + public static final String JSON_PROPERTY_DELIVERED = "delivered"; + private Integer delivered; + + public static final String JSON_PROPERTY_READ = "read"; + private Integer read; + + public static final String JSON_PROPERTY_UNSUBSCRIBE = "unsubscribe"; + private Integer unsubscribe; + + public static final String JSON_PROPERTY_NOT_SENT = "notSent"; + private Integer notSent; + + public WhatsappCampStats() { + } + + public WhatsappCampStats sent(Integer sent) { + + this.sent = sent; + return this; + } + + /** + * Get sent + * @return sent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSent() { + return sent; + } + + + @JsonProperty(JSON_PROPERTY_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSent(Integer sent) { + this.sent = sent; + } + + + public WhatsappCampStats delivered(Integer delivered) { + + this.delivered = delivered; + return this; + } + + /** + * Get delivered + * @return delivered + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getDelivered() { + return delivered; + } + + + @JsonProperty(JSON_PROPERTY_DELIVERED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelivered(Integer delivered) { + this.delivered = delivered; + } + + + public WhatsappCampStats read(Integer read) { + + this.read = read; + return this; + } + + /** + * Get read + * @return read + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_READ) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getRead() { + return read; + } + + + @JsonProperty(JSON_PROPERTY_READ) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRead(Integer read) { + this.read = read; + } + + + public WhatsappCampStats unsubscribe(Integer unsubscribe) { + + this.unsubscribe = unsubscribe; + return this; + } + + /** + * Get unsubscribe + * @return unsubscribe + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getUnsubscribe() { + return unsubscribe; + } + + + @JsonProperty(JSON_PROPERTY_UNSUBSCRIBE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnsubscribe(Integer unsubscribe) { + this.unsubscribe = unsubscribe; + } + + + public WhatsappCampStats notSent(Integer notSent) { + + this.notSent = notSent; + return this; + } + + /** + * Get notSent + * @return notSent + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NOT_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getNotSent() { + return notSent; + } + + + @JsonProperty(JSON_PROPERTY_NOT_SENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNotSent(Integer notSent) { + this.notSent = notSent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WhatsappCampStats whatsappCampStats = (WhatsappCampStats) o; + return Objects.equals(this.sent, whatsappCampStats.sent) && + Objects.equals(this.delivered, whatsappCampStats.delivered) && + Objects.equals(this.read, whatsappCampStats.read) && + Objects.equals(this.unsubscribe, whatsappCampStats.unsubscribe) && + Objects.equals(this.notSent, whatsappCampStats.notSent); + } + + @Override + public int hashCode() { + return Objects.hash(sent, delivered, read, unsubscribe, notSent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WhatsappCampStats {\n"); + sb.append(" sent: ").append(toIndentedString(sent)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" read: ").append(toIndentedString(read)).append("\n"); + sb.append(" unsubscribe: ").append(toIndentedString(unsubscribe)).append("\n"); + sb.append(" notSent: ").append(toIndentedString(notSent)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sent` to the URL query string + if (getSent() != null) { + try { + joiner.add(String.format("%ssent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `delivered` to the URL query string + if (getDelivered() != null) { + try { + joiner.add(String.format("%sdelivered%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDelivered()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `read` to the URL query string + if (getRead() != null) { + try { + joiner.add(String.format("%sread%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRead()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `unsubscribe` to the URL query string + if (getUnsubscribe() != null) { + try { + joiner.add(String.format("%sunsubscribe%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUnsubscribe()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `notSent` to the URL query string + if (getNotSent() != null) { + try { + joiner.add(String.format("%snotSent%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNotSent()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampTemplate.java b/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampTemplate.java new file mode 100644 index 0000000..383c864 --- /dev/null +++ b/brevo-java-client/src/generated/java/software/xdev/brevo/model/WhatsappCampTemplate.java @@ -0,0 +1,600 @@ +/* + * Brevo API + * Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + * + * 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 software.xdev.brevo.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import software.xdev.brevo.model.ComponentItems; +import software.xdev.brevo.model.VariablesItems; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * WhatsappCampTemplate + */ +@JsonPropertyOrder({ + WhatsappCampTemplate.JSON_PROPERTY_NAME, + WhatsappCampTemplate.JSON_PROPERTY_CATEGORY, + WhatsappCampTemplate.JSON_PROPERTY_LANGUAGE, + WhatsappCampTemplate.JSON_PROPERTY_CONTAINS_BUTTON, + WhatsappCampTemplate.JSON_PROPERTY_DISPLAY_HEADER, + WhatsappCampTemplate.JSON_PROPERTY_HEADER_TYPE, + WhatsappCampTemplate.JSON_PROPERTY_COMPONENTS, + WhatsappCampTemplate.JSON_PROPERTY_HEADER_VARIABLES, + WhatsappCampTemplate.JSON_PROPERTY_BODY_VARIABLES, + WhatsappCampTemplate.JSON_PROPERTY_BUTTON_TYPE, + WhatsappCampTemplate.JSON_PROPERTY_HIDE_FOOTER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WhatsappCampTemplate { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private String language; + + public static final String JSON_PROPERTY_CONTAINS_BUTTON = "contains_button"; + private Boolean containsButton; + + public static final String JSON_PROPERTY_DISPLAY_HEADER = "display_header"; + private Boolean displayHeader; + + public static final String JSON_PROPERTY_HEADER_TYPE = "header_type"; + private String headerType; + + public static final String JSON_PROPERTY_COMPONENTS = "components"; + private List components; + + public static final String JSON_PROPERTY_HEADER_VARIABLES = "header_variables"; + private List headerVariables; + + public static final String JSON_PROPERTY_BODY_VARIABLES = "body_variables"; + private List bodyVariables; + + public static final String JSON_PROPERTY_BUTTON_TYPE = "button_type"; + private String buttonType; + + public static final String JSON_PROPERTY_HIDE_FOOTER = "hide_footer"; + private Boolean hideFooter; + + public WhatsappCampTemplate() { + } + + public WhatsappCampTemplate name(String name) { + + this.name = name; + return this; + } + + /** + * name of the template + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + public WhatsappCampTemplate category(String category) { + + this.category = category; + return this; + } + + /** + * description of the template + * @return category + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(String category) { + this.category = category; + } + + + public WhatsappCampTemplate language(String language) { + + this.language = language; + return this; + } + + /** + * language of the template + * @return language + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(String language) { + this.language = language; + } + + + public WhatsappCampTemplate containsButton(Boolean containsButton) { + + this.containsButton = containsButton; + return this; + } + + /** + * Get containsButton + * @return containsButton + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTAINS_BUTTON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getContainsButton() { + return containsButton; + } + + + @JsonProperty(JSON_PROPERTY_CONTAINS_BUTTON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainsButton(Boolean containsButton) { + this.containsButton = containsButton; + } + + + public WhatsappCampTemplate displayHeader(Boolean displayHeader) { + + this.displayHeader = displayHeader; + return this; + } + + /** + * Get displayHeader + * @return displayHeader + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisplayHeader() { + return displayHeader; + } + + + @JsonProperty(JSON_PROPERTY_DISPLAY_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayHeader(Boolean displayHeader) { + this.displayHeader = displayHeader; + } + + + public WhatsappCampTemplate headerType(String headerType) { + + this.headerType = headerType; + return this; + } + + /** + * type of header + * @return headerType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeaderType() { + return headerType; + } + + + @JsonProperty(JSON_PROPERTY_HEADER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderType(String headerType) { + this.headerType = headerType; + } + + + public WhatsappCampTemplate components(List components) { + + this.components = components; + return this; + } + + public WhatsappCampTemplate addComponentsItem(ComponentItems componentsItem) { + if (this.components == null) { + this.components = new ArrayList<>(); + } + this.components.add(componentsItem); + return this; + } + + /** + * array of component item objects + * @return components + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPONENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getComponents() { + return components; + } + + + @JsonProperty(JSON_PROPERTY_COMPONENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComponents(List components) { + this.components = components; + } + + + public WhatsappCampTemplate headerVariables(List headerVariables) { + + this.headerVariables = headerVariables; + return this; + } + + public WhatsappCampTemplate addHeaderVariablesItem(VariablesItems headerVariablesItem) { + if (this.headerVariables == null) { + this.headerVariables = new ArrayList<>(); + } + this.headerVariables.add(headerVariablesItem); + return this; + } + + /** + * array of variables item object + * @return headerVariables + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaderVariables() { + return headerVariables; + } + + + @JsonProperty(JSON_PROPERTY_HEADER_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderVariables(List headerVariables) { + this.headerVariables = headerVariables; + } + + + public WhatsappCampTemplate bodyVariables(List bodyVariables) { + + this.bodyVariables = bodyVariables; + return this; + } + + public WhatsappCampTemplate addBodyVariablesItem(VariablesItems bodyVariablesItem) { + if (this.bodyVariables == null) { + this.bodyVariables = new ArrayList<>(); + } + this.bodyVariables.add(bodyVariablesItem); + return this; + } + + /** + * array of variables item variables + * @return bodyVariables + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBodyVariables() { + return bodyVariables; + } + + + @JsonProperty(JSON_PROPERTY_BODY_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBodyVariables(List bodyVariables) { + this.bodyVariables = bodyVariables; + } + + + public WhatsappCampTemplate buttonType(String buttonType) { + + this.buttonType = buttonType; + return this; + } + + /** + * Get buttonType + * @return buttonType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUTTON_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getButtonType() { + return buttonType; + } + + + @JsonProperty(JSON_PROPERTY_BUTTON_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setButtonType(String buttonType) { + this.buttonType = buttonType; + } + + + public WhatsappCampTemplate hideFooter(Boolean hideFooter) { + + this.hideFooter = hideFooter; + return this; + } + + /** + * Get hideFooter + * @return hideFooter + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideFooter() { + return hideFooter; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_FOOTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideFooter(Boolean hideFooter) { + this.hideFooter = hideFooter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WhatsappCampTemplate whatsappCampTemplate = (WhatsappCampTemplate) o; + return Objects.equals(this.name, whatsappCampTemplate.name) && + Objects.equals(this.category, whatsappCampTemplate.category) && + Objects.equals(this.language, whatsappCampTemplate.language) && + Objects.equals(this.containsButton, whatsappCampTemplate.containsButton) && + Objects.equals(this.displayHeader, whatsappCampTemplate.displayHeader) && + Objects.equals(this.headerType, whatsappCampTemplate.headerType) && + Objects.equals(this.components, whatsappCampTemplate.components) && + Objects.equals(this.headerVariables, whatsappCampTemplate.headerVariables) && + Objects.equals(this.bodyVariables, whatsappCampTemplate.bodyVariables) && + Objects.equals(this.buttonType, whatsappCampTemplate.buttonType) && + Objects.equals(this.hideFooter, whatsappCampTemplate.hideFooter); + } + + @Override + public int hashCode() { + return Objects.hash(name, category, language, containsButton, displayHeader, headerType, components, headerVariables, bodyVariables, buttonType, hideFooter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WhatsappCampTemplate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" containsButton: ").append(toIndentedString(containsButton)).append("\n"); + sb.append(" displayHeader: ").append(toIndentedString(displayHeader)).append("\n"); + sb.append(" headerType: ").append(toIndentedString(headerType)).append("\n"); + sb.append(" components: ").append(toIndentedString(components)).append("\n"); + sb.append(" headerVariables: ").append(toIndentedString(headerVariables)).append("\n"); + sb.append(" bodyVariables: ").append(toIndentedString(bodyVariables)).append("\n"); + sb.append(" buttonType: ").append(toIndentedString(buttonType)).append("\n"); + sb.append(" hideFooter: ").append(toIndentedString(hideFooter)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `category` to the URL query string + if (getCategory() != null) { + try { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCategory()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `language` to the URL query string + if (getLanguage() != null) { + try { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLanguage()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `contains_button` to the URL query string + if (getContainsButton() != null) { + try { + joiner.add(String.format("%scontains_button%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContainsButton()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `display_header` to the URL query string + if (getDisplayHeader() != null) { + try { + joiner.add(String.format("%sdisplay_header%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDisplayHeader()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `header_type` to the URL query string + if (getHeaderType() != null) { + try { + joiner.add(String.format("%sheader_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHeaderType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `components` to the URL query string + if (getComponents() != null) { + for (int i = 0; i < getComponents().size(); i++) { + if (getComponents().get(i) != null) { + joiner.add(getComponents().get(i).toUrlQueryString(String.format("%scomponents%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `header_variables` to the URL query string + if (getHeaderVariables() != null) { + for (int i = 0; i < getHeaderVariables().size(); i++) { + if (getHeaderVariables().get(i) != null) { + joiner.add(getHeaderVariables().get(i).toUrlQueryString(String.format("%sheader_variables%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `body_variables` to the URL query string + if (getBodyVariables() != null) { + for (int i = 0; i < getBodyVariables().size(); i++) { + if (getBodyVariables().get(i) != null) { + joiner.add(getBodyVariables().get(i).toUrlQueryString(String.format("%sbody_variables%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `button_type` to the URL query string + if (getButtonType() != null) { + try { + joiner.add(String.format("%sbutton_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getButtonType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `hide_footer` to the URL query string + if (getHideFooter() != null) { + try { + joiner.add(String.format("%shide_footer%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHideFooter()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/openapi/INFO.md b/openapi/INFO.md index b540460..0e67623 100644 --- a/openapi/INFO.md +++ b/openapi/INFO.md @@ -1,6 +1,6 @@ -This ``openapi.yml`` was written manually as INSERT_NAME_HERE fails to provide an API schema or something similar. +This ``openapi.yml`` is based on the [official available one](https://api.brevo.com/v3/swagger_definition_v3.yml) with minor modifications. -The Java API Client can be generated using ``mvn clean compile -P openapi-generator`` inside [``openapi-client-maven-template``](../openapi-client-maven-template/). +The Java API Client can be generated using ``mvn clean compile -P openapi-generator`` inside [``brevo-java-client``](../brevo-java-client/). Helpful links: * https://jsonformatter.org/json-to-jsonschema diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 8b13789..2031c39 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -1 +1,19282 @@ +openapi: 3.0.1 +info: + title: Brevo API + description: Brevo API documentation by XDEV Software based on https://api.brevo.com/v3/swagger_definition_v3.yml + license: + name: MIT + url: http://opensource.org/licenses/MIT + version: 3.0.0 +externalDocs: + description: Brevo's API documentation + url: https://developers.brevo.com/reference +servers: + - url: https://api.brevo.com/v3 +security: + - api-key: [ ] +paths: + /emailCampaigns: + get: + tags: + - Email Campaigns + summary: Return all your created email campaigns + operationId: getEmailCampaigns + parameters: + - name: type + in: query + description: Filter on the type of the campaigns + schema: + type: string + enum: + - classic + - trigger + - name: status + in: query + description: Filter on the status of the campaign + schema: + type: string + enum: + - suspended + - archive + - sent + - queued + - draft + - inProcess + - name: statistics + in: query + description: Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. + schema: + type: string + enum: + - globalStats + - linksStats + - statsByDomain + - name: startDate + in: query + description: | + **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. + **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. + **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) + schema: + type: string + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: excludeHtmlContent + in: query + description: Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body + schema: + type: boolean + enum: + - true + - false + responses: + 200: + description: Email campaigns informations + content: + application/json: + schema: + $ref: '#/components/schemas/getEmailCampaigns' + examples: + response: + value: + count: 2 + campaigns: + - id: 12 + name: EN - Sales Summer 2017 + subject: 20% OFF for 2017 Summer Sales + previewText: Don't miss the sale + type: classic + status: sent + scheduledAt: 2017-06-01T12:30:00Z + testSent: true + header: '[DEFAULT_HEADER]' + footer: '[DEFAULT_FOOTER]' + sender: + email: marketing@mycompany.com + name: Marketing + id: 26 + replyTo: replyto@domain.com + toField: '{FNAME} {LNAME}' + htmlContent: This is my HTML Content + shareLink: http://example.com/fhsgccc.html?t=9865448900 + tag: Newsletter + createdAt: 2017-05-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + inlineImageActivation: true + mirrorActive: true + recurring: false + recipients: + lists: + - 5 + exclusionLists: + - 13 + statistics: + globalStats: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + trackableViewsRate: 23.45 + estimatedViews: 560 + unsubscriptions: 2 + viewed: 8999 + campaignStats: + - listId: 5 + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + mirrorClick: 120 + remaining: 1000 + linksStats: + http://myUrl1.domain.com: 80 + statsByDomain: + yahoo.com: + uniqueClicks: 298 + clickers: 533 + complaints: 0 + sent: 25601 + softBounces: 5 + hardBounces: 0 + uniqueViews: 3527 + unsubscriptions: 17 + viewed: 5255 + delivered: 25596 + hotmail.co.uk: + uniqueClicks: 1970 + clickers: 2720 + complaints: 5 + sent: 117055 + softBounces: 111 + hardBounces: 0 + uniqueViews: 21111 + unsubscriptions: 105 + viewed: 35251 + delivered: 117056 + - id: 22 + name: Weekly - 1 + subject: Week 1 - Newsletter + previewText: your weekly newsletter + type: Classic + status: draft + scheduledAt: "" + testSent: false + header: '[DEFAULT_HEADER]' + footer: '[DEFAULT_FOOTER]' + sender: + email: newsletter@mycompany.com + name: Newsletter + id: 26 + replyTo: replyto@domain.com + toField: '{FNAME} {LNAME}' + htmlContent: This is my HTML Content + shareLink: http://example.com/fhsgccc.html?t=9865448900 + tag: Newsletter + createdAt: 2017-05-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + inlineImageActivation: true + mirrorActive: true + recurring: false + recipients: + lists: + - 10 + exclusionLists: + - 45 + statistics: + globalStats: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + trackableViewsRate: 23.45 + estimatedViews: 560 + unsubscriptions: 2 + viewed: 8999 + campaignStats: + - listId: 10 + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + mirrorClick: 120 + remaining: 1000 + linksStats: + http://myUrl1.domain.com: + nbClick: 80 + http://myUrl2.domain.com: + nbClick: 80 + http://myUrl3.domain.com: + nbClick: 80 + statsByDomain: + gmail: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + aol: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Email Campaigns + summary: Create an email campaign + operationId: createEmailCampaign + requestBody: + description: Values to create a campaign + content: + application/json: + schema: + $ref: '#/components/schemas/createEmailCampaign' + required: true + responses: + 201: + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}: + get: + tags: + - Email Campaigns + summary: Get an email campaign report + operationId: getEmailCampaign + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + - name: statistics + in: query + description: Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. + required: false + schema: + type: string + enum: + - globalStats + - linksStats + - statsByDomain + - statsByDevice + - statsByBrowser + responses: + 200: + description: Email campaign informations + content: + application/json: + schema: + $ref: '#/components/schemas/getEmailCampaign' + examples: + response: + value: + id: 22 + name: Weekly - 1 + subject: Week 1 - Newsletter + previewText: your weekly newsletter! + type: classic + status: draft + scheduledAt: 2017-09-22T12:30:00Z + testSent: false + header: '[DEFAULT_HEADER]' + footer: '[DEFAULT_FOOTER]' + sender: + email: newsletter@mycompany.com + name: Newsletter + id: 26 + replyTo: replyto@domain.com + toField: '{FNAME} {LNAME}' + htmlContent: This is my HTML Content + shareLink: http://dhh.brevo.com/fhsgccc.html?t=9865448900 + tag: Newsletter + createdAt: 2017-05-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + inlineImageActivation: true + mirrorActive: true + recurring: false + recipients: + lists: + - 22 + exclusionLists: + - 45 + statistics: + globalStats: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + trackableViewsRate: 23.45 + estimatedViews: 560 + unsubscriptions: 2 + viewed: 8999 + campaignStats: + - listId: 22 + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + trackableViews: 5661 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + mirrorClick: 120 + remaining: 1000 + linksStats: + http://myUrl1.domain.com: + nbClick: 80 + http://myUrl2.domain.com: + nbClick: 80 + http://myUrl3.domain.com: + nbClick: 80 + statsByDomain: + gmail: + uniqueClicks: 2300 + clickers: 2665 + complaints: 1 + delivered: 19765 + sent: 19887 + softBounces: 100 + hardBounces: 87 + uniqueViews: 7779 + unsubscriptions: 2 + viewed: 8999 + deferred: 30 + statsByDevice: + desktop: + mac: + clickers: 1 + uniqueClicks: 0 + viewed: 2 + uniqueViews: 1 + mobile: + androidMobile: + clickers: 1 + uniqueClicks: 0 + viewed: 1 + uniqueViews: 0 + iPhone: + clickers: 1 + uniqueClicks: 0 + viewed: 2 + uniqueViews: 0 + statsByBrowser: + thunderbird: + clickers: 1 + uniqueClicks: 0 + viewed: 1 + uniqueViews: 0 + safari: + clickers: 1 + uniqueClicks: 0 + viewed: 1 + uniqueViews: 0 + internetExplorer: + clickers: 0 + uniqueClicks: 0 + viewed: 1 + uniqueViews: 0 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Email Campaigns + summary: Update an email campaign + operationId: updateEmailCampaign + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update a campaign + content: + application/json: + schema: + $ref: '#/components/schemas/updateEmailCampaign' + required: true + responses: + 204: + description: Email campaign updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Email Campaigns + summary: Delete an email campaign + operationId: deleteEmailCampaign + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: Email campaign has been deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/sendNow: + post: + tags: + - Email Campaigns + summary: Send an email campaign immediately, based on campaignId + operationId: sendEmailCampaignNow + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: Email campaign has been scheduled + content: { } + 400: + description: Campaign could not be sent + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 402: + description: You don't have enough credit to send your campaign. Please update your plan + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/sendTest: + post: + tags: + - Email Campaigns + summary: Send an email campaign to your test list + operationId: sendTestEmail + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/sendTestEmail' + required: true + responses: + 204: + description: Test email has been sent successfully to all recipients + content: { } + 400: + description: Test email could not be sent to the following email addresses + content: + application/json: + schema: + $ref: '#/components/schemas/postSendFailed' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/postSendFailed' + /emailCampaigns/{campaignId}/status: + put: + tags: + - Email Campaigns + summary: Update an email campaign status + operationId: updateCampaignStatus + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Status of the campaign + content: + application/json: + schema: + $ref: '#/components/schemas/updateCampaignStatus' + required: true + responses: + 204: + description: The campaign status has been updated successfully + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/sendReport: + post: + tags: + - Email Campaigns + summary: Send the report of a campaign + description: A PDF will be sent to the specified email addresses + operationId: sendReport + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values for send a report + content: + application/json: + schema: + $ref: '#/components/schemas/sendReport' + required: true + responses: + 204: + description: Report has been successfully sent to the defined recipients + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/abTestCampaignResult: + get: + tags: + - Email Campaigns + summary: Get an A/B test email campaign results + description: Obtain winning version of an A/B test email campaign + operationId: getAbTestCampaignResult + parameters: + - name: campaignId + in: path + description: Id of the A/B test campaign + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: A/B test email campaign Result + content: + application/json: + schema: + $ref: '#/components/schemas/abTestCampaignResult' + examples: + response: + value: + winningVersion: B + winningCriteria: Click + openRate: 100% + clickRate: 50% + winningVersionRate: 0% + statistics: + openers: + Version A: 20% + Version B: 100% + clicks: + Version A: 0% + Version B: 50% + unsubscribed: + Version A: 20% + Version B: 0% + softBounces: + Version A: 0% + Version B: 0% + hardBounces: + Version A: 0% + Version B: 0% + complaints: + Version A: 0% + Version B: 0% + clickedLinks: + Version A: + - link: https://google.com + clicksCount: 0 + clickRate: 0% + - link: https://youtube.com + clicksCount: 0 + clickRate: 0% + Version B: + - link: http://www.github.com + clicksCount: 2 + clickRate: 40% + - link: http://www.stackoverflow.com + clicksCount: 3 + clickRate: 60% + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: A/B test Email Campaign not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/sharedUrl: + get: + tags: + - Email Campaigns + summary: Get a shared template url + description: Get a unique URL to share & import an email template from one Brevo + account to another. + operationId: getSharedTemplateUrl + parameters: + - name: campaignId + in: path + description: Id of the campaign or template + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: Shared template URL information + content: + application/json: + schema: + $ref: '#/components/schemas/getSharedTemplateUrl' + examples: + response: + value: + sharedUrl: https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx- + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign/Template ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 405: + description: Only email campaigns or templates are allowed + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/{campaignId}/exportRecipients: + post: + tags: + - Email Campaigns + summary: Export the recipients of an email campaign + operationId: emailExportRecipients + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to send for a recipient export request + content: + application/json: + schema: + $ref: '#/components/schemas/emailExportRecipients' + required: false + responses: + 202: + $ref: '#/components/responses/createdProcessId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /emailCampaigns/images: + post: + tags: + - Email Campaigns + summary: Upload an image to your account's image gallery + operationId: uploadImageToGallery + requestBody: + description: Parameters to upload an image + content: + application/json: + schema: + $ref: '#/components/schemas/uploadImageToGallery' + required: true + responses: + 201: + description: Image has been successfully uploaded + content: + application/json: + schema: + $ref: '#/components/schemas/uploadImageModel' + examples: + response: + value: + url: 'https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/email: + post: + tags: + - Transactional emails + summary: Send a transactional email + operationId: sendTransacEmail + requestBody: + description: Values to send a transactional email + content: + application/json: + schema: + $ref: '#/components/schemas/sendSmtpEmail' + required: true + responses: + 201: + description: transactional email sent + content: + application/json: + schema: + $ref: '#/components/schemas/createSmtpEmail' + examples: + response: + value: + messageId: '<201798300811.5787683@relay.domain.com>' + 202: + description: transactional email scheduled + content: + application/json: + schema: + $ref: '#/components/schemas/scheduleSmtpEmail' + examples: + response: + value: + messageId: '<201798300811.5787683@relay.domain.com>' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/emails: + get: + tags: + - Transactional emails + summary: Get the list of transactional emails on the basis of allowed filters + description: This endpoint will show the list of emails for past 30 days by + default. To retrieve emails before that time, please pass startDate and endDate + in query filters. + operationId: getTransacEmailsList + parameters: + - name: email + in: query + description: | + **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. + schema: + type: string + - name: templateId + in: query + description: | + **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. + schema: + type: integer + format: int64 + - name: messageId + in: query + description: | + **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. + schema: + type: string + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** + schema: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: limit + in: query + description: Number of documents returned per page + schema: + maximum: 1000 + minimum: 0 + type: integer + format: int64 + default: 500 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + responses: + 200: + description: List of transactional emails + content: + application/json: + schema: + $ref: '#/components/schemas/getTransacEmailsList' + examples: + response: + value: + count: 120 + transactionalEmails: + - email: abc@xyz.com + subject: summer camp + templateId: 15 + messageId: <201798300811.5787683@relay.domain.com> + uuid: 5a78c-209ok98262910-std2341 + date: 2019-05-25T11:53:26Z + - email: test@test.com + subject: details verification + templateId: 15 + messageId: <201798300811.5700093@relay.domain.com> + uuid: 5a78c-209ok98262910-s99a341 + date: 2019-05-25T07:28:11Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/emails/{uuid}: + get: + tags: + - Transactional emails + summary: Get the personalized content of a sent transactional email + operationId: getTransacEmailContent + parameters: + - name: uuid + in: path + description: Unique id of the transactional email that has been sent to a + particular contact + required: true + schema: + type: string + responses: + 200: + description: Transactional email content + content: + application/json: + schema: + $ref: '#/components/schemas/getTransacEmailContent' + examples: + response: + value: + email: abc@example.com + subject: Summer Camps + templateId: 12 + date: 2016-02-25T11:53:26Z + events: + - name: sent + time: 2016-02-25T11:53:26Z + - name: delivered + time: 2016-02-25T11:55:26Z + - name: opened + time: 2016-02-26T09:53:26Z + body:

Greetings from the team

+

This is the actual html content sent

+ /smtp/log/{identifier}: + delete: + tags: + - Transactional emails + summary: Delete an SMTP transactional log + parameters: + - name: identifier + in: path + description: MessageId or Email of the transactional log(s) to delete + required: true + schema: + type: string + responses: + 204: + description: Transactional Logs deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Message ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/templates: + get: + tags: + - Transactional emails + summary: Get the list of email templates + operationId: getSmtpTemplates + parameters: + - name: templateStatus + in: query + description: Filter on the status of the template. Active = true, inactive + = false + schema: + type: boolean + - name: limit + in: query + description: Number of documents returned per page + schema: + maximum: 1000 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: transactional email templates informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSmtpTemplates' + examples: + response: + value: + count: 2 + templates: + - id: 5 + name: ChristomasTimeTemplate + subject: Merry Christmas + isActive: false + testSent: false + sender: + name: John + email: john.smith@example.com + id: 23 + replyTo: replyto@domain.com + toField: "" + tag: Festival + htmlContent: HTML CONTENT 1 + createdAt: 2016-02-24T14:44:24Z + modifiedAt: 2016-02-24T15:37:11Z + - id: 12 + name: SummerSales2017Template + subject: Enjoy our summer Sales ! + isActive: true + testSent: false + sender: + name: John + email: john.smith@example.com + id: 23 + replyTo: replyto@domain.com + toField: "" + tag: Summer + htmlContent: HTML CONTENT 2 + createdAt: 2016-02-25T11:53:26Z + modifiedAt: 2016-02-25T11:53:26Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Transactional emails + summary: Create an email template + operationId: createSmtpTemplate + requestBody: + description: values to update in transactional email template + content: + application/json: + schema: + $ref: '#/components/schemas/createSmtpTemplate' + required: true + responses: + 201: + # transactional email template created + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/templates/{templateId}: + get: + tags: + - Transactional emails + summary: Returns the template information + operationId: getSmtpTemplate + parameters: + - name: templateId + in: path + description: id of the template + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: Email template informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSmtpTemplateOverview' + examples: + response: + value: + id: 33 + name: OrderConfirmation + subject: 'Order Confirmation : Thanks for your Purchase !' + isActive: true + testSent: false + sender: + name: John + email: john.smith@example.com + id: 26 + replyTo: replyto@domain.com + toField: "" + tag: "" + htmlContent: HTML CONTENT 4 + createdAt: 2016-02-25T11:53:26Z + modifiedAt: 2016-02-25T11:53:26Z + doiTemplate: false + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Template ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Transactional emails + summary: Update an email template + operationId: updateSmtpTemplate + parameters: + - name: templateId + in: path + description: id of the template + required: true + schema: + type: integer + format: int64 + requestBody: + description: values to update in transactional email template + content: + application/json: + schema: + $ref: '#/components/schemas/updateSmtpTemplate' + required: true + responses: + 204: + description: transactional email template updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Template ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Transactional emails + summary: Delete an inactive email template + operationId: deleteSmtpTemplate + parameters: + - name: templateId + in: path + description: id of the template + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: Inactive transactional email template has been deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Template ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/templates/{templateId}/sendTest: + post: + tags: + - Transactional emails + summary: Send a template to your test list + operationId: sendTestTemplate + parameters: + - name: templateId + in: path + description: Id of the template + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/sendTestEmail' + required: true + responses: + 204: + description: Test email has been sent successfully to all recipients + content: { } + 400: + description: Test email could not be sent to the following email addresses + content: + application/json: + schema: + $ref: '#/components/schemas/postSendFailed' + 404: + description: Template ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/statistics/aggregatedReport: + get: + tags: + - Transactional emails + summary: Get your transactional email activity aggregated over a period of time + description: This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + operationId: getAggregatedSmtpReport + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + schema: + type: integer + format: int64 + - name: tag + in: query + description: Tag of the emails + schema: + type: string + responses: + 200: + description: Aggregated report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getAggregatedReport' + examples: + response: + value: + range: 2016-09-08|2017-04-28 + requests: 19887 + delivered: 18996 + hardBounces: 234 + softBounces: 1533 + clicks: 9987 + uniqueClicks: 8766 + opens: 17654 + uniqueOpens: 13688 + spamReports: 1 + blocked: 2 + invalid: 0 + unsubscribed: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/statistics/reports: + get: + tags: + - Transactional emails + summary: Get your transactional email activity aggregated per day + operationId: getSmtpReport + parameters: + - name: limit + in: query + description: Number of documents returned per page + schema: + maximum: 30 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document on the page + schema: + type: integer + format: int64 + default: 0 + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + schema: + type: integer + format: int64 + - name: tag + in: query + description: Tag of the emails + schema: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Aggregated report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getReports' + examples: + response: + value: + reports: + - date: 2017-04-30 + requests: 10756 + delivered: 10103 + hardBounces: 21 + softBounces: 137 + clicks: 1026 + uniqueClicks: 720 + opens: 5091 + uniqueOpens: 2318 + spamReports: 0 + blocked: 519 + invalid: 1 + unsubscribed: 0 + - date: 2017-05-01 + requests: 18812 + delivered: 17499 + hardBounces: 34 + softBounces: 254 + clicks: 1514 + uniqueClicks: 1090 + opens: 10089 + uniqueOpens: 4393 + spamReports: 0 + blocked: 920 + invalid: 2 + unsubscribed: 3 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/statistics/events: + get: + tags: + - Transactional emails + summary: Get all your transactional email activity (unaggregated events) + description: This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + operationId: getEmailEventReport + parameters: + - name: limit + in: query + description: Number limitation for the result returned + schema: + maximum: 5000 + type: integer + format: int64 + default: 2500 + minimum: 0 + - name: offset + in: query + description: Beginning point in the list to retrieve from. + schema: + type: integer + format: int64 + default: 0 + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + schema: + type: integer + format: int64 + - name: email + in: query + description: Filter the report for a specific email addresses + schema: + type: string + format: email + - name: event + in: query + description: Filter the report for a specific event type + schema: + type: string + enum: + - bounces + - hardBounces + - softBounces + - delivered + - spam + - requests + - opened + - clicks + - invalid + - deferred + - blocked + - unsubscribed + - error + - loadedByProxy + - name: tags + in: query + description: Filter the report for tags (serialized and urlencoded array) + schema: + type: string + - name: messageId + in: query + description: Filter on a specific message id + schema: + type: string + - name: templateId + in: query + description: Filter on a specific template id + schema: + type: integer + format: int64 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Email events report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getEmailEventReport' + examples: + response: + value: + events: + - email: john.smith@example.com + date: 2017-03-12T12:30:00Z + messageId: <201798300811.5787683@example.domain.com> + event: deferred + reason: Error connection timeout + tag: OrderConfirmation + from: john@example.com + templateId: 4 + - email: john.smith@example.com + date: 2017-03-13T16:30:00Z + messageId: <201798300811.5787683@example.domain.com> + event: delivered + tag: OrderConfirmation + from: john@example.com + templateId: 5 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/blockedContacts/{email}: + delete: + tags: + - Transactional emails + summary: Unblock or resubscribe a transactional contact + parameters: + - name: email + in: path + description: contact email (urlencoded) to unblock. + required: true + schema: + type: string + responses: + 204: + description: Contact unblocked + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Contact email not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/blockedContacts: + get: + tags: + - Transactional emails + summary: Get the list of blocked or unsubscribed transactional contacts + operationId: getTransacBlockedContacts + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts + schema: + type: string + - name: limit + in: query + description: Number of documents returned per page + schema: + maximum: 100 + type: integer + format: int64 + default: 50 + minimum: 0 + - name: offset + in: query + description: Index of the first document on the page + schema: + type: integer + format: int64 + default: 0 + - name: senders + in: query + description: Comma separated list of emails of the senders from which contacts + are blocked or unsubscribed + style: form + explode: false + schema: + type: array + items: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: List of blocked or unsubscribed transactional contacts + content: + application/json: + schema: + $ref: '#/components/schemas/getTransacBlockedContacts' + examples: + response: + value: + count: 1 + contacts: + - email: abc@xyz.com + senderEmail: ez312@gmal.com + reason: + message: Admin blocked + code: adminBlocked + blockedAt: 2017-05-01T12:30:00Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/blockedDomains: + get: + tags: + - Transactional emails + summary: Get the list of blocked domains + description: Get the list of blocked domains + operationId: getBlockedDomains + responses: + 200: + description: List of blocked domains + content: + application/json: + schema: + $ref: '#/components/schemas/getBlockedDomains' + examples: + response: + value: + domains: + - example.com + - testdomain.com + post: + tags: + - Transactional emails + summary: Add a new domain to the list of blocked domains + description: Blocks a new domain in order to avoid messages being sent to the same + operationId: blockNewDomain + requestBody: + description: Name of the domain to be blocked + content: + application/json: + schema: + $ref: '#/components/schemas/blockDomain' + required: true + responses: + 201: + description: Domain is successfully blocked + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/blockedDomains/{domain}: + delete: + tags: + - Transactional emails + summary: Unblock an existing domain from the list of blocked domains + description: Unblocks an existing domain from the list of blocked domains + operationId: deleteBlockedDomain + parameters: + - name: domain + description: The name of the domain to be deleted + in: path + required: true + schema: + type: string + responses: + 204: + description: Domain is successfully deleted from the list of blocked domains + content: { } + 404: + description: Domain not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/deleteHardbounces: + post: + tags: + - Transactional emails + summary: Delete hardbounces + description: Delete hardbounces. To use carefully (e.g. in case of temporary + ISP failures) + operationId: deleteHardbounces + requestBody: + description: values to delete hardbounces + content: + application/json: + schema: + $ref: '#/components/schemas/deleteHardbounces' + required: false + responses: + 204: + description: Hardbounces deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/emailStatus/{identifier}: + get: + tags: + - Transactional emails + summary: Fetch scheduled emails by batchId or messageId + description: Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old) + operationId: getScheduledEmailById + parameters: + - name: identifier + description: The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. + in: path + required: true + examples: + batchId: + value: 4320f270-a4e3-4a2e-b591-edfe30a5e627 + summary: batchId of scheduled batch + messageId: + value: <202202231031.53307417725@smtp-relay.mailin.fr> + summary: messageId of scheduled email + schema: + type: string + - name: startDate + description: Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. + in: query + example: '2022-02-02' + required: false + schema: + type: string + format: date + - name: endDate + description: Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + in: query + example: '2022-03-02' + required: false + schema: + type: string + format: date + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: status + in: query + description: Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. + required: false + schema: + type: string + enum: + - processed + - inProgress + - queued + - name: limit + description: Number of documents returned per page. Not valid when identifier is `messageId`. + in: query + required: false + example: 100 + schema: + type: integer + format: int64 + default: 100 + maximum: 500 + minimum: 0 + - name: offset + description: Index of the first document on the page. Not valid when identifier is `messageId`. + in: query + required: false + example: 0 + schema: + type: integer + format: int64 + default: 0 + responses: + 200: + description: Scheduled email batches + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/getScheduledEmailByBatchId' + - $ref: '#/components/schemas/getScheduledEmailByMessageId' + examples: + batchId: + value: + { + "count": 3, + "batches": [ + { + "scheduledAt": "2022-02-28T11:36:43.576000000Z", + "createdAt": "2022-02-26T11:36:43.576000000Z", + "status": "queued" + }, + { + "scheduledAt": "2022-02-25T11:36:43.576000000Z", + "createdAt": "2022-02-24T11:36:43.576000000Z", + "status": "processed" + }, + { + "scheduledAt": "2022-02-26T11:36:43.576000000Z", + "createdAt": "2022-02-25T11:36:43.576000000Z", + "status": "inProgress" + } + ] + } + messageId: + value: + { + "scheduledAt": "2022-02-28T11:36:43.576000000Z", + "createdAt": "2022-02-26T11:36:43.576000000Z", + "status": "queued" + } + 400: + description: Invalid parameters passed + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Record(s) for identifier not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smtp/email/{identifier}: + delete: + tags: + - Transactional emails + summary: Delete scheduled emails by batchId or messageId + description: Delete scheduled batch of emails by batchId or single scheduled email by messageId + operationId: deleteScheduledEmailById + parameters: + - name: identifier + description: The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. + in: path + required: true + examples: + batchId: + value: 4320f270-a4e3-4a2e-b591-edfe30a5e627 + summary: batchId of scheduled batch + messageId: + value: <202202231031.53307417725@smtp-relay.mailin.fr> + summary: messageId of scheduled email + schema: + type: string + responses: + 204: + description: Scheduled email(s) deleted + content: { } + 400: + description: Invalid parameters passed + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Record(s) for identifier not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts: + get: + tags: + - Contacts + summary: Get all the contacts + operationId: getContacts + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 1000 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: modifiedSince + in: query + description: | + Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: createdSince + in: query + description: | + Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: segmentId + in: query + description: Id of the segment. **Either listIds or segmentId can be passed.** + schema: + type: integer + format: int64 + - name: listIds + in: query + description: Ids of the list. **Either listIds or segmentId can be passed.** + schema: + type: array + items: + type: integer + format: int64 + responses: + 200: + description: All contacts listed + content: + application/json: + schema: + $ref: '#/components/schemas/getContacts' + examples: + response: + value: + contacts: + - email: contact1@example.com + id: 247 + emailBlacklisted: true + smsBlacklisted: true + createdAt: 2017-05-01T17:05:03Z + modifiedAt: 2017-05-01T17:05:03Z + listIds: + - 43 + - 58 + attributes: + SMS: "33058407250" + IDENTIFICATION: 1-3RHQ-259 + CIV: MS + LAST_NAME: Brennon + FIRST_NAME: Meg + DOB: 1986-05-02 + ADDRESS: 1 5th avenue + ZIP_CODE: "44300" + CITY: New-York + ACTION_CODE: 17HH98CH + - email: 33058407248@mailin-sms.com + id: 245 + emailBlacklisted: true + smsBlacklisted: false + createdAt: 2017-05-01T17:05:03Z + modifiedAt: 2017-05-01T17:05:03Z + listIds: + - 43 + - 61 + - 58 + attributes: + SMS: "33058407248" + IDENTIFICATION: 1-78JS-432 + CIV: MS + LAST_NAME: Press + FIRST_NAME: Sophia + DOB: 1980-09-11 + ADDRESS: 5 Flower Street + ZIP_CODE: "44119" + CITY: Seattle + ACTION_CODE: 17HU765 + count: 3 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Contacts + summary: Create a contact + operationId: createContact + requestBody: + description: Values to create a contact + content: + application/json: + schema: + $ref: '#/components/schemas/createContact' + required: true + responses: + 201: + description: Contact created + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateContactModel' + examples: + response: + value: + id: 21 + 204: + description: Contact updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/doubleOptinConfirmation: + post: + tags: + - Contacts + summary: Create Contact via DOI (Double-Opt-In) Flow + operationId: createDoiContact + requestBody: + description: Values to create the Double opt-in (DOI) contact + content: + application/json: + schema: + $ref: '#/components/schemas/createDoiContact' + required: true + responses: + 201: + description: DOI Contact created + content: { } + 204: + description: DOI Contact updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: createDoiContact + /contacts/{identifier}: + get: + tags: + - Contacts + summary: Get a contact's details + description: Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. + operationId: getContactInfo + parameters: + - name: identifier + in: path + description: Email (urlencoded) OR ID of the contact OR its SMS attribute value + required: true + schema: + oneOf: + - type: string + - type: integer + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. + schema: + type: string + responses: + 200: + description: Contact informations + content: + application/json: + schema: + $ref: '#/components/schemas/getExtendedContactDetails' + examples: + response: + value: + email: peggy.rain@example.com + id: 42 + emailBlacklisted: false + smsBlacklisted: false + createdAt: 2017-05-02T16:40:31Z + modifiedAt: 2017-05-02T16:40:31Z + attributes: + FIRST_NAME: Peggy + LAST_NAME: Rain + SMS: "3087433387669" + CIV: "1" + DOB: 1986-04-13 + ADDRESS: 987 5th avenue + ZIP_CODE: "87544" + CITY: New-York + AREA: NY + listIds: + - 40 + statistics: + messagesSent: + - campaignId: 21 + eventTime: 2016-05-03T20:15:13Z + - campaignId: 42 + eventTime: 2016-10-17T10:30:01Z + opened: + - campaignId: 21 + count: 2 + eventTime: 2016-05-03T21:24:56Z + ip: 66.249.93.118 + - campaignId: 68 + count: 1 + eventTime: 2017-01-30T13:56:40Z + ip: 66.249.93.217 + clicked: + - campaignId: 21 + links: + - count: 2 + eventTime: 2016-05-03T21:25:01Z + ip: 66.249.93.118 + url: https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email + delivered: + - campaignId: 21 + count: 2 + eventTime: 2016-05-03T21:24:56Z + ip: 66.249.93.118 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Contact's email not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Contacts + summary: Delete a contact + operationId: deleteContact + parameters: + - name: identifier + in: path + description: Email (urlencoded) OR ID of the contact + required: true + schema: + oneOf: + - type: string + - type: integer + responses: + 204: + description: Contact deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Contact not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 405: + description: You're not allowed to delete registered email contact with + Brevo + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Contacts + summary: Update a contact + operationId: updateContact + parameters: + - name: identifier + in: path + description: Email (urlencoded) OR ID of the contact + required: true + schema: + oneOf: + - type: string + - type: integer + requestBody: + description: Values to update a contact + content: + application/json: + schema: + $ref: '#/components/schemas/updateContact' + required: true + responses: + 204: + description: Contact updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Contact's email not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: updateContact + /contacts/batch: + post: + tags: + - Contacts + summary: Update multiple contacts + operationId: updateBatchContacts + requestBody: + description: Values to update multiple contacts + content: + application/json: + schema: + $ref: '#/components/schemas/updateBatchContacts' + required: true + responses: + 204: + description: All contacts updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/{identifier}/campaignStats: + get: + tags: + - Contacts + summary: Get email campaigns' statistics for a contact + operationId: getContactStats + parameters: + - name: identifier + in: path + description: Email (urlencoded) OR ID of the contact + required: true + schema: + oneOf: + - type: string + - type: integer + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days + schema: + type: string + responses: + 200: + description: Contact campaign statistics informations + content: + application/json: + schema: + $ref: '#/components/schemas/getContactCampaignStats' + examples: + response: + value: + messagesSent: + - campaignId: 21 + eventTime: 2016-05-03T20:15:13Z + - campaignId: 42 + eventTime: 2016-10-17T10:30:01Z + - campaignId: 45 + eventTime: 2016-11-09T11:45:02Z + opened: + - campaignId: 21 + count: 2 + eventTime: 2016-05-03T21:24:56Z + ip: 66.249.93.118 + - campaignId: 45 + count: 1 + eventTime: 2017-01-30T13:56:40Z + ip: 66.249.93.217 + clicked: + - campaignId: 21 + links: + - count: 2 + eventTime: 2016-05-03T21:25:01Z + ip: 66.249.93.118 + url: https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email + delivered: + - campaignId: 21 + count: 2 + eventTime: 2016-05-03T21:24:56Z + ip: 66.249.93.118 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Contact's email not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/attributes: + get: + tags: + - Contacts + summary: List all attributes + operationId: getAttributes + responses: + 200: + description: Attributes listed + content: + application/json: + schema: + $ref: '#/components/schemas/getAttributes' + examples: + response: + value: + attributes: + - name: LASTNAME + category: normal + type: text + - name: FIRSTNAME + category: normal + type: text + - name: DOB + category: normal + type: date + - name: GENDER + category: category + type: text + enumeration: + - value: 1 + label: Men + - value: 2 + label: Women + - value: 3 + label: Kid + /contacts/attributes/{attributeCategory}/{attributeName}: + put: + tags: + - Contacts + summary: Update contact attribute + operationId: updateAttribute + parameters: + - name: attributeCategory + in: path + description: Category of the attribute + required: true + schema: + type: string + enum: + - category + - calculated + - global + - name: attributeName + in: path + description: Name of the existing attribute + required: true + schema: + type: string + requestBody: + description: Values to update an attribute + content: + application/json: + schema: + $ref: '#/components/schemas/updateAttribute' + required: true + responses: + 204: + description: Attribute updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Attribute not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: updateAttribute + post: + tags: + - Contacts + summary: Create contact attribute + operationId: createAttribute + parameters: + - name: attributeCategory + in: path + description: Category of the attribute + required: true + schema: + type: string + enum: + - normal + - transactional + - category + - calculated + - global + - name: attributeName + in: path + description: Name of the attribute + required: true + schema: + type: string + requestBody: + description: Values to create an attribute + content: + application/json: + schema: + $ref: '#/components/schemas/createAttribute' + required: true + responses: + 201: + description: Attribute created + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Contacts + summary: Delete an attribute + operationId: deleteAttribute + parameters: + - name: attributeCategory + in: path + description: Category of the attribute + required: true + schema: + type: string + enum: + - normal + - transactional + - category + - calculated + - global + - name: attributeName + in: path + description: Name of the existing attribute + required: true + schema: + type: string + responses: + 204: + description: Attribute deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Attribute not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/folders: + get: + tags: + - Contacts + summary: Get all folders + operationId: getFolders + parameters: + - name: limit + in: query + description: Number of documents per page + required: true + schema: + maximum: 50 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document of the page + required: true + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Folders informations + content: + application/json: + schema: + $ref: '#/components/schemas/getFolders' + examples: + response: + value: + folders: + - id: 42 + name: Ninja_Form + totalBlacklisted: 98 + totalSubscribers: 4567 + uniqueSubscribers: 4665 + - id: 29 + name: Prestashop + totalBlacklisted: 10 + totalSubscribers: 6543 + uniqueSubscribers: 6553 + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Contacts + summary: Create a folder + operationId: createFolder + requestBody: + description: Name of the folder + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateFolder' + required: true + responses: + 201: + # description: Folder created + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: createFolder + /contacts/folders/{folderId}: + get: + tags: + - Contacts + summary: Returns a folder's details + operationId: getFolder + parameters: + - name: folderId + in: path + description: id of the folder + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: Folder details + content: + application/json: + schema: + $ref: '#/components/schemas/getFolder' + examples: + response: + value: + id: 1 + name: Client_Folder + totalBlacklisted: 987 + totalSubscribers: 16778 + uniqueSubscribers: 17765 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Folder ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Contacts + summary: Update a folder + operationId: updateFolder + parameters: + - name: folderId + in: path + description: Id of the folder + required: true + schema: + type: integer + format: int64 + requestBody: + description: Name of the folder + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateFolder' + required: true + responses: + 204: + description: Folder updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Folder ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: updateFolder + delete: + tags: + - Contacts + summary: Delete a folder (and all its lists) + operationId: deleteFolder + parameters: + - name: folderId + in: path + description: Id of the folder + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: Folder deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Folder ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/folders/{folderId}/lists: + get: + tags: + - Contacts + summary: Get lists in a folder + operationId: getFolderLists + parameters: + - name: folderId + in: path + description: Id of the folder + required: true + schema: + type: integer + format: int64 + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 50 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Folder's Lists details + content: + application/json: + schema: + $ref: '#/components/schemas/getFolderLists' + examples: + response: + value: + lists: + - id: 46 + name: Reactiv + totalSubscribers: 7655 + totalBlacklisted: 0 + uniqueSubscribers: 7655 + - id: 41 + name: NY_Area + totalSubscribers: 3654 + totalBlacklisted: 23 + uniqueSubscribers: 3677 + - id: 22 + name: VIP_Customer + totalSubscribers: 8753 + totalBlacklisted: 72 + uniqueSubscribers: 8825 + count: 3 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Folder ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/lists: + get: + tags: + - Contacts + summary: Get all the lists + operationId: getLists + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 50 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Lists informations + content: + application/json: + schema: + $ref: '#/components/schemas/getLists' + examples: + response: + value: + lists: + - id: 53 + name: Spanish_Speakers + totalSubscribers: 5432 + totalBlacklisted: 65 + uniqueSubscribers: 5497 + folderId: 1 + - id: 50 + name: Other + totalSubscribers: 10976 + totalBlacklisted: 765 + uniqueSubscribers: 11741 + folderId: 2 + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Contacts + summary: Create a list + operationId: createList + requestBody: + description: Values to create a list + content: + application/json: + schema: + $ref: '#/components/schemas/createList' + required: true + responses: + 201: + # description: List created + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/lists/{listId}: + get: + tags: + - Contacts + summary: Get a list's details + operationId: getList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + - name: startDate + in: query + description: | + **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + responses: + 200: + description: List informations + content: + application/json: + schema: + $ref: '#/components/schemas/getExtendedList' + examples: + response: + value: + id: 12 + name: Newsletter_Weekly + startDate: 2023-10-0T00:00:00Z + endDate: 2023-04-0T00:00:00Z + totalSubscribers: 6533 + totalBlacklisted: 63 + uniqueSubscribers: 6596 + folderId: 1 + createdAt: 2016-02-26T11:56:08Z + campaignStats: + - campaignId: 15 + stats: + uniqueClicks: 701 + clickers: 789 + complaints: 0 + delivered: 6632 + sent: 6645 + softBounces: 34 + hardBounces: 4 + uniqueViews: 3442 + unsubscriptions: 4 + viewed: 4322 + deferred: 0 + - campaignId: 45 + stats: + uniqueClicks: 654 + clickers: 788 + complaints: 1 + delivered: 4078 + sent: 4334 + softBounces: 18 + hardBounces: 2 + uniqueViews: 987 + unsubscriptions: 4 + viewed: 1555 + deferred: 0 + dynamicList: false + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Contacts + summary: Update a list + operationId: updateList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update a list + content: + application/json: + schema: + $ref: '#/components/schemas/updateList' + required: true + responses: + 204: + description: List updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Contacts + summary: Delete a list + operationId: deleteList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: List deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/segments: + get: + tags: + - Contacts + summary: Get all the segments + operationId: getSegments + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 50 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Segments informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSegments' + examples: + response: + value: + segments: + - id: 53 + segmentName: Segment1 + categoryName: Name1 + updatedAt: 2017-03-12T12:30:00Z + - id: 50 + segmentName: Segment2 + categoryName: Name2 + updatedAt: 2017-03-12T12:30:00Z + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/lists/{listId}/contacts: + get: + tags: + - Contacts + summary: Get contacts in a list + operationId: getContactsFromList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + - name: modifiedSince + in: query + description: | + Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 500 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Contact informations + content: + application/json: + schema: + $ref: '#/components/schemas/getContacts' + examples: + response: + value: + contacts: + - email: alex.pain@example.com + id: 45 + emailBlacklisted: false + smsBlacklisted: true + createdAt: 2017-05-12T12:30:00Z + modifiedAt: 2017-05-12T12:30:00Z + listIds: + - 12 + - 9 + - 20 + listUnsubscribed: + - 1 + - 2 + attributes: + LASTNAME: Pain + FIRSTNAME: Alex + DOB: 2010-12-31 + GENDER: Kid + - email: john.smith@example.com + id: 32 + emailBlacklisted: true + smsBlacklisted: false + createdAt: 2017-05-12T12:30:00Z + modifiedAt: 2017-05-12T12:30:00Z + listIds: + - 12 + listUnsubscribed: + - 1 + attributes: + LASTNAME: Smith + FIRSTNAME: John + DOB: 1986-06-21 + GENDER: Men + - email: helen.rose@example.com + id: 65 + emailBlacklisted: true + smsBlacklisted: false + createdAt: 2017-05-12T12:30:00Z + modifiedAt: 2017-05-12T12:30:00Z + listIds: + - 12 + - 9 + - 20 + listUnsubscribed: + - 1 + attributes: + LASTNAME: Rose + FIRSTNAME: Helen + DOB: 1988-11-02 + GENDER: Women + SMS: "3375599887766" + count: 17655 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/lists/{listId}/contacts/add: + post: + tags: + - Contacts + summary: Add existing contacts to a list + operationId: addContactToList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + requestBody: + description: Emails addresses OR IDs of the contacts + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/addContactToListByEmails' + - $ref: '#/components/schemas/addContactToListByIDs' + examples: + emailsArray: + summary: Passing emails array + value: + emails: + - jeff32@example.com + - jim56@example.com + idsArray: + summary: Passing ids array + value: + ids: + - 1 + - 2 + required: true + responses: + 201: + description: All contacts have been added successfully to the list with + details of failed ones + content: + application/json: + schema: + $ref: '#/components/schemas/postContactInfo' + examples: + emailsArray: + summary: Response example when emails array is passed + value: + success: + - jeff32@example.com + - jim56@example.com + failure: + - david@example.com + idsArray: + summary: Response example when ids array is paased + value: + success: + - 1 + - 2 + failure: + - 5 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/lists/{listId}/contacts/remove: + post: + tags: + - Contacts + summary: Delete a contact from a list + operationId: removeContactFromList + parameters: + - name: listId + in: path + description: Id of the list + required: true + schema: + type: integer + format: int64 + requestBody: + description: Emails adresses OR IDs of the contacts OR 'all' true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/removeContactFromListByEmails' + - $ref: '#/components/schemas/removeContactFromListByIDs' + - $ref: '#/components/schemas/removeContactFromListByAll' + examples: + emailsArray: + summary: Passing emails array + value: + emails: + - jeff32@example.com + - jim56@example.com + idsArray: + summary: Passing ids array + value: + ids: + - 1 + - 2 + allTrue: + summary: Passing 'all' true + value: + all: true + required: true + responses: + 201: + description: All contacts have been removed successfully from the list with + details of failed ones + content: + application/json: + schema: + $ref: '#/components/schemas/postContactInfo' + examples: + emailsArray: + summary: Response example when emails array is passed + value: + success: + - jeff32@example.com + - jim56@example.com + failure: + - david@example.com + idsArray: + summary: Response example when ids array is paased + value: + success: + - 1 + - 2 + failure: + - 5 + allTrue: + summary: Response example when 'all' is passed as true + value: + total: 23 + processId: 5 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: List ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: contactEmails + /contacts/export: + post: + tags: + - Contacts + summary: Export contacts + description: It returns the background process ID which on completion calls + the notify URL that you have set in the input. File will be available in csv. + operationId: requestContactExport + requestBody: + description: Values to request a contact export + content: + application/json: + schema: + $ref: '#/components/schemas/requestContactExport' + required: true + responses: + 202: + # description: Contact export request has been accepted + $ref: '#/components/responses/createdProcessId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /contacts/import: + post: + tags: + - Contacts + summary: Import contacts + description: It returns the background process ID which on completion calls + the notify URL that you have set in the input. + operationId: importContacts + requestBody: + description: Values to import contacts in Brevo. To know more about the + expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` + content: + application/json: + schema: + $ref: '#/components/schemas/requestContactImport' + required: true + responses: + 202: + # description: Contact import request has been accepted + $ref: '#/components/responses/createdProcessId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smsCampaigns: + get: + tags: + - SMS Campaigns + summary: Returns the information for all your created SMS campaigns + operationId: getSmsCampaigns + parameters: + - name: status + in: query + description: Status of campaign. + schema: + type: string + enum: + - suspended + - archive + - sent + - queued + - draft + - inProcess + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) + schema: + type: string + - name: limit + in: query + description: Number limitation for the result returned + schema: + maximum: 1000 + minimum: 0 + type: integer + format: int64 + default: 500 + - name: offset + in: query + description: Beginning point in the list to retrieve from. + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: SMS campaigns informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSmsCampaigns' + examples: + response: + value: + campaigns: + - id: 2 + name: PROMO CODE + status: sent + content: Visit our Store and get some discount ! + scheduledAt: 2017-06-01T12:30:00Z + testSent: true + sender: MyCompany + createdAt: 2017-06-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + sentDate: 2017-06-01T12:30:00Z + recipients: + lists: + - 21 + exclusionLists: + - 13 + statistics: + delivered: 2987 + sent: 3000 + processing: 0 + softBounces: 3 + hardBounces: 1 + unsubscriptions: 3 + answered: 2 + - id: 10 + name: SUMMER SALE + status: draft + content: Summer Sale is starting tomorrow. Get extra 10% with this + code:SUM17 + scheduledAt: 2017-08-04T12:30:00Z + testSent: false + sender: MyCompany + createdAt: 2017-06-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + sentDate: 2017-06-01T12:30:00Z + recipients: + lists: + - 21 + exclusionLists: + - 13 + statistics: + delivered: 2987 + sent: 3000 + processing: 0 + softBounces: 3 + hardBounces: 1 + unsubscriptions: 3 + answered: 2 + count: 12 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - SMS Campaigns + summary: Creates an SMS campaign + operationId: createSmsCampaign + requestBody: + description: Values to create an SMS Campaign + content: + application/json: + schema: + $ref: '#/components/schemas/createSmsCampaign' + required: true + responses: + 201: + # description: SMS campaign created + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smsCampaigns/{campaignId}: + get: + tags: + - SMS Campaigns + summary: Get an SMS campaign + operationId: getSmsCampaign + parameters: + - name: campaignId + in: path + description: id of the SMS campaign + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: SMS campaign informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSmsCampaign' + examples: + response: + value: + id: 2 + name: PROMO CODE + status: sent + content: Visit our Store and get some discount ! + scheduledAt: 2017-06-01T12:30:00Z + testSent: true + sender: MyCompany + createdAt: 2017-06-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + recipients: + lists: + - 21 + exclusionLists: + - 13 + statistics: + delivered: 2987 + sent: 3000 + processing: 0 + softBounces: 3 + hardBounces: 1 + unsubscriptions: 3 + answered: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - SMS Campaigns + summary: Update an SMS campaign + operationId: updateSmsCampaign + parameters: + - name: campaignId + in: path + description: id of the SMS campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update an SMS Campaign + content: + application/json: + schema: + $ref: '#/components/schemas/updateSmsCampaign' + required: true + responses: + 204: + description: SMS campaign updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - SMS Campaigns + summary: Delete an SMS campaign + operationId: deleteSmsCampaign + parameters: + - name: campaignId + in: path + description: id of the SMS campaign + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: SMS campaign has been deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smsCampaigns/{campaignId}/sendNow: + post: + tags: + - SMS Campaigns + summary: Send your SMS campaign immediately + operationId: sendSmsCampaignNow + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: SMS campaign has been scheduled + content: { } + 400: + description: SMS Campaign could not be sent + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 402: + description: You don't have enough credit to send your campaign. Please + update your plan + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smsCampaigns/{campaignId}/status: + put: + tags: + - SMS Campaigns + summary: Update a campaign's status + operationId: updateSmsCampaignStatus + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Status of the campaign. + content: + application/json: + schema: + $ref: '#/components/schemas/updateCampaignStatus' + required: true + responses: + 204: + description: The campaign status has been updated successfully + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: status + /smsCampaigns/{campaignId}/sendTest: + post: + tags: + - SMS Campaigns + summary: Send a test SMS campaign + operationId: sendTestSms + parameters: + - name: campaignId + in: path + description: Id of the SMS campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: | + Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** + content: + application/json: + schema: + $ref: '#/components/schemas/sendTestSms' + required: true + responses: + 204: + description: Test SMS has been sent successfully to the recipient + content: { } + 400: + description: Test SMS could not be sent to the following email addresses + content: + application/json: + schema: + $ref: '#/components/schemas/postSendSmsTestFailed' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /smsCampaigns/{campaignId}/exportRecipients: + post: + tags: + - SMS Campaigns + summary: Export an SMS campaign's recipients + description: It returns the background process ID which on completion calls + the notify URL that you have set in the input. + operationId: requestSmsRecipientExport + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to send for a recipient export request + content: + application/json: + schema: + $ref: '#/components/schemas/requestSmsRecipientExport' + required: false + responses: + 202: + # description: Recipient export request has been accepted + $ref: '#/components/responses/createdProcessId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: recipientExport + /smsCampaigns/{campaignId}/sendReport: + post: + tags: + - SMS Campaigns + summary: Send an SMS campaign's report + description: Send report of Sent and Archived campaign, to the specified email + addresses, with respective data and a pdf attachment in detail. + operationId: sendSmsReport + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values for send a report + content: + application/json: + schema: + $ref: '#/components/schemas/sendReport' + required: true + responses: + 204: + description: Report has been successfully sent to the defined recipients + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /transactionalSMS/sms: + post: + tags: + - Transactional SMS + summary: Send SMS message to a mobile number + operationId: sendTransacSms + requestBody: + description: Values to send a transactional SMS + content: + application/json: + schema: + $ref: '#/components/schemas/sendTransacSms' + required: true + responses: + 201: + description: SMS has been sent successfully to the recipient + content: + application/json: + schema: + $ref: '#/components/schemas/sendSms' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 402: + description: You don't have enough credit to send your SMS. Please update + your plan + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: sendTransacSms + /transactionalSMS/statistics/aggregatedReport: + get: + tags: + - Transactional SMS + summary: Get your SMS activity aggregated over a period of time + operationId: getTransacAggregatedSmsReport + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** + schema: + type: integer + format: int64 + - name: tag + in: query + description: Filter on a tag + schema: + type: string + responses: + 200: + description: Aggregated SMS report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getTransacAggregatedSmsReport' + examples: + response: + value: + range: 2015-05-22|2017-11-29 + requests: 54 + delivered: 16 + hardBounces: 5 + softBounces: 26 + blocked: 4 + unsubscribed: 10 + replied: 8 + accepted: 6 + rejected: 14 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /transactionalSMS/statistics/reports: + get: + tags: + - Transactional SMS + summary: Get your SMS activity aggregated per day + operationId: getTransacSmsReport + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** + schema: + type: integer + format: int64 + - name: tag + in: query + description: Filter on a tag + schema: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Aggregated SMS report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getTransacSmsReport' + examples: + response: + value: + reports: + - date: 2017-04-30 + requests: 10756 + delivered: 10103 + hardBounces: 21 + softBounces: 137 + blocked: 1026 + unsubscribed: 720 + replied: 5091 + accepted: 2318 + rejected: 0 + - date: 2017-05-01 + requests: 18812 + delivered: 17499 + hardBounces: 34 + softBounces: 254 + blocked: 1514 + unsubscribed: 1090 + replied: 10089 + accepted: 4393 + rejected: 0 + - date: 2017-05-02 + requests: 14321 + delivered: 13427 + hardBounces: 16 + softBounces: 176 + blocked: 1646 + unsubscribed: 1170 + replied: 11563 + accepted: 4689 + rejected: 0 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /transactionalSMS/statistics/events: + get: + tags: + - Transactional SMS + summary: Get all your SMS activity (unaggregated events) + operationId: getSmsEvents + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report + schema: + type: string + - name: offset + in: query + description: Index of the first document of the page + schema: + type: integer + format: int64 + default: 0 + - name: days + in: query + description: | + Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** + schema: + type: integer + format: int64 + - name: phoneNumber + in: query + description: Filter the report for a specific phone number + schema: + type: string + - name: event + in: query + description: Filter the report for specific events + schema: + type: string + enum: + - bounces + - hardBounces + - softBounces + - delivered + - sent + - accepted + - unsubscription + - replies + - blocked + - rejected + - name: tags + in: query + description: Filter the report for specific tags passed as a serialized urlencoded + array + schema: + type: string + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: Sms events report informations + content: + application/json: + schema: + $ref: '#/components/schemas/getSmsEventReport' + examples: + response: + value: + events: + - phoneNumber: "00911059469013" + date: 2015-05-20T12:30:00Z + messageId: "1473139351170140" + event: sent + reason: Recipient is currently unreachable + tag: cabWaiting + - phoneNumber: "00911059469013" + date: 2015-05-20T16:30:00Z + messageId: "1473139351170140" + event: delivered + reason: Recipient is currently unreachable + tag: cabRequest + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns/{campaignId}: + get: + tags: + - WhatsApp Campaigns + summary: Get a WhatsApp campaign + operationId: getWhatsAppCampaign + parameters: + - name: campaignId + in: path + description: Id of the campaign + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: Get WhatsApp campaign information on the basis of campaignId + content: + application/json: + schema: + $ref: '#/components/schemas/getWhatsappCampaignOverview' + examples: + response: + value: + id: 1672035851100690 + campaignName: Test WhatsApp Campaign + campaignStatus: sent + scheduledAt: 2022-12-26T09:50:00Z + senderNumber: 9368207029 + recipients: + type: list + includedLists: + - 22 + excludedLists: + - 45 + template: + name: "official_campaign8" + category: "MARKETING" + language: "en" + contains_button: true + display_header: false + components: + - type: "BODY" + text: "making it look like readable English." + - type: "BUTTONS" + buttons: + - type: "URL" + text: "vLorem Ipsum is simply du" + url: "app.brevo" + - type: "PHONE_NUMBER" + text: "Lorem Ipsum is simply dum" + phone_number: "+918800613137" + header_variables: + - name: "FIRSTNAME" + default: "INVALID HEADER" + index: 1 + datatype: "text" + header_type: "text" + body_variable: [ ] + button_type: "CALL_TO_ACTION" + header_footer: true + stats: + sent: 3, + delivered: 3, + read: 2, + unsubscribe: 0, + notSent: 4 + createdAt: 2022-12-26T06:50:00Z + modifiedAt: 2022-12-26T08:50:00Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign Id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - WhatsApp Campaigns + summary: Delete a WhatsApp campaign + operationId: deleteWhatsAppCampaign + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: WhatsApp campaign has been deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Campaign Id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - WhatsApp Campaigns + summary: Update a WhatsApp campaign + operationId: updateWhatsAppCampaign + parameters: + - name: campaignId + in: path + description: id of the campaign + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update a WhatsApp Campaign + content: + application/json: + schema: + $ref: '#/components/schemas/updateWhatsAppCampaign' + required: true + responses: + 204: + description: WhatsApp campaign has been deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns/template-list: + get: + tags: + - WhatsApp Campaigns + summary: Return all your created WhatsApp templates + operationId: getWhatsAppTemplates + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: source + in: query + description: source of the template + required: false + schema: + type: string + enum: + - Automation + - Conversations + responses: + 200: + description: WhatsApp templates informations + content: + application/json: + schema: + $ref: '#/components/schemas/getWhatsappTemplates' + examples: + response: + value: + count: 2 + templates: + - id: 235 + name: campaign_22 + type: whatsapp + status: approved + language: en + category: 'MARKETING' + errorReason: 'NONE' + createdAt: 2017-05-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + - id: 124 + name: test-template + type: whatsapp + status: draft + language: '' + category: 'MARKETING' + errorReason: 'NONE' + createdAt: 2017-0 + modifiedAt: 2017-05-01T12:30:00Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns: + post: + tags: + - WhatsApp Campaigns + summary: Create and Send a WhatsApp campaign + operationId: createWhatsAppCampaign + requestBody: + description: Values to create a WhatsApp Campaign + content: + application/json: + schema: + $ref: '#/components/schemas/createWhatsAppCampaign' + required: true + responses: + 201: + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + get: + tags: + - WhatsApp Campaigns + summary: Return all your created WhatsApp campaigns + operationId: getWhatsAppCampaigns + parameters: + - name: startDate + in: query + description: | + **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. + **Prefer to pass your timezone in date-time format for accurate result** + schema: + type: string + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + minimum: 0 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: WhatsApp campaigns information + content: + application/json: + schema: + $ref: '#/components/schemas/getWhatsappCampaigns' + examples: + response: + value: + count: 23 + campaigns: + - id: 1672035851100690 + campaignName: campaign_22 + campaignStatus: sent + templateId: 637660278078655 + scheduledAt: 2022-12-27T09:50:00Z + errorReason: "" + invalidatedContacts: 0 + stats: + sent: 3 + delivered: 3 + read: 2 + unsubscribe: 0 + notSent: 4 + readPercentage: 28.57 + createdAt: 2017-05-01T12:30:00Z + modifiedAt: 2017-05-01T12:30:00Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns/template: + post: + tags: + - WhatsApp Campaigns + summary: Create a WhatsApp template + operationId: createWhatsAppTemplate + requestBody: + description: Values to create a WhatsApp template + content: + application/json: + schema: + $ref: '#/components/schemas/createWhatsAppTemplate' + required: true + responses: + 201: + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns/template/approval/{templateId}: + post: + tags: + - WhatsApp Campaigns + summary: Send your WhatsApp template for approval + operationId: sendWhatsAppTemplateApproval + parameters: + - name: templateId + in: path + description: id of the template + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: WhatsApp template sent for approval + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsappCampaigns/config: + get: + tags: + - WhatsApp Campaigns + summary: Get your WhatsApp API account information + operationId: getWhatsAppConfig + responses: + 200: + description: Get all the information of your WhatsApp API account + content: + application/json: + schema: + $ref: '#/components/schemas/getWhatsAppConfig' + examples: + response: + value: + whatsappBusinessAccountID: 105569359072383 + sendingLimit: TIER_1K + phoneNumberQuality: GREEN + whatsappBusinessAccountStatus: APPROVED + businessStatus: verified + phoneNumberNameStatus: APPROVED + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /senders: + get: + tags: + - Senders + summary: Get the list of all your senders + operationId: getSenders + parameters: + - name: ip + in: query + description: | + Filter your senders for a specific ip. **Available for dedicated IP usage only** + schema: + type: string + - name: domain + in: query + description: Filter your senders for a specific domain + schema: + type: string + responses: + 200: + description: list of senders + content: + application/json: + schema: + $ref: '#/components/schemas/getSendersList' + examples: + response: + value: + senders: + - id: 1 + name: Marketing + email: marketing@mycompany.com + active: true + ips: + - ip: 123.98.689.7 + domain: mycompany.com + weight: 100 + - id: 2 + name: Newsletter + email: newsletter@mycompany.com + active: false + ips: + - ip: 123.98.689.7 + domain: mycompany.com + weight: 50 + - ip: 123.98.643.2 + domain: news.mycompany.com + weight: 50 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Senders + summary: Create a new sender + operationId: createSender + requestBody: + description: sender's name + content: + application/json: + schema: + $ref: '#/components/schemas/createSender' + required: false + responses: + 201: + description: sender created + content: + application/json: + schema: + $ref: '#/components/schemas/createSenderModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: sender + /senders/{senderId}: + put: + tags: + - Senders + summary: Update a sender + operationId: updateSender + parameters: + - name: senderId + in: path + description: Id of the sender + required: true + schema: + type: integer + format: int64 + requestBody: + description: sender's name + content: + application/json: + schema: + $ref: '#/components/schemas/updateSender' + required: false + responses: + 204: + description: sender updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Sender ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: sender + delete: + tags: + - Senders + summary: Delete a sender + operationId: deleteSender + parameters: + - name: senderId + in: path + description: Id of the sender + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: sender deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Sender ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /senders/{senderId}/validate: + put: + tags: + - Senders + summary: Validate Sender using OTP + operationId: validateSenderByOTP + parameters: + - name: senderId + in: path + description: Id of the sender + required: true + schema: + type: integer + format: int64 + requestBody: + description: otp + content: + application/json: + schema: + $ref: '#/components/schemas/otp' + required: false + responses: + 204: + description: Sender verified + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Sender ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: sender + /senders/{senderId}/ips: + get: + tags: + - Senders + summary: Get all the dedicated IPs for a sender + operationId: getIpsFromSender + parameters: + - name: senderId + in: path + description: Id of the sender + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: list of dedicated IPs + content: + application/json: + schema: + $ref: '#/components/schemas/getIpsFromSender' + examples: + response: + value: + ips: + - id: 3 + ip: 123.65.8.22 + domain: mailing.myshop.dom + weight: 40 + - id: 5 + ip: 123.43.21.3 + domain: newsletter.myshop.dom + weight: 60 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Sender ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /senders/ips: + get: + tags: + - Senders + summary: Get all the dedicated IPs for your account + operationId: getIps + responses: + 200: + description: list of dedicated IPs + content: + application/json: + schema: + $ref: '#/components/schemas/getIps' + examples: + response: + value: + ips: + - id: 3 + ip: 67.145.89.3 + active: true + domain: mailing.myshop.com + - id: 5 + ip: 76.76.125.9 + active: true + domain: newsletter.myshop.com + - id: 6 + ip: 123.65.8.22 + active: false + domain: notifications.myshop.com + /senders/domains: + get: + tags: + - Domains + summary: Get the list of all your domains + operationId: getDomains + responses: + 200: + description: list of domains + content: + application/json: + schema: + $ref: '#/components/schemas/getDomainsList' + examples: + response: + value: + domains: + - id: 1 + domain_name: mycompany.com + authenticated: true + verified: true + ip: 123.98.689.7 + - id: 2 + domain_name: myexample.com + authenticated: false + verified: true + ip: null + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Domains + summary: Create a new domain + operationId: createDomain + requestBody: + description: domain's name + content: + application/json: + schema: + $ref: '#/components/schemas/createDomain' + required: false + responses: + 200: + description: domain created + content: + application/json: + schema: + $ref: '#/components/schemas/createDomainModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: domain + /senders/domains/{domainName}: + delete: + tags: + - Domains + summary: Delete a domain + operationId: deleteDomain + parameters: + - name: domainName + in: path + description: Domain name + required: true + schema: + type: string + responses: + 200: + description: domain deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Domain does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + get: + tags: + - Domains + summary: Validate domain configuration + operationId: getDomainConfiguration + parameters: + - name: domainName + in: path + description: Domain name + required: true + schema: + type: string + responses: + 200: + description: domain configuration + content: + application/json: + schema: + $ref: '#/components/schemas/getDomainConfigurationModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Domain does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /senders/domains/{domainName}/authenticate: + put: + tags: + - Domains + summary: Authenticate a domain + operationId: authenticateDomain + parameters: + - name: domainName + in: path + description: Domain name + required: true + schema: + type: string + responses: + 200: + description: domain authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/authenticateDomainModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Domain does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /webhooks: + get: + tags: + - Webhooks + summary: Get all webhooks + operationId: getWebhooks + parameters: + - name: type + in: query + description: Filter on webhook type + schema: + type: string + default: transactional + enum: + - marketing + - transactional + - inbound + - name: sort + in: query + description: Sort the results in the ascending/descending order of webhook creation + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + responses: + 200: + description: Webhooks informations + content: + application/json: + schema: + $ref: '#/components/schemas/getWebhooks' + examples: + response: + value: + webhooks: + - url: https://example.domain.com/webhook/events/kzfxxxxxxxx0uyo1 + id: 9864 + description: Webhook triggered on campaign openings + events: + - opened + type: transac + createdAt: 2016-07-18T12:30:09Z + modifiedAt: 2016-07-18T16:00:50Z + batched: true + auth: + type: bearer + token: test-auth-token1234 + headers: + - key: cf-secret + value: test-header-value + - url: http://exmaple.domain.com/15kxxxxxn1 + id: 22770 + description: Webhook triggered on campaign hard bounces + events: + - hardBounces + type: marketing + createdAt: 2017-02-20T14:30:00Z + modifiedAt: 2017-02-20T19:00:00Z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Webhooks + summary: Create a webhook + operationId: createWebhook + requestBody: + description: Values to create a webhook + content: + application/json: + schema: + $ref: '#/components/schemas/createWebhook' + required: true + responses: + 201: + # description: Webhook created + $ref: '#/components/responses/createModel' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /webhooks/{webhookId}: + get: + tags: + - Webhooks + summary: Get a webhook details + operationId: getWebhook + parameters: + - name: webhookId + in: path + description: Id of the webhook + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: Webhook informations + content: + application/json: + schema: + $ref: '#/components/schemas/getWebhook' + examples: + response: + value: + url: http://example.domain.com/1brxxxxxx5p1 + id: 7287 + description: Webhook triggered on campaign openings and addition of + lists + events: + - listAdditions + - opened + type: marketing + createdAt: 2016-06-07T09:10:10Z + modifiedAt: 2016-06-08T11:30:00Z + batched: true + auth: + type: bearer + token: test-auth-token1234 + headers: + - key: cf-secret + value: test-header-value + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Webhook ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Webhooks + summary: Update a webhook + operationId: updateWebhook + parameters: + - name: webhookId + in: path + description: Id of the webhook + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update a webhook + content: + application/json: + schema: + $ref: '#/components/schemas/updateWebhook' + required: true + responses: + 204: + description: Webhook updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Webhook ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: updateWebhook + delete: + tags: + - Webhooks + summary: Delete a webhook + operationId: deleteWebhook + parameters: + - name: webhookId + in: path + description: Id of the webhook + required: true + schema: + type: integer + format: int64 + responses: + 204: + description: Webhook deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Webhook ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /webhooks/export: + post: + tags: + - Webhooks + summary: Export all webhook events + description: This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL. + operationId: exportWebhooksHistory + requestBody: + description: Values to submit for webhooks history + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/exportWebhooksHistory' + required: true + responses: + 202: + description: Request accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createdProcessId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children: + get: + tags: + - Reseller + summary: Get the list of all children accounts + operationId: getResellerChilds + parameters: + - name: limit + in: query + description: Number of documents for child accounts information per page + schema: + maximum: 20 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + responses: + 200: + description: list of children + content: + application/json: + schema: + $ref: '#/components/schemas/getChildrenList' + examples: + response: + value: + children: + - email: john.smith@example.com + firstName: John + lastName: Smith + companyName: MyCompany + credits: + emailCredits: 98555 + smsCredits: 87556 + statistics: + previousMonthTotalSent: 7654 + currentMonthTotalSent: 4566 + totalSent: 987554 + password: abC0xxxxxx3jkL + ips: + - 176.2.39.4 + - 231.43.21.7 + apiKeys: + v2: + - name: N˚2 + key: nOpxxxxxy7z + v3: + - name: N˚3 + key: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + id: 187588 + - email: alex.pain@example.com + firstName: Alex + lastName: Pain + companyName: MyStore + credits: + emailCredits: 2000 + smsCredits: 0 + statistics: + previousMonthTotalSent: 654 + currentMonthTotalSent: 300 + totalSent: 6553 + password: abC0xxxxx64kL + ips: + - 176.2.39.4 + - 231.43.21.7 + apiKeys: + v2: + - name: N˚2 + key: nOpxxxxxy7z + v3: + - name: N˚3 + key: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + id: 187669 + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Reseller + summary: Creates a reseller child + operationId: createResellerChild + requestBody: + description: reseller child to add + content: + application/json: + schema: + $ref: '#/components/schemas/createChild' + required: false + responses: + 201: + description: child created + content: + application/json: + schema: + $ref: '#/components/schemas/createReseller' + examples: + response: + value: + authKey: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + id: 1234567 + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}: + get: + tags: + - Reseller + summary: Get a child account's details + operationId: getChildInfo + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + responses: + 200: + description: Information for the child + content: + application/json: + schema: + $ref: '#/components/schemas/getChildInfo' + examples: + response: + value: + email: john.smith@example.com + firstName: John + lastName: Smith + companyName: MyCompany + credits: + emailCredits: 98555 + smsCredits: 87556 + statistics: + previousMonthTotalSent: 7654 + currentMonthTotalSent: 4566 + totalSent: 987554 + password: abC0xxxxx3jkL + ips: + - 176.2.39.4 + - 231.43.21.7 + apiKeys: + v2: + - name: N˚2 + key: nOpxxxxxy7z + v3: + - name: N˚3 + key: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Reseller + summary: Update info of reseller's child based on the child identifier supplied + operationId: updateResellerChild + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: values to update in child profile + content: + application/json: + schema: + $ref: '#/components/schemas/updateChild' + required: true + responses: + 204: + description: reseller's child updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: resellerChild + delete: + tags: + - Reseller + summary: Delete a single reseller child based on the child identifier supplied + operationId: deleteResellerChild + parameters: + - name: childIdentifier + in: path + description: Either auth key or child id of reseller's child + required: true + schema: + type: string + responses: + 204: + description: child deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/accountStatus: + put: + tags: + - Reseller + summary: Update info of reseller's child account status based on the identifier + supplied + operationId: updateChildAccountStatus + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: values to update in child account status + content: + application/json: + schema: + $ref: '#/components/schemas/updateChildAccountStatus' + required: true + responses: + 204: + description: reseller's child account status updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/accountCreationStatus: + get: + tags: + - Reseller + summary: Get the status of a reseller's child account creation, whether it is + successfully created (exists) or not based on the childIdentifier supplied + operationId: getChildAccountCreationStatus + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + responses: + 200: + description: status of reseller's child account + content: + application/json: + schema: + $ref: '#/components/schemas/getChildAccountCreationStatus' + examples: + response: + value: + childAccountCreated: true + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/ips/associate: + post: + tags: + - Reseller + summary: Associate a dedicated IP to the child + operationId: associateIpToChild + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: IP to associate + content: + application/json: + schema: + $ref: '#/components/schemas/manageIp' + required: true + responses: + 204: + description: Dedicated IP is associated to the child + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: ip + /reseller/children/{childIdentifier}/ips/dissociate: + post: + tags: + - Reseller + summary: Dissociate a dedicated IP to the child + operationId: dissociateIpFromChild + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: IP to dissociate + content: + application/json: + schema: + $ref: '#/components/schemas/manageIp' + required: true + responses: + 204: + description: Dedicated IP is dissociated from the child + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: ip + /reseller/children/{childIdentifier}/credits/add: + post: + tags: + - Reseller + summary: Add Email and/or SMS credits to a specific child account + operationId: addCredits + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: Values to post to add credit to a specific child account + content: + application/json: + schema: + $ref: '#/components/schemas/addCredits' + required: true + responses: + 200: + description: Credits added + content: + application/json: + schema: + $ref: '#/components/schemas/remainingCreditModel' + examples: + response: + value: + child: + sms: 500 + email: 2000 + reseller: + sms: 12900 + email: 2000000 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/credits/remove: + post: + tags: + - Reseller + summary: Remove Email and/or SMS credits from a specific child account + operationId: removeCredits + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: Values to post to remove email or SMS credits from a specific + child account + content: + application/json: + schema: + $ref: '#/components/schemas/removeCredits' + required: true + responses: + 200: + description: Credits removed + content: + application/json: + schema: + $ref: '#/components/schemas/remainingCreditModel' + examples: + response: + value: + child: + sms: 500 + email: 2000 + reseller: + sms: 12900 + email: 2000000 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + x-codegen-request-body-name: removeCredits + /reseller/children/{childIdentifier}/domains: + get: + tags: + - Reseller + summary: Get all sender domains for a specific child account + operationId: getChildDomains + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + responses: + 200: + description: Sender domains of the child + content: + application/json: + schema: + $ref: '#/components/schemas/getChildDomains' + examples: + response: + value: + - domain: mycustomdomain.com + active: true + - domain: mynewdomain.com + active: true + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Reseller + summary: Create a domain for a child account + operationId: createChildDomain + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + requestBody: + description: Sender domain to add for a specific child account. This will + not be displayed to the parent account. + content: + application/json: + schema: + $ref: '#/components/schemas/addChildDomain' + required: true + responses: + 201: + description: Domain added + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/domains/{domainName}: + put: + tags: + - Reseller + summary: Update the sender domain of reseller's child based on the childIdentifier + and domainName passed + operationId: updateChildDomain + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + - name: domainName + in: path + description: Pass the existing domain that needs to be updated + required: true + schema: + type: string + requestBody: + description: value to update for sender domain + content: + application/json: + schema: + $ref: '#/components/schemas/updateChildDomain' + required: true + responses: + 204: + description: reseller's child domain updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Reseller + summary: Delete the sender domain of the reseller child based on the childIdentifier + and domainName passed + operationId: deleteChildDomain + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + - name: domainName + in: path + description: Pass the existing domain that needs to be deleted + required: true + schema: + type: string + responses: + 204: + description: child domain deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /reseller/children/{childIdentifier}/auth: + get: + tags: + - Reseller + summary: Get session token to access Brevo (SSO) + description: It returns a session [token] which will remain valid for a short + period of time. A child account will be able to access a white-labeled section + by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] + operationId: getSsoToken + parameters: + - name: childIdentifier + in: path + description: Either auth key or id of reseller's child + required: true + schema: + type: string + responses: + 200: + description: Session token + content: + application/json: + schema: + $ref: '#/components/schemas/getSsoToken' + examples: + response: + value: + token: 5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a reseller + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Child auth key or child id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /account: + get: + tags: + - Account + summary: Get your account information, plan and credits details + operationId: getAccount + responses: + 200: + description: account informations + content: + application/json: + schema: + $ref: '#/components/schemas/getAccount' + examples: + response: + value: + plan: + - type: payAsYouGo + credits: 5000 + creditsType: sendLimit + - type: subscription + credits: 39983 + creditsType: sendLimit + startDate: 2017-03-11 + endDate: 2017-04-11 + - type: sms + credits: 999.5360000000001 + creditsType: sendLimit + relay: + enabled: true + data: + userName: john.smith@example.com + relay: smtp-relay.domain.com + port: 587 + marketingAutomation: + key: kzfr5xxxxxxttuyo1 + enabled: true + email: john.smith@example.com + firstName: John + lastName: Smith + companyName: MyShop + address: + city: New-York + street: 1677B 8th Avenue + zipCode: "7665" + country: USA + /organization/activities: + get: + tags: + - Account + - Master account + summary: Get user activity logs + operationId: getAccountActivity + parameters: + - name: startDate + description: Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. + in: query + required: false + schema: + type: string + - name: endDate + description: Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. + in: query + required: false + schema: + type: string + - name: limit + description: Number of documents per page + in: query + required: false + schema: + type: integer + format: int64 + default: 10 + maximum: 100 + minimum: 1 + - name: offset + description: Index of the first document in the page. + in: query + required: false + schema: + type: integer + format: int64 + default: 0 + responses: + 200: + description: list of user activity logs + content: + application/json: + schema: + $ref: '#/components/schemas/getAccountActivity' + examples: + response: + value: + logs: + - action: login-success + date: 2023-03-16T16:49:23+05:30 + user_email: test@mycompany.com + user_ip: 192.158.1.34 + user_agent: Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) + - action: update-profile + date: 2023-03-15T16:49:23+05:30 + user_email: test@myexample.com + user_ip: 192.158.1.38 + user_agent: Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /organization/invited/users: + get: + tags: + - User + summary: Get the list of all your users + operationId: getInvitedUsersList + responses: + 200: + description: list of all your users + content: + application/json: + schema: + $ref: '#/components/schemas/getInvitedUsersList' + examples: + response: + value: + users: + - email: owner@company.com + is_owner: true + status: active + feature_access: + marketing: owner + conversations: owner + crm: owner + - email: pendingInvitedUser@company.com + is_owner: false + status: pending + feature_access: + marketing: custom + conversations: none + crm: full + - email: connectedInvitedUser@company.com + is_owner: false + status: active + feature_access: + marketing: none + conversations: full + crm: none + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /organization/user/{email}/permissions: + get: + tags: + - User + summary: Check user permission + operationId: getUserPermission + parameters: + - name: email + description: Email of the invited user. + in: path + required: true + schema: + type: string + responses: + 200: + description: list of all the user's permissions + content: + application/json: + schema: + $ref: '#/components/schemas/getUserPermission' + examples: + response: + value: + email: invitedUser@company.com + status: active + privileges: + - feature: Email campaign + permissions: + - Create / edit / delete + - Send / schedule / suspend + - feature: Templates + permissions: + - Create / edit / delete + - Activate / deactivate + - feature: SMS campaign + permissions: + - Create / edit / delete + - Send / schedule / suspend + - feature: Facebook Ads + permissions: + - Schedule / pause + - feature: Landing pages + permissions: + - All + - feature: Workflows + permissions: + - Create / edit / delete + - Activate / deactivate / Pause + - feature: Contacts + permissions: + - View + - Contact forms + - feature: SMTP & API + permissions: + - SMTP + - API Keys + - Authorized IPs + - feature: User management + permissions: + - None + - feature: Sales Platform + permissions: + - Manage Owned Deals / Tasks / Companies + - Manage Others Deals / Tasks / Companies + - Reports + - Settings + - feature: Conversations + permissions: + - None + - feature: Senders, Domains & Dedicated IPs + permissions: + - Senders management + - Domains management + - Dedicated IPs management + - feature: Push + permissions: + - View + - Create / edit / delete + - Send + - Settings + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /organization/user/invitation/revoke/{email}: + put: + tags: + - User + summary: Revoke user permission + operationId: putRevokeUserPermission + parameters: + - name: email + description: Email of the invited user. + in: path + required: true + schema: + type: string + responses: + 200: + description: Credit note exists + content: + application/json: + schema: + $ref: '#/components/schemas/putRevokeUserPermissionResponse' + 403: + description: Unauthorized access + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /organization/user/invitation/{action}/{email}: + put: + tags: + - User + summary: Resend / Cancel invitation + operationId: putresendcancelinvitation + parameters: + - name: action + description: action + in: path + required: true + schema: + type: string + enum: + - resend + - cancel + - name: email + description: Email of the invited user. + in: path + required: true + schema: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/putresendcancelinvitationResponse' + 403: + description: Unauthorized access + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /organization/user/invitation/send: + post: + tags: + - User + summary: Send invitation to user + description: | + `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. + + `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. + + Features and their respective permissions are as below: + + - `email_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" + - `sms_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" + - `contacts`: + - "view" + - "send_schedule_suspend" + - "import" + - "export" + - "list_and_attributes" + - "forms" + - `templates`: + - "create_edit_delete" + - "activate_deactivate" + - `workflows`: + - "create_edit_delete" + - "activate_deactivate_pause" + - "settings" + - `facebook_ads`: + - "create_edit_delete" + - "schedule_pause" + - `landing_pages`: + - "all" + - `transactional_emails`: + - "settings" + - "logs" + - `smtp_api`: + - "smtp" + - "api_keys" + - "authorized_ips" + - `user_management`: + - "all" + - `sales_platform`: + - "manage_owned_deals_tasks_companies" + - "manage_others_deals_tasks_companies" + - "reports" + - "settings" + - `phone`: + - "all" + - `conversations`: + - "access" + - "assign" + - "configure" + - `senders_domains_dedicated_ips`: + - "senders_management" + - "domains_management" + - "dedicated_ips_management" + - `push_notifications`: + - "view" + - "create_edit_delete" + - "send" + - "settings" + + **Note**: + - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited user. + - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + operationId: inviteuser + requestBody: + description: Values to create an invitation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inviteuser' + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/inviteuserResponse' + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /organization/user/update/permissions: + post: + tags: + - User + summary: Update permission for a user + description: | + `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. + + `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. + + Features and their respective permissions are as below: + + - `email_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" + - `sms_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" + - `contacts`: + - "view" + - "send_schedule_suspend" + - "import" + - "export" + - "list_and_attributes" + - "forms" + - `templates`: + - "create_edit_delete" + - "activate_deactivate" + - `workflows`: + - "create_edit_delete" + - "activate_deactivate_pause" + - "settings" + - `facebook_ads`: + - "create_edit_delete" + - "schedule_pause" + - `landing_pages`: + - "all" + - `transactional_emails`: + - "settings" + - "logs" + - `smtp_api`: + - "smtp" + - "api_keys" + - "authorized_ips" + - `user_management`: + - "all" + - `sales_platform`: + - "manage_owned_deals_tasks_companies" + - "manage_others_deals_tasks_companies" + - "reports" + - "settings" + - `phone`: + - "all" + - `conversations`: + - "access" + - "assign" + - "configure" + - `senders_domains_dedicated_ips`: + - "senders_management" + - "domains_management" + - "dedicated_ips_management" + - `push_notifications`: + - "view" + - "create_edit_delete" + - "send" + - "settings" + + **Note**: + - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. + - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. + operationId: EditUserPermission + requestBody: + description: Values to create an invitation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inviteuser' + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/updateUserResponse' + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /processes: + get: + tags: + - Process + summary: Return all the processes for your account + operationId: getProcesses + parameters: + - name: limit + in: query + description: Number limitation for the result returned + schema: + maximum: 50 + minimum: 0 + type: integer + format: int64 + default: 10 + - name: offset + in: query + description: Beginning point in the list to retrieve from. + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: processes informations + content: + application/json: + schema: + $ref: '#/components/schemas/getProcesses' + examples: + response: + value: + processes: + - id: 40 + status: completed + name: TRANS-CALC + - id: 43 + status: queued + name: TRANS-GLOBAL-CALC + - id: 194 + status: completed + name: SEARCH_EXPORT_USERS + export_url: filename.csv + count: 3 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /processes/{processId}: + get: + tags: + - Process + summary: Return the informations for a process + operationId: getProcess + parameters: + - name: processId + in: path + description: Id of the process + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: process informations + content: + application/json: + schema: + $ref: '#/components/schemas/getProcess' + examples: + response: + value: + id: 194 + status: completed + name: SEARCH_EXPORT_USERS + export_url: filename.csv + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Process ID not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: processId is invalid + /inbound/events: + get: + tags: + - Inbound Parsing + summary: Get the list of all the events for the received emails. + description: This endpoint will show the list of all the events for the received emails. + operationId: getInboundEmailEvents + parameters: + - name: sender + description: Email address of the sender. + in: query + required: false + schema: + type: string + - name: startDate + description: Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. + in: query + required: false + schema: + type: string + format: datetime + - name: endDate + description: Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. + in: query + required: false + schema: + type: string + format: datetime + - name: limit + description: Number of documents returned per page + in: query + required: false + schema: + type: integer + format: int64 + default: 100 + maximum: 500 + minimum: 0 + - name: offset + description: Index of the first document on the page + in: query + required: false + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + responses: + 200: + description: List of events for received emails. + content: + application/json: + schema: + $ref: '#/components/schemas/getInboundEmailEvents' + examples: + response: + value: + events: + - uuid: "1a825d56-029b-4a41-b8e4-1a825d56" + date: "2017-03-11T12:30:00.000Z" + sender: "john@example.com" + recipient: "alexa@example.com" + - uuid: "1a825d56-029b-4a41-b8e4-61670463431b" + date: "2017-03-12T12:30:00.000Z" + sender: "alice@example.com" + recipient: "bob@example.com" + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /inbound/events/{uuid}: + get: + tags: + - Inbound Parsing + summary: Fetch all events history for one particular received email. + description: This endpoint will show the list of all events history for one particular received email. + operationId: getInboundEmailEventsByUuid + parameters: + - name: uuid + description: 'UUID to fetch events specific to recieved email' + in: path + required: true + schema: + type: string + responses: + 200: + description: Email campaign informations + content: + application/json: + schema: + $ref: '#/components/schemas/getInboundEmailEventsByUuid' + examples: + response: + value: + receivedAt: "2017-03-12T12:30:00.000Z" + deliveredAt: "2017-03-12T12:31:00.000Z" + sender: "alice@example.com" + recipient: "bob@example.com" + messageId: "" + subject: "Re: Question about your API" + attachments: + - name: "invoice.pdf" + contentType: "application/pdf" + contentId: null + contentLength: 12345 + logs: + - date: "2017-03-12T12:30:00.000Z" + type: "received" + - date: "2017-03-12T12:30:04.000Z" + type: "webhookFailed" + - date: "2017-03-12T12:31:04.000Z" + type: "webhookDelivered" + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /inbound/attachments/{downloadToken}: + get: + tags: + - Inbound Parsing + summary: Retrieve inbound attachment with download token. + description: This endpoint will retrieve inbound attachment with download token. + operationId: getInboundEmailAttachment + parameters: + - name: downloadToken + description: 'Token to fetch a particular attachment' + in: path + required: true + schema: + type: string + responses: + 200: + description: Attachment information + content: + application/octet-stream: + schema: + type: string + format: binary + headers: + Content-Type: + schema: + type: string + example: image/png + Content-Disposition: + schema: + type: string + example: attachment; filename="download.png" + Content-Length: + schema: + type: integer + example: 4032 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: attachment not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /corporate/subAccount: + get: + tags: + - Master account + summary: Get the list of all the sub-accounts of the master account. + description: This endpoint will provide the list all the sub-accounts of the master account. + parameters: + - name: offset + description: 'Index of the first sub-account in the page' + in: query + required: true + schema: + type: integer + - name: limit + description: 'Number of sub-accounts to be displayed on each page' + in: query + required: true + schema: + type: integer + responses: + 200: + description: Sub-accounts list + content: + application/json: + schema: + $ref: '#/components/schemas/subAccountsResponse' + examples: + response: + value: + count: 3 + subAccounts: + - id: 4043629 + companyName: "Company1" + active: true, + createdAt: 1631523176 + - id: 3984002 + companyName: "Company2" + active: true + createdAt: 1629439311 + - id: 3524191 + companyName: "Company3" + active: true + createdAt: 1614713641 + + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Master account + summary: Create a new sub-account under a master account. + description: This endpoint will create a new sub-account under a master account + requestBody: + description: Request body with sub-account organization name + content: + application/json: + schema: + $ref: '#/components/schemas/createSubAccount' + required: true + + responses: + 201: + description: Created sub-account ID + content: + application/json: + schema: + $ref: '#/components/schemas/createSubAccountResponse' + examples: + response: + value: + id: 4109344 + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: missing_parameter + message: Missing companyName attribute in the request + /corporate/subAccount/{id}: + get: + tags: + - Master account + summary: Get sub-account details + description: This endpoint will provide the details for the specified sub-account company + parameters: + - name: id + description: 'Id of the sub-account organization' + schema: + type: integer + format: int64 + in: path + required: true + responses: + 200: + description: Sub-account organization details + content: + application/json: + schema: + $ref: '#/components/schemas/subAccountDetailsResponse' + example: + name: "Uday Pandit" + email: "uday+1@brevo.com" + companyName: "API-Sub-26thOct21-4" + planInfo: + credits: + sms: 1234 + emails: + quantity: 2000 + remaining: 1955 + features: + inbox: + quantity: 20 + remaining: 12 + landingPage: + quantity: 25 + remaining: 14 + users: + quantity: 30 + remaining: 14 + planType: paid + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Master account + summary: Delete a sub-account + parameters: + - name: id + description: 'Id of the sub-account organization to be deleted' + schema: + type: integer + format: int64 + in: path + required: true + responses: + 204: + description: Returned when sub-account is deleted succesfully + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: missing_parameter + message: Sub-account 2039dfsddf885 is not valid + 404: + description: sub-account not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: document_not_found + message: Sub-account 2039885 was not found + /corporate/subAccount/{id}/plan: + put: + tags: + - Master account + summary: Update sub-account plan + description: This endpoint will update the sub-account plan + parameters: + - name: id + in: path + description: Id of the sub-account organization + required: true + schema: + type: integer + format: int64 + requestBody: + description: Values to update a sub-account plan + content: + application/json: + schema: + $ref: '#/components/schemas/subAccountUpdatePlanRequest' + required: true + responses: + 204: + description: Sub account plan updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a master account + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + code: "permission_denied" + message: "Access forbidden." + /corporate/subAccount/ssoToken: + post: + tags: + - Master account + summary: Generate SSO token to access Brevo + description: This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. + requestBody: + content: + application/json: + schema: + required: + - id + type: object + properties: + id: + type: integer + format: int64 + description: Id of the sub-account organization + example: 3232323 + email: + type: string + description: User email of sub-account organization + example: vipin+subaccount@brevo.com + target: + type: string + description: | + **Set target after login success** + * **automation** - Redirect to Automation after login + * **email_campaign** - Redirect to Email Campaign after login + * **contacts** - Redirect to Contacts after login + * **landing_pages** - Redirect to Landing Pages after login + * **email_transactional** - Redirect to Email Transactional after login + * **senders** - Redirect to Senders after login + * **sms_campaign** - Redirect to Sms Campaign after login + * **sms_transactional** - Redirect to Sms Transactional after login + enum: + - automation + - email_campaign + - contacts + - landing_pages + - email_transactional + - senders + - sms_campaign + - sms_transactional + example: contacts + url: + type: string + description: Set the full target URL after login success. The user will land directly on this target URL after login + example: https://app.brevo.com/senders/domain/list + responses: + 200: + description: Session token + content: + application/json: + schema: + $ref: '#/components/schemas/getSsoToken' + examples: + response: + value: + token: 5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: "invalid_parameter" + message: "Invalid sub-account id." + 403: + description: Current account is not a master account + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + code: "permission_denied" + message: "Access forbidden." + /corporate/masterAccount: + get: + tags: + - Master account + summary: Get the details of requested master account + description: This endpoint will provide the details of the master account. + responses: + 200: + description: Master account details + content: + application/json: + schema: + $ref: '#/components/schemas/masterDetailsResponse' + example: + email: "sample@example.com" + companyName: "Corp Sample 1-1" + id: 1003286 + currencyCode: "INR" + timezone: "Europe/Paris" + billingInfo: + email: "sample@example.com" + companyName: "Corp Sample 1-1" + name: + givenName: "Uday" + familyName: "Pandit" + address: + streetAddress: "C-92" + locality: "Pandav Nagar, New Delhi" + postalCode: "560048" + stateCode: "UP" + countryCode: "IN" + planInfo: + currencyCode: "INR" + nextBillingAt: 1637739295 + price: 2100 + planPeriod: "month" + subAccounts: 15 + features: + - name: "MULTI_USER" + unitValue: 1 + quantity: 10 + used: 15 + remaining: 0 + - name: "ADVANCED_REPORTING" + unitValue: 1 + quantity: 12 + used: 1 + remaining: 11 + - name: "INBOX" + unitValue: 1 + quantity: 10 + used: 10 + remaining: 0 + - name: "LANDING_PAGE" + unitValue: 5 + quantity: 10 + used: 11 + remaining: 0 + - name: "RECURRING_CREDITS" + unitValue: 1 + quantity: 500 + used: 1 + remaining: 499 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /corporate/subAccount/key: + post: + tags: + - Master account + summary: Create an API key for a sub-account + description: This endpoint will generate an API v3 key for a sub account + requestBody: + content: + application/json: + schema: + required: + - id + - name + type: object + properties: + id: + type: integer + format: int64 + description: Id of the sub-account organization + example: 3232323 + name: + type: string + description: Name of the API key + example: My Api Key + responses: + 201: + description: API key + content: + application/json: + schema: + $ref: '#/components/schemas/createApiKeyResponse' + examples: + response: + value: + status: "success" + key: "xkeysib-21881axxxxxcc92e04-mIrexxxx7z" + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: "invalid_parameter" + message: "id should be a positive number" + /corporate/subAccount/{id}/applications/toggle: + put: + tags: + - Master account + summary: Enable/disable sub-account application(s) + description: API endpoints for the Corporate owner to enable/disable applications on the sub-account + parameters: + - name: id + in: path + description: Id of the sub-account organization (mandatory) + required: true + schema: + type: integer + format: int64 + requestBody: + description: List of applications to activate or deactivate on a sub-account + content: + application/json: + schema: + $ref: '#/components/schemas/subAccountAppsToggleRequest' + required: true + responses: + 204: + description: Sub-account application(s) enabled/disabled + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 403: + description: Current account is not a master account + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + code: "permission_denied" + message: "Access forbidden." + /corporate/group: + post: + tags: + - Master account + summary: Create a group of sub-accounts + description: This endpoint allows to create a group of sub-accounts + requestBody: + content: + application/json: + schema: + required: + - groupName + type: object + properties: + groupName: + type: string + description: The name of the group of sub-accounts + example: My group + subAccountIds: + items: + type: integer + format: int64 + type: array + description: Pass the list of sub-account Ids to be included in the group + example: [ 234322, 325553, 893432 ] + + responses: + 201: + description: Group ID + content: + application/json: + schema: + type: object + properties: + id: + type: string + examples: + response: + value: + id: 659xxxxxxxxxxxxxxxx6ef9c8 + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: Invalid request + /corporate/group/{id}: + get: + tags: + - Master account + summary: GET a group details + description: This endpoint allows you to retrieve a specific group’s information such as the list of sub-organizations and the user associated with the group. + parameters: + - name: id + in: path + description: Id of the group of sub-organization + required: true + schema: + type: string + responses: + 200: + description: Group details + content: + application/json: + schema: + $ref: '#/components/schemas/corporateGroupDetailsResponse' + example: + group: + id: 5f926dba72a405440a4efc97 + groupName: My group + createdAt: "2024-02-09T06:14:40+00:00" + sub-accounts: + - id: 7866556 + companyName: My sub organization + createdAt: "2024-02-09T06:14:40+00:00" + - id: 6563051 + companyName: Your sub organization + createdAt: "2024-01-05T03:11:40+00:00" + users: + - email: my-user@my-org.com + lastName: Smith + firstName: John + - email: your-user@your-org.com + put: + tags: + - Master account + summary: Update a group of sub-accounts + description: This endpoint allows to update a group of sub-accounts + parameters: + - name: id + in: path + description: Id of the group + required: true + schema: + type: string + requestBody: + description: Group details to be updated. + content: + application/json: + schema: + type: object + properties: + groupName: + type: string + description: The name of the group of sub-accounts + example: My group + subAccountIds: + items: + type: integer + format: int64 + type: array + description: Pass the list of sub-account Ids to be included in the group + example: [ 234322, 325553, 893432 ] + required: true + responses: + 204: + description: Group details updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: Invalid request + delete: + tags: + - Master account + summary: Delete a group + description: This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted. + parameters: + - name: id + description: Id of the group + schema: + type: string + in: path + required: true + responses: + 204: + description: Group deleted + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: Invalid request + /corporate/group/unlink/{groupId}/subAccounts: + put: + tags: + - Master account + summary: Delete sub-account from group + description: This endpoint allows you to remove a sub-organization from a group. + parameters: + - name: groupId + in: path + description: Group id + required: true + schema: + type: string + requestBody: + required: true + description: List of sub-account ids + content: + application/json: + schema: + required: + - subAccountIds + type: object + properties: + subAccountIds: + type: array + description: List of sub-account ids + items: + type: integer + format: int64 + example: [ 423432, 234323, 87678 ] + responses: + 204: + description: SubAccounts removed from the group + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: subAccountIds should be array of numeric ids only + /corporate/user/invitation/send: + post: + tags: + - Master account + summary: Send invitation to an admin user + description: | + `This endpoint allows you to invite a member to manage the Admin account + + Features and their respective permissions are as below: + + - `my_plan`: + - "all" + - `api`: + - "none" + - `user_management`: + - "all" + - `app_management` | Not available in ENTv2: + - "all" + + **Note**: + - If `all_features_access: false` then only privileges are required otherwise if `true` then it's assumed that all permissions will be there for the invited admin user. + operationId: inviteAdminUser + requestBody: + description: Payload to send an invitation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/inviteAdminUser' + responses: + 201: + description: Invitation ID + content: + application/json: + schema: + type: object + properties: + id: + type: string + examples: + response: + value: + id: 659xxxxxxxxxxxxxxxx6ef9c8 + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /corporate/user/invitation/{action}/{email}: + put: + tags: + - Master account + summary: Resend / cancel admin user invitation + description: | + This endpoint will allow the user to: + - Resend an admin user invitation + - Cancel an admin user invitation + parameters: + - name: action + in: path + description: Action to be performed (cancel / resend) + required: true + schema: + type: string + enum: + - resend + - cancel + - name: email + in: path + description: Email address of the recipient + required: true + schema: + type: string + responses: + 200: + description: Response of the action performed + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: Action success message + example: + message: Invitation resent successfully + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: Invitation not found + /corporate/user/revoke/{email}: + delete: + tags: + - Master account + summary: Revoke an admin user + description: This endpoint allows to revoke/remove an invited member of your Admin account + parameters: + - name: email + description: Email of the invited user + schema: + type: string + in: path + required: true + responses: + 204: + description: User revoked + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + example: + code: invalid_parameter + message: Invalid request + /corporate/invited/users: + get: + tags: + - Master account + summary: Get the list of all admin users + description: This endpoint allows you to list all Admin users of your Admin account + operationId: getCorporateInvitedUsersList + responses: + 200: + description: list of all admin users + content: + application/json: + schema: + $ref: '#/components/schemas/getCorporateInvitedUsersList' + examples: + response: + value: + users: + - groups: + - id: 65b1f22c09d6ed67ef1cd123, + name: Test Group1 + - id: 43b1f16c09db4d67af1cd342, + name: Test Group2 + email: master-user2@company.com + is_owner: false + status: active + feature_access: + user_management: [ "none" ] + api_keys: [ "all" ] + my_plan: [ "all" ] + apps_management: [ "none" ] + - groups: [ ] + email: master-user3@company.com + is_owner: false + status: active + feature_access: + user_management: [ "all" ] + api_keys: [ "none" ] + my_plan: [ "none" ] + apps_management: [ "all" ] + /corporate/groups: + get: + tags: + - Master account + summary: Get the list of groups + description: This endpoint allows you to list all groups created on your Admin account. + operationId: getSubAccountGroups + responses: + 200: + description: list of all the sub-account groups + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + description: Unique id of the group + groupName: + type: string + description: The name of the group of sub-accounts + example: + - id: d3b142c709d6ed67ef1cd903 + groupName: My group 1 + - id: a5b192a709d6ed67ef8fd922 + groupName: My group 2 + - id: bbb142c709d6ed67ef1cd910 + groupName: My group 3 + /companies: + get: + tags: + - Companies + summary: Get all Companies + parameters: + - name: filters + in: query + schema: + type: string + description: Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"6299dcf3874a14eacbc65c46"} + - name: linkedContactsIds + in: query + schema: + type: integer + format: int64 + description: Filter by linked contacts ids + - name: linkedDealsIds + in: query + schema: + type: string + format: objectID + description: Filter by linked Deals ids + - name: page + in: query + schema: + type: integer + format: int64 + description: Index of the first document of the page + - name: limit + in: query + schema: + type: integer + format: int64 + description: Number of documents per page + - name: sort + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + - name: sortBy + in: query + schema: + type: string + description: The field used to sort field names. + responses: + 200: + description: Returns companies list with filters + content: + application/json: + schema: + $ref: '#/components/schemas/CompaniesList' + 400: + description: Returned when query params are invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + post: + tags: + - Companies + summary: Create a company + requestBody: + required: true + description: Company create data. + content: + application/json: + schema: + required: + - name + properties: + name: + type: string + description: Name of company + example: "company" + attributes: + type: object + description: Attributes for company creation + example: { + "domain": "https://example.com", + "industry": "Fabric", + "owner": "60e68d60582a3b006f524197" + } + countryCode: + type: integer + format: int64 + description: Country code if phone_number is passed in attributes. + example: 91 + type: object + responses: + 200: + description: Created new Company + content: + application/json: + schema: + required: + - id + type: object + description: Created company id + properties: + id: + type: string + description: Unique company id + example: "61a5cd07ca1347c82306ad06" + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + /companies/{id}: + get: + tags: + - Companies + summary: Get a company + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Get Company Details + responses: + 200: + description: Returns the Company + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route company id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + delete: + tags: + - Companies + summary: Delete a company + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Company ID to delete + responses: + 204: + description: When company deleted + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route company id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + patch: + tags: + - Companies + summary: Update a company + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + required: true + description: Updated company details. + content: + application/json: + schema: + properties: + name: + type: string + description: Name of company + example: "company" + attributes: + type: object + description: Attributes for company update + example: { + "category": "label_2", + "domain": "xyz", + "date": "2022-05-04T00:00:00+05:30", + "industry": "flipkart", + "number_of_contacts": 1, + "number_of_employees": 100, + "owner": "5b1a17d914b73d35a76ca0c7", + "phone_number": "81718441912", + "revenue": 10000.34222 + } + countryCode: + type: integer + format: int64 + description: Country code if phone_number is passed in attributes. + example: 91 + type: object + responses: + 200: + description: Company updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when company id is not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /companies/attributes: + get: + tags: + - Companies + summary: Get company attributes + responses: + 200: + description: Returns list of company attributes + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyAttributes' + /companies/link-unlink/{id}: + patch: + tags: + - Companies + summary: Link and Unlink company with contact and deal + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + required: true + description: Linked / Unlinked contacts and deals ids. + content: + application/json: + schema: + properties: + linkContactIds: + items: + type: integer + format: int64 + type: array + description: Contact ids for contacts to be linked with company + example: [ 1, 2, 3 ] + unlinkContactIds: + items: + type: integer + format: int64 + type: array + description: Contact ids for contacts to be unlinked from company + example: [ 4, 5, 6 ] + linkDealsIds: + items: + type: string + type: array + description: Deal ids for deals to be linked with company + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + unlinkDealsIds: + items: + type: string + type: array + description: Deal ids for deals to be unlinked from company + example: [ "61a5ce58c5d4795761045994", "61a5ce58c5d479576104595" , "61a5ce58c5d4795761045996" ] + type: object + responses: + 204: + description: Successfully linked/unlinked contacts/deals with the company. + 400: + description: Returned when query params are invalid or invalid data provided in request. + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + /crm/pipeline/details: + get: + tags: + - Deals + summary: Get pipeline stages + description: This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. + deprecated: true + responses: + 200: + description: Returns list of pipeline stages + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + /crm/pipeline/details/{pipelineID}: + get: + tags: + - Deals + summary: Get a pipeline + parameters: + - name: pipelineID + in: path + required: true + schema: + type: string + responses: + 200: + description: Returns pipeline and its details + content: + application/json: + schema: + $ref: '#/components/schemas/Pipelines' + 400: + description: Returned when pipeline id is invalid or does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + Pipeline Not Exist: + value: + "message": "Pipeline not found" + /crm/pipeline/details/all: + get: + tags: + - Deals + summary: Get all pipelines + responses: + 200: + description: Returns list of pipeline and its details + content: + application/json: + schema: + $ref: '#/components/schemas/Pipelines' + 400: + description: Returned when pipeline id is invalid or does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + Pipeline Not Exist: + value: + "message": "Pipeline not found" + /crm/attributes/deals: + get: + tags: + - Deals + summary: Get deal attributes + responses: + 200: + description: Returns list of deal attributes + content: + application/json: + schema: + $ref: '#/components/schemas/DealAttributes' + /crm/deals: + get: + tags: + - Deals + summary: Get all deals + parameters: + - name: filters[attributes.deal_name] + in: query + schema: + type: string + description: Filter by attributes. If you have filter for owner on your side please send it as `filters[attributes.deal_owner]`. + - name: filters[linkedCompaniesIds] + in: query + schema: + type: string + description: Filter by linked companies ids + - name: filters[linkedContactsIds] + in: query + schema: + type: string + description: Filter by linked companies ids + - name: offset + in: query + schema: + type: integer + format: int64 + description: Index of the first document of the page + - name: limit + in: query + schema: + type: integer + format: int64 + description: Number of documents per page + - name: sort + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + responses: + 200: + description: Returns deals list with filters + content: + application/json: + schema: + $ref: '#/components/schemas/DealsList' + 400: + description: Returned when query params are invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + post: + tags: + - Deals + summary: Create a deal + requestBody: + required: true + description: Deal create data. + content: + application/json: + schema: + required: + - name + properties: + name: + type: string + description: Name of deal + example: "Deal: Connect with company" + attributes: + type: object + description: | + Attributes for deal creation + + If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. + + Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` + example: { + deal_owner: "6093d2425a9b436e9519d034", + amount: 12 + } + type: object + responses: + 201: + description: Created new Deal + content: + application/json: + schema: + required: + - id + type: object + description: Created deal id + properties: + id: + type: string + description: Unique deal id + example: "61a5cd07ca1347c82306ad06" + 400: + description: Returned when invalid data posted + /crm/deals/{id}: + get: + tags: + - Deals + summary: Get a deal + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + 200: + description: Returns the deal by id + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + 400: + description: Returned when task id is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + delete: + tags: + - Deals + summary: Delete a deal + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + 204: + description: Returned when item deleted + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when deal id is not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + patch: + tags: + - Deals + summary: Update a deal + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + required: true + description: Updated deal details. + content: + application/json: + schema: + properties: + name: + type: string + description: Name of deal + example: "Deal: Connect with client" + attributes: + type: object + description: | + Attributes for deal update + + If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage` + + Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` + example: { + deal_owner: "6093d2425a9b436e9519d034", + amount: 12 + } + type: object + responses: + 204: + description: Deal updated successfully + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when deal id is not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /crm/deals/link-unlink/{id}: + patch: + tags: + - Deals + summary: Link and Unlink a deal with contacts and companies + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + required: true + description: Linked / Unlinked contacts and companies ids. + content: + application/json: + schema: + properties: + linkContactIds: + items: + type: integer + format: int64 + type: array + description: Contact ids for contacts to be linked with deal + example: [ 1, 2, 3 ] + unlinkContactIds: + items: + type: integer + format: int64 + type: array + description: Contact ids for contacts to be unlinked from deal + example: [ 4, 5, 6 ] + linkCompanyIds: + items: + type: string + type: array + description: Company ids to be linked with deal + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + unlinkCompanyIds: + items: + type: string + type: array + description: Company ids to be unlinked from deal + example: [ "61a5ce58c5d4795761045994", "61a5ce58c5d479576104595" , "61a5ce58c5d4795761045996" ] + type: object + responses: + 204: + description: Successfully linked/unlinked contacts/companies with the deal. + 400: + description: Returned when query params are invalid or invalid data provided in request. + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + /crm/tasktypes: + get: + tags: + - Tasks + summary: Get all task types + responses: + 200: + description: Returns all the Task types + content: + application/json: + schema: + $ref: '#/components/schemas/TaskTypes' + /crm/tasks: + get: + tags: + - Tasks + summary: Get all tasks + parameters: + - name: filter[type] + in: query + schema: + type: string + description: Filter by task type (ID) + - name: filter[status] + in: query + schema: + type: string + enum: + - done + - undone + description: Filter by task status + - name: filter[date] + in: query + schema: + type: string + enum: + - overdue + - today + - tomorrow + - week + - range + description: Filter by date + - name: filter[assignTo] + in: query + schema: + type: string + description: Filter by assignTo id + - name: filter[contacts] + in: query + schema: + type: string + description: Filter by contact ids + - name: filter[deals] + in: query + schema: + type: string + description: Filter by deals ids + - name: filter[companies] + in: query + schema: + type: string + description: Filter by companies ids + - name: dateFrom + in: query + schema: + type: integer + description: dateFrom to date range filter type (timestamp in milliseconds) + - name: dateTo + in: query + schema: + type: integer + description: dateTo to date range filter type (timestamp in milliseconds) + - name: offset + in: query + schema: + type: integer + format: int64 + description: Index of the first document of the page + - name: limit + in: query + schema: + type: integer + default: 50 + format: int64 + description: Number of documents per page + - name: sort + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + - name: sortBy + in: query + schema: + type: string + description: The field used to sort field names. + example: name + responses: + 200: + description: Returns task list with filters + content: + application/json: + schema: + $ref: '#/components/schemas/TaskList' + 400: + description: Returned when query params are invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + post: + tags: + - Tasks + summary: Create a task + requestBody: + required: true + description: Task name. + content: + application/json: + schema: + required: + - name + - taskTypeId + - date + properties: + name: + type: string + description: Name of task + example: "Task: Connect with client" + duration: + type: integer + description: Duration of task in milliseconds [1 minute = 60000 ms] + example: 600000 + format: int64 + minimum: 0 + taskTypeId: + type: string + description: Id for type of task e.g Call / Email / Meeting etc. + example: "61a5cd07ca1347c82306ad09" + date: + type: string + format: date-time + example: "2021-11-01T17:44:54.668Z" + description: Task due date and time + notes: + type: string + description: Notes added to a task + example: "In communication with client for resolution of queries." + done: + type: boolean + description: Task marked as done + example: false + assignToId: + type: string + description: User id to whom task is assigned + example: "5faab4b7f195bb3c4c31e62a" + contactsIds: + items: + type: integer + type: array + description: Contact ids for contacts linked to this task + example: [ 1, 2, 3 ] + dealsIds: + items: + type: string + type: array + description: Deal ids for deals a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + companiesIds: + items: + type: string + type: array + description: Companies ids for companies a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + reminder: + $ref: '#/components/schemas/TaskReminder' + type: object + responses: + 201: + description: Created new task + content: + application/json: + schema: + required: + - id + type: object + description: Task Details + properties: + id: + type: string + description: Unique task id + example: "61a5cd07ca1347c82306ad06" + 400: + description: Returned when invalid data posted + /crm/tasks/{id}: + get: + tags: + - Tasks + summary: Get a task + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + 200: + description: Returns the Task by id + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + 400: + description: Returned when task id is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + delete: + tags: + - Tasks + summary: Delete a task + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + 204: + description: Returned when item deleted + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when task id is not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + patch: + tags: + - Tasks + summary: Update a task + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + required: true + description: Updated task details. + content: + application/json: + schema: + properties: + name: + type: string + description: Name of task + example: "Task: Connect with client" + duration: + type: integer + description: Duration of task in milliseconds [1 minute = 60000 ms] + format: int64 + example: 600000 + taskTypeId: + type: string + description: Id for type of task e.g Call / Email / Meeting etc. + example: "61a5cd07ca1347c82306ad09" + date: + type: string + format: date-time + example: "2021-11-01T17:44:54.668Z" + description: Task date/time + notes: + type: string + description: Notes added to a task + example: "In communication with client for resolution of queries." + done: + type: boolean + description: Task marked as done + example: false + assignToId: + type: string + description: User id to whom task is assigned + example: "5faab4b7f195bb3c4c31e62a" + contactsIds: + items: + type: integer + type: array + description: Contact ids for contacts linked to this task + example: [ 1, 2, 3 ] + dealsIds: + items: + type: string + type: array + description: Deal ids for deals a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + companiesIds: + items: + type: string + type: array + description: Companies ids for companies a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + reminder: + $ref: "#/components/schemas/TaskReminder" + type: object + responses: + 204: + description: Task updated succussfully + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when task id is not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /crm/notes: + get: + tags: + - Notes + summary: Get all notes + parameters: + - name: entity + in: query + schema: + type: string + enum: + - companies + - deals + - contacts + description: Filter by note entity type + - name: entityIds + in: query + schema: + type: string + description: Filter by note entity IDs + - name: dateFrom + in: query + schema: + type: integer + description: dateFrom to date range filter type (timestamp in milliseconds) + - name: dateTo + in: query + schema: + type: integer + description: dateTo to date range filter type (timestamp in milliseconds) + - name: offset + in: query + schema: + type: integer + format: int64 + description: Index of the first document of the page + - name: limit + in: query + schema: + type: integer + default: 50 + format: int64 + description: Number of documents per page + - name: sort + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + responses: + 200: + description: Returns notes list with filters + content: + application/json: + schema: + $ref: '#/components/schemas/NoteList' + 400: + description: Returned when query params are invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + post: + tags: + - Notes + summary: Create a note + requestBody: + required: true + description: Note data to create a note. + content: + application/json: + schema: + $ref: "#/components/schemas/NoteData" + responses: + 200: + description: Created new note + content: + application/json: + schema: + $ref: '#/components/schemas/NoteId' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + 415: + description: Format is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "The format not supported for deserialization." + /crm/notes/{id}: + get: + tags: + - Notes + summary: Get a note + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Note ID to get + responses: + 200: + description: Returns the Note by id + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + patch: + tags: + - Notes + summary: Update a note + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Note ID to update + requestBody: + required: true + description: Note data to update a note. + content: + application/json: + schema: + $ref: "#/components/schemas/NoteData" + responses: + 204: + description: Note updated successfully + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + 415: + description: Format is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "The format not supported for deserialization." + delete: + tags: + - Notes + summary: Delete a note + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Note ID to delete + responses: + 204: + description: Returned when item deleted + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid." + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /crm/files: + get: + tags: + - Files + summary: Get all files + parameters: + - name: entity + in: query + schema: + type: string + enum: + - companies + - deals + - contacts + description: Filter by file entity type + required: false + - name: entityIds + in: query + schema: + type: string + description: Filter by file entity IDs + required: false + - name: dateFrom + in: query + schema: + type: integer + description: dateFrom to date range filter type (timestamp in milliseconds) + required: false + - name: dateTo + in: query + schema: + type: integer + description: dateTo to date range filter type (timestamp in milliseconds) + required: false + - name: offset + in: query + schema: + type: integer + format: int64 + description: Index of the first document of the page + required: false + - name: limit + in: query + schema: + type: integer + format: int64 + default: 50 + description: Number of documents per page + required: false + - name: sort + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + required: false + responses: + 200: + description: Returns files list with filters + content: + application/json: + schema: + $ref: '#/components/schemas/FileList' + 400: + description: Returned when query params are invalid + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Not valid data." + post: + tags: + - Files + summary: Upload a file + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: File data to create a file. + dealId: + type: string + contactId: + type: integer + format: int64 + companyId: + type: string + required: + - file + responses: + 201: + description: Returns the created File with additional details + content: + application/json: + schema: + $ref: '#/components/schemas/FileData' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Invalid deals ids format." + /crm/files/{id}: + get: + tags: + - Files + summary: Download a file + parameters: + - in: path + name: id + required: true + schema: + type: string + description: File id to download. + responses: + 200: + description: Returns downloadable file link. Valid for next 5 minutes only. + content: + application/json: + schema: + $ref: '#/components/schemas/FileDownloadableLink' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid" + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + delete: + tags: + - Files + summary: Delete a file + parameters: + - in: path + name: id + required: true + schema: + type: string + description: File id to delete. + responses: + 204: + description: Returned when file is deleted. + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid" + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /crm/files/{id}/data: + get: + tags: + - Files + summary: Get file details + parameters: + - in: path + name: id + required: true + schema: + type: string + description: File id to get file data. + responses: + 200: + description: Returned when file is found. + content: + application/json: + schema: + $ref: '#/components/schemas/FileData' + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Route attribute id is not valid" + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + examples: + response: + value: + "message": "Document not found" + /conversations/messages: + post: + tags: + - Conversations + summary: Send a message as an agent + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - visitorId + - text + properties: + visitorId: + description: visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations + text: + description: message text + agentId: + description: agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + receivedFrom: + description: mark your messages to distinguish messages created by you from the others. + agentEmail: + description: agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. + agentName: + description: agent name + examples: + Basic use: + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: Hello! How can I help you? + agentId: d9nKoegKSjmCtyK78 + receivedFrom: + description: When you receive a webhook, you might want to distinguish messages created by you from the others. Use receivedFrom property to mark your messages + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: Hello! How can I help you? + agentId: d9nKoegKSjmCtyK78 + receivedFrom: SuperAwesomeHelpdesk + agentEmail + agentName + receivedFrom: + description: When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: Hello! How can I help you? + agentEmail: liz@getwear.com + agentName: Liz + receivedFrom: SuperAwesomeHelpdesk + responses: + 200: + description: Newly created message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + response: + value: + id: eYBEm3gq3zc5ayE2g + type: agent + text: Hello! How can I help you? + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1482512803740 + receivedFrom: SuperAwesomeHelpdesk + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /conversations/messages/{id}: + get: + tags: + - Conversations + summary: Get a message + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message + responses: + 200: + description: Requested message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + requested message: + value: + id: eYBEm3gq3zc5ayE2g + type: agent + text: Hello! How can I help you? + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1482512803740 + receivedFrom: SuperAwesomeHelpdesk + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Conversations + summary: Update a message sent by an agent + description: Only agents’ messages can be edited. + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - text + properties: + text: + type: string + description: edited message text + examples: + edition: + value: + text: Good morning! How can I help you? + responses: + 200: + description: Updated message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + edited message: + value: + id: eYBEm3gq3zc5ayE2g + type: agent + text: Hello! How can I help you? + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1482512803740 + receivedFrom: SuperAwesomeHelpdesk + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Conversations + summary: Delete a message sent by an agent + description: Only agents’ messages can be deleted. + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message + responses: + 204: + description: The message was deleted from the conversation + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /conversations/pushedMessages: + post: + tags: + - Conversations + summary: Send an automated message to a visitor + description: "Example of automated messages: order status, announce new features in your web app, etc." + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - visitorId + - text + properties: + visitorId: + description: visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations + text: + description: message text + agentId: + description: agent ID. It can be found on agent’s page or received from a webhook. + groupId: + description: group ID. It can be found on group’s page. + examples: + Random agent: + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88" + Agent group: + description: "Send a message on behalf of a random agent from one of your agent groups" + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88" + groupId: PjRBMhWGen6aRHjif + Specific agent: + description: Send a message on behalf of a specific agent + value: + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88" + agentId: d9nKoegKSjmCtyK78 + responses: + 200: + description: Newly created message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + response: + value: + id: AXCR3k9bpSY7bpuh7 + type: agent + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88" + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1470222622433 + isPushed: true + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /conversations/pushedMessages/{id}: + get: + tags: + - Conversations + summary: Get an automated message + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message sent previously + responses: + 200: + description: Requested message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + requested message: + value: + id: AXCR3k9bpSY7bpuh7 + type: agent + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88" + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1470222622433 + isPushed: true + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - Conversations + summary: Update an automated message + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - text + properties: + text: + type: string + description: edited message text + examples: + edition: + value: + text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54" + responses: + 200: + description: Updated message is returned as a response + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationsMessage' + examples: + updated message: + value: + id: AXCR3k9bpSY7bpuh7 + type: agent + text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54" + visitorId: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: d9nKoegKSjmCtyK78 + createdAt: 1470222622433 + isPushed: true + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - Conversations + summary: Delete an automated message + parameters: + - in: path + name: id + schema: + type: string + required: true + description: ID of the message + responses: + 204: + description: The message was deleted from the conversation + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Returned when item not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /conversations/agentOnlinePing: + post: + tags: + - Conversations + summary: Sets agent’s status to online for 2-3 minutes + description: We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + agentId: + description: agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + receivedFrom: + description: mark your messages to distinguish messages created by you from the others. + agentEmail: + description: agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. + agentName: + description: agent name + examples: + Basic use: + value: + agentId: d9nKoegKSjmCtyK78 + agentEmail + agentName + receivedFrom: + value: + agentEmail: liz@getwear.com + agentName: Liz + receivedFrom: SuperAwesomeHelpdesk + responses: + 201: + description: Status of the agent was set successfully. Response body will be empty. + 400: + description: Returned when invalid data posted + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /ecommerce/activate: + post: + tags: + - Ecommerce + summary: "Activate the eCommerce app" + description: "Getting access to Brevo eCommerce." + responses: + 200: + description: 'eCommerce activation is in process, please wait for 5 minutes.' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: api-key not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /orders: + get: + tags: + - Ecommerce + summary: Get order details + description: Get all the orders + operationId: getOrders + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: modifiedSince + in: query + description: | + Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: createdSince + in: query + description: | + Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + responses: + 200: + description: orders fetched successfully + content: + application/json: + examples: + response: + value: + orders: + - id: order1803 + createdAt: 2021-12-31T11:42:35.638Z + updatedAt: 2022-03-03T14:48:31.867Z + contact_id: 2 + status: complete + amount: 2000 + billing: + address: Sec 62, Noida + city: Noida + countryCode: IN + phone: 9238283982 + postCode: 110001 + paymentMethod: Net banking + region: North India + products: + - productId: 21 + quantity: 2 + variantId: P100 + price: 100 + - productId: 21 + quantity: 2 + variantId: P15756 + price: 100 + email: testvisitor@sendinblue.com + coupons: [ + "flat50", + "flat40" + ] + count: 1 + + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /orders/status: + post: + tags: + - Ecommerce + summary: Managing the status of the order + description: Manages the transactional status of the order + operationId: createOrder + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/order' + responses: + 204: + description: Order Event posted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /orders/status/batch: + post: + tags: + - Ecommerce + summary: Create orders in batch + description: Create multiple orders at one time instead of one order at a time + operationId: createBatchOrder + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/orderBatch' + responses: + 202: + $ref: '#/components/responses/createdBatchId' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /categories: + get: + tags: + - Ecommerce + summary: Return all your categories + operationId: getCategories + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 100 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: ids + in: query + schema: + type: array + items: + type: string + description: Filter by category ids + - name: name + in: query + schema: + type: string + description: Filter by category name + - name: modifiedSince + in: query + description: | + Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: createdSince + in: query + description: | + Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + + responses: + 200: + description: All categories listed + content: + application/json: + schema: + $ref: '#/components/schemas/getCategories' + examples: + response: + value: + categories: + - id: 19 + name: Food + url: http://mydomain.com/category/food + modifiedAt: 2022-03-03T14:48:31.867Z + createdAt: 2021-12-31T11:42:35.638Z + - id: 20 + name: clothing + url: http://mydomain.com/category/clothing + modifiedAt: 2022-03-03T14:48:31.867Z + createdAt: 2021-12-31T11:42:35.638Z + isDeleted: true + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Ecommerce + summary: Create/Update a category + operationId: createUpdateCategory + requestBody: + description: Values to create/update a category + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateCategory' + required: true + responses: + 201: + description: Category created + content: + application/json: + schema: + $ref: '#/components/schemas/createCategoryModel' + examples: + response: + value: + id: 21 + 204: + description: Category updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /categories/{id}: + get: + tags: + - Ecommerce + summary: Get a category details + operationId: getCategoryInfo + parameters: + - name: id + in: path + description: Category ID + required: true + schema: + type: string + responses: + 200: + description: Category informations + content: + application/json: + schema: + $ref: '#/components/schemas/getCategoryDetails' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Category id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /categories/batch: + post: + tags: + - Ecommerce + summary: Create categories in batch + operationId: createUpdateBatchCategory + requestBody: + description: Values to create a batch of categories + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateBatchCategory' + required: true + responses: + 201: + description: Category created and updated + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateBatchCategoryModel' + examples: + response: + value: + createdCount: 2 + updatedCount: 7 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /products: + get: + tags: + - Ecommerce + summary: Return all your products + operationId: getProducts + parameters: + - name: limit + in: query + description: Number of documents per page + schema: + maximum: 1000 + type: integer + format: int64 + default: 50 + - name: offset + in: query + description: Index of the first document in the page + schema: + type: integer + format: int64 + default: 0 + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: ids + in: query + schema: + type: array + items: + type: string + description: Filter by product ids + - name: name + in: query + schema: + type: string + description: Filter by product name, minimum 3 characters should be present for search + - name: price[lte] + in: query + schema: + type: number + description: Price filter for products less than and equals to particular amount + - name: price[gte] + in: query + schema: + type: number + description: Price filter for products greater than and equals to particular amount + - name: price[lt] + in: query + schema: + type: number + description: Price filter for products less than particular amount + - name: price[gt] + in: query + schema: + type: number + description: Price filter for products greater than particular amount + - name: price[eq] + in: query + schema: + type: number + description: Price filter for products equals to particular amount + - name: price[ne] + in: query + schema: + type: number + description: Price filter for products not equals to particular amount + - name: categories + in: query + schema: + type: array + items: + type: string + description: Filter by product categories + - name: modifiedSince + in: query + description: | + Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + - name: createdSince + in: query + description: | + Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + schema: + type: string + responses: + 200: + description: All products listed + content: + application/json: + schema: + $ref: '#/components/schemas/getProducts' + examples: + response: + value: + products: + - id: 7498033266862 + name: Alpina Panoma Classic + url: https://mydomain.com/products/alpina-panoma-classic + sku: 186622-9 + imageUrl: http://mydomain.com/product-absoulte-url/img.jpeg + categories: [ + "279638835374", + "279502848174", + ] + price: 49.95 + modifiedAt: 2022-06-30T10:29:16.078Z + createdAt: 2022-06-30T10:29:16.078Z + s3Original: https://img-ecom.mailinblue.com/path-to-original/img.jpg + s3ThumbAnalytics: https://img-ecom.mailinblue.com/path-to-analytics/img.jpg + s3ThumbEditor: https://img-ecom.mailinblue.com/path-to-editor/img.jpg + - id: 7498033266862 + name: Alpina Panoma Classic2 + url: https://mydomain.com/products/alpina-panoma-classic2 + sku: 186622-9 + imageUrl: http://mydomain.com/product-absoulte-url/img.jpeg + categories: [ + "2d79638835374", + "27d9502848174", + ] + price: 49.95 + metaInfo: { + description: "Shoes for sports", + brand: "addidas", + } + modifiedAt: 2022-06-30T10:29:16.078Z + createdAt: 2022-06-30T10:29:16.078Z + s3Original: https://img-ecom.mailinblue.com/path-to-original/img.jpg + s3ThumbAnalytics: https://img-ecom.mailinblue.com/path-to-analytics/img.jpg + s3ThumbEditor: https://img-ecom.mailinblue.com/path-to-editor/img.jpg + isDeleted: true + count: 2 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Ecommerce + summary: Create/Update a product + operationId: createUpdateProduct + requestBody: + description: Values to create/update a product + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateProduct' + required: true + responses: + 201: + description: Product created + content: + application/json: + schema: + $ref: '#/components/schemas/createProductModel' + examples: + response: + value: + id: 21 + 204: + description: Product updated + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /products/{id}: + get: + tags: + - Ecommerce + summary: Get a product's details + operationId: getProductInfo + parameters: + - name: id + in: path + description: Product ID + required: true + schema: + type: string + responses: + 200: + description: Product informations + content: + application/json: + schema: + $ref: '#/components/schemas/getProductDetails' + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Product's id not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /products/batch: + post: + tags: + - Ecommerce + summary: Create products in batch + operationId: createUpdateBatchProducts + requestBody: + description: Values to create a batch of products + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateBatchProducts' + required: true + responses: + 201: + description: Products created and updated + content: + application/json: + schema: + $ref: '#/components/schemas/createUpdateBatchProductsModel' + examples: + response: + value: + createdCount: 2 + updatedCount: 7 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /couponCollections: + get: + tags: + - Coupons + summary: Get all your coupon collections + operationId: getCouponCollections + parameters: + - name: limit + in: query + description: Number of documents returned per page + schema: + type: integer + format: int64 + default: 50 + minimum: 0 + maximum: 100 + - name: offset + in: query + description: Index of the first document on the page + schema: + type: integer + format: int64 + default: 0 + minimum: 0 + - name: sort + in: query + description: Sort the results by creation time in ascending/descending order + schema: + type: string + enum: + - asc + - desc + default: desc + responses: + 200: + description: Coupon collections + content: + application/json: + schema: + $ref: '#/components/schemas/getCouponCollection' + examples: + response: + value: + collections: + - id: 23befbae-1505-47a8-bd27-e30ef739f32c + name: Summer + defaultCoupon: 10 OFF + createdAt: 2017-03-12T12:30:00Z + totalCoupons: 10000 + remainingCoupons: 5000 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - Coupons + summary: Create а coupon collection + operationId: createCouponCollection + requestBody: + description: Values to create a coupon collection + required: true + content: + application/json: + schema: + required: + - name + - defaultCoupon + type: object + properties: + name: + type: string + description: Name of the collection with no white spaces between words + example: SummerPromotions + defaultCoupon: + type: string + description: A default coupon to be used in case there are no coupons left + example: 10 OFF + responses: + 201: + description: Coupon collection created + content: + application/json: + schema: + required: + - id + type: object + properties: + id: + type: string + description: The id of the created collection + format: uuidv4 + example: 23befbae-1505-47a8-bd27-e30ef739f32c + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /couponCollections/{id}: + get: + tags: + - Coupons + summary: Get a coupon collection by id + operationId: getCouponCollection + parameters: + - name: id + in: path + description: Id of the collection to return + required: true + schema: + type: string + format: uuidv4 + responses: + 200: + description: Coupon collection + content: + application/json: + schema: + $ref: '#/components/schemas/getCouponCollection' + examples: + response: + value: + - id: 23befbae-1505-47a8-bd27-e30ef739f32c + name: Summer + defaultCoupon: 10 OFF + createdAt: 2017-03-12T12:30:00Z + totalCoupons: 10000 + remainingCoupons: 5000 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Coupon collection not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + patch: + tags: + - Coupons + summary: Update a coupon collection by id + operationId: updateCouponCollection + parameters: + - name: id + in: path + description: Id of the collection to update + required: true + schema: + type: string + format: uuidv4 + requestBody: + description: Values to update the coupon collection + required: true + content: + application/json: + schema: + required: + - defaultCoupon + type: object + properties: + defaultCoupon: + type: string + description: A default coupon to be used in case there are no coupons left + example: 10 OFF + responses: + 200: + description: Coupon collection updated + content: + application/json: + schema: + required: + - id + - name + - defaultCoupon + type: object + properties: + id: + type: string + description: The id of the collection + format: uuidv4 + example: 23befbae-1505-47a8-bd27-e30ef739f32c + name: + type: string + description: The name of the collection + format: uuidv4 + example: SummerPromotions + defaultCoupon: + type: string + description: The default coupon of the collection + example: 10 OFF + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /coupons: + post: + tags: + - Coupons + summary: Create coupons for a coupon collection + operationId: createCoupons + requestBody: + description: Values to create coupons + required: true + content: + application/json: + schema: + required: + - collectionId + - coupons + type: object + properties: + collectionId: + type: string + description: The id of the coupon collection for which the coupons will be created + format: uuidv4 + example: 23befbae-1505-47a8-bd27-e30ef739f32c + coupons: + type: array + minItems: 1 + maxItems: 1000 + uniqueItems: true + items: + type: string + description: Name of the coupon + example: Uf12AF + responses: + 204: + description: Coupons creation in progress + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 401: + description: unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Coupon collection not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /whatsapp/sendMessage: + post: + tags: + - Transactional WhatsApp + summary: Send a WhatsApp message + description: This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) + operationId: sendWhatsappMessage + requestBody: + description: Values to send WhatsApp message + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/sendWhatsappMessageTemplate' + - $ref: '#/components/schemas/sendWhatsappMessageText' + required: true + responses: + 201: + description: successfully created + content: + application/json: + schema: + required: + - messageId + type: object + properties: + messageId: + type: string + description: messageId of sent message + format: uuidv4 + example: "23befbae-1505-47a8-bd27-e30ef739f32c" + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /whatsapp/statistics/events: + get: + tags: + - Transactional WhatsApp + summary: Get all your WhatsApp activity (unaggregated events) + description: This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) + operationId: getWhatsappEventReport + parameters: + - name: limit + in: query + description: Number limitation for the result returned + schema: + maximum: 5000 + type: integer + format: int64 + default: 2500 + minimum: 0 + - name: offset + in: query + description: Beginning point in the list to retrieve from + schema: + type: integer + format: int64 + default: 0 + - name: startDate + in: query + description: | + **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate + schema: + type: string + - name: endDate + in: query + description: | + **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + schema: + type: string + - name: days + in: query + description: | + Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + schema: + type: integer + format: int64 + - name: contactNumber + in: query + description: Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) + schema: + type: string + format: mobile + - name: event + in: query + description: Filter the report for a specific event type + schema: + type: string + enum: + - sent + - delivered + - read + - error + - unsubscribe + - reply + - soft-bounce + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + responses: + 200: + description: WhatsApp events report + content: + application/json: + schema: + $ref: '#/components/schemas/getWhatsappEventReport' + examples: + response: + value: + events: + - contactNumber: 919876543211 + date: 2017-03-12T12:30:00Z + messageId: 23befbae-1505-47a8-bd27-e30ef739f32c + event: sent + senderNumber: 919876543210 + - contactNumber: 919876543211 + date: 2017-03-12T12:30:00Z + messageId: 23befbae-1505-47a8-bd27-e30ef739f32c + event: "error" + reason: "error reason" + senderNumber: 919876543210 + - contactNumber: 919876543211 + date: 2017-03-12T12:30:00Z + messageId: 23befbae-1505-47a8-bd27-e30ef739f32c + event: "soft-bounce" + reason: "invalid whatsapp contact" + senderNumber: 919876543210 + - contactNumber: 919876543211 + date: 2017-03-12T12:30:00Z + messageId: 23befbae-1505-47a8-bd27-e30ef739f32c + event: "reply" + body: "body only in case of text reply & url will be empty" + mediaUrl: "media url only in case media reply & body will be empty" + senderNumber: 919876543210 + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + + /feeds: + get: + tags: + - External Feeds + summary: Fetch all external feeds + description: This endpoint can fetch all created external feeds. + operationId: getAllExternalFeeds + parameters: + - name: search + description: Can be used to filter records by search keyword on feed name + in: query + example: 'search' + required: false + schema: + type: string + - name: startDate + description: Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. + in: query + example: '2022-09-04' + required: false + schema: + type: string + format: date + - name: endDate + description: Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + in: query + example: '2022-10-01' + required: false + schema: + type: string + format: date + - name: sort + in: query + description: Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. + required: false + schema: + type: string + default: desc + enum: + - asc + - desc + - name: authType + in: query + description: Filter the records by `authType` of the feed. + required: false + schema: + type: string + enum: + - basic + - token + - noAuth + - name: limit + description: Number of documents returned per page. + in: query + required: false + example: 100 + schema: + type: integer + format: int64 + default: 50 + maximum: 500 + minimum: 0 + - name: offset + description: Index of the first document on the page. + in: query + required: false + example: 0 + schema: + type: integer + format: int64 + default: 0 + responses: + 200: + description: External feeds + content: + application/json: + schema: + $ref: '#/components/schemas/getAllExternalFeeds' + example: + { + "count": 3, + "feeds": [ + { + "id": "d955aaa4-f4d6-4557-aa14-24286542ed8d", + "name": "api feed token", + "url": "https://abc.com/", + "authType": "token", + "token": "jfhdkjdfhjkfdhjkdfhjkdfhkj", + "headers": [ + { + "name": "key", + "value": "val" + } + ], + "maxRetries": 4, + "cache": true, + "createdAt": "2022-10-06T05:03:47.053000000Z", + "modifiedAt": "2022-10-06T05:03:47.053000000Z" + }, + { + "id": "311a71ac-bebc-42cf-963d-d8666dfe53e9", + "name": "api feed basic", + "url": "https://abc.com/", + "authType": "basic", + "username": "user", + "password": "pass", + "headers": null, + "maxRetries": 2, + "cache": false, + "createdAt": "2022-10-06T04:48:19.767000000Z", + "modifiedAt": "2022-10-06T04:48:19.767000000Z" + } + ] + } + 400: + description: Invalid parameters passed + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Record not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + post: + tags: + - External Feeds + summary: Create an external feed + description: This endpoint will create an external feed. + operationId: createExternalFeed + requestBody: + description: Values to create a feed + content: + application/json: + schema: + $ref: '#/components/schemas/createExternalFeed' + required: true + responses: + 201: + description: successfully created + content: + application/json: + schema: + required: + - id + type: object + properties: + id: + type: string + description: ID of the object created + format: uuidv4 + example: "23befbae-1505-47a8-bd27-e30ef739f32c" + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + /feeds/{uuid}: + get: + tags: + - External Feeds + summary: Get an external feed by UUID + description: This endpoint will update an external feed. + operationId: getExternalFeedByUUID + parameters: + - name: uuid + description: UUID of the feed to fetch + example: 38f351fb-6e77-4b38-979a-a2465260449e + in: path + required: true + schema: + type: string + responses: + 200: + description: External feed + content: + application/json: + schema: + $ref: '#/components/schemas/getExternalFeedByUUID' + example: + { + "id": "d955aaa4-f4d6-4557-aa14-24286542ed8d", + "name": "api feed token", + "url": "https://abc.com/", + "authType": "token", + "token": "jfhdkjdfhjkfdhjkdfhjkdfhkj", + "headers": [ + { + "name": "key", + "value": "val" + } + ], + "maxRetries": 4, + "cache": true, + "createdAt": "2022-10-06T05:03:47.053000000Z", + "modifiedAt": "2022-10-06T05:03:47.053000000Z" + } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Feed not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + put: + tags: + - External Feeds + summary: Update an external feed + description: This endpoint will update an external feed. + operationId: updateExternalFeed + parameters: + - name: uuid + description: UUID of the feed to update + example: 38f351fb-6e77-4b38-979a-a2465260449e + in: path + required: true + schema: + type: string + requestBody: + description: Values to update a feed + content: + application/json: + schema: + $ref: '#/components/schemas/updateExternalFeed' + required: true + responses: + 204: + description: Feed updated + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Feed not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + delete: + tags: + - External Feeds + summary: Delete an external feed + description: This endpoint will delete an external feed. + operationId: deleteExternalFeed + parameters: + - name: uuid + description: UUID of the feed to delete + example: 38f351fb-6e77-4b38-979a-a2465260449e + in: path + required: true + schema: + type: string + responses: + 204: + description: Feed deleted + content: { } + 400: + description: bad request + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + 404: + description: Feed not found + content: + application/json: + schema: + $ref: '#/components/schemas/errorModel' + +components: + schemas: + getAccount: + allOf: + - $ref: '#/components/schemas/getExtendedClient' + - required: + - plan + - relay + type: object + properties: + plan: + type: array + description: Information about your plans and credits + items: + required: + - credits + - creditsType + - type + type: object + properties: + type: + type: string + description: Displays the plan type of the user + example: subscription + enum: + - payAsYouGo + - free + - subscription + - sms + - reseller + creditsType: + type: string + description: This is the type of the credit, "Send Limit" is one + of the possible types of credit of a user. "Send Limit" implies + the total number of emails you can send to the subscribers in + your account. + example: sendLimit + enum: + - sendLimit + credits: + type: number + description: Remaining credits of the user + format: float + example: 8755.0 + startDate: + type: string + description: Date of the period from which the plan will start (only + available for "subscription" and "reseller" plan type) + format: date + example: 2016-12-31 + endDate: + type: string + description: Date of the period from which the plan will end (only + available for "subscription" and "reseller" plan type) + format: date + example: 2017-01-31 + userLimit: + type: integer + description: Only in case of reseller account. It implies the total + number of child accounts you can add to your account. + example: 10 + relay: + required: + - data + - enabled + type: object + properties: + enabled: + type: boolean + description: Status of your transactional email Account (true=Enabled, + false=Disabled) + example: true + data: + required: + - port + - relay + - userName + type: object + properties: + userName: + type: string + description: Email to use as login on transactional platform + format: email + example: john.smith@example.com + relay: + type: string + description: URL of the SMTP Relay + example: relay.domain.com + port: + type: integer + description: Port used for SMTP Relay + example: 125 + description: Data regarding the transactional email account + description: Information about your transactional email account + marketingAutomation: + required: + - enabled + type: object + properties: + key: + type: string + description: Marketing Automation Tracker ID + example: iso05aopqych87ysy0jymf + enabled: + type: boolean + description: Status of Marketing Automation Plateform activation for + your account (true=enabled, false=disabled) + example: false + getAccountActivity: + type: object + properties: + logs: + type: array + description: Get user activity logs + items: + required: + - action + - date + - user_email + - user_ip + - user_agent + type: object + properties: + action: + type: string + description: Type of activity in the account. + example: login-success + date: + type: string + description: Time of the activity. + example: '2023-03-27T16:30:00Z' + user_email: + type: string + description: Email address of the user who performed activity in the account. + example: 'test@mycompany.com' + user_ip: + type: string + description: IP address of the user who performed activity in the account. + example: "192.158.1.38" + user_agent: + type: string + description: Browser details of the user who performed the activity. + example: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)" + getInvitedUsersList: + type: object + properties: + users: + type: array + description: Get invited users list + items: + required: + - email + - is_owner + - status + - feature_access + type: object + properties: + email: + type: string + description: Email address of the user. + example: 'pendingInvitedUser@company.com' + is_owner: + type: string + description: Flag for indicating is user owner of the organization. + example: true + status: + type: string + description: Status of the invited user. + example: 'active' + feature_access: + description: Feature accessiblity given to the user. + type: object + properties: + marketing: + description: Marketing features accessiblity. + type: string + example: 'custom' + conversations: + description: Conversations features accessiblity. + type: string + example: 'none' + crm: + description: CRM features accessiblity. + type: string + example: 'full' + getCorporateInvitedUsersList: + type: object + properties: + users: + type: array + description: Get invited users list + items: + required: + - email + - is_owner + - status + - feature_access + type: object + properties: + groups: + description: Admin user groups list + type: object + properties: + id: + description: group id + type: string + example: a5c4f22c08d9ed37ef1ca342 + name: + description: group name + type: string + example: My group + email: + type: string + description: Email address of the user. + example: 'pendingInvitedUser@company.com' + is_owner: + type: string + description: Flag for indicating is user owner of the organization. + example: false + status: + type: string + description: Status of the invited user. + example: 'active' + feature_access: + description: Feature accessiblity given to the user. (Required only if status is active) + type: object + properties: + user_management: + description: User management accessiblity. + type: array + items: + type: string + example: 'all / none' + api_keys: + description: Api keys accessiblity. + type: array + items: + type: string + example: 'all / none' + my_plan: + description: My plan accessiblity. + type: array + items: + type: string + example: 'all / none' + apps_management: + description: Apps management accessiblity | Not available in ENTv2 + type: array + items: + type: string + example: 'all / none' + getUserPermission: + type: object + description: Check user permission + required: + - email + - status + - privileges + properties: + email: + type: string + description: Email address of the user. + example: invitedUser@company.com + status: + type: string + description: Status of the invited user. + example: 'active' + privileges: + description: Granular feature permissions given to the user. + type: array + items: + required: + - feature + - permissions + type: object + properties: + feature: + type: string + example: 'Email campaign' + permissions: + type: array + items: + type: string + example: 'Create / edit / delete' + + putRevokeUserPermission: + type: object + description: Revoke user permission + required: + - email + properties: + email: + type: string + description: Email address of the user. + example: invitedUser@company.com + + putRevokeUserPermissionResponse: + required: + - status + type: object + properties: + status: + type: string + description: Status of the API operation. + example: "OK" + credit_notes: + description: Credit note + type: array + items: + type: string + example: "TEST-123" + + putresendcancelinvitation: + type: object + description: Revoke user permission + required: + - email + properties: + email: + type: string + description: Email address of the user. + example: invitedUser@company.com + + putresendcancelinvitationResponse: + required: + - status + type: object + properties: + status: + type: string + description: Status of the API operation. + example: "OK" + credit_notes: + description: Credit note + type: array + items: + type: string + example: "TEST-123" + + inviteAdminUser: + type: object + required: + - email + - all_features_access + - privileges + properties: + email: + description: Email address for the organization + type: string + format: email + example: inviteuser@example.com + all_features_access: + description: All access to the features + type: boolean + example: true + enum: + - true + - false + groupIds: + description: Ids of Group + type: array + items: + type: string + description: Group Id + example: [ "2baxxxxxxxxxxxxxxxxxxxxxcaa", "65axxxxxxxxxxxxxxxxxxxxxc5a" ] + privileges: + type: array + items: + type: object + description: Privileges given to the user + properties: + feature: + description: Feature name + type: string + enum: + - 'my_plan' + - 'api' + - 'user_management' + - 'app_management' + example: 'user_management' + permissions: + description: Permissions for a given feature + type: array + items: + type: string + enum: + - 'all' + - 'none' + example: "'all', 'none'" + example: [ { "feature": "my_plan", "permissions": [ "all" ] }, { "feature": "api", "permissions": [ "none" ] } ] + inviteuser: + type: object + required: + - email + - all_features_access + - privileges + properties: + email: + description: Email address for the organization + type: string + format: email + example: inviteuser@example.com + all_features_access: + description: All access to the features + type: boolean + example: true + enum: + - true + - false + privileges: + type: array + items: + type: object + description: Privileges given to the user + properties: + feature: + description: Feature name + type: string + enum: + - 'email_campaigns' + - 'sms_campaigns' + - 'contacts' + - 'templates' + - 'workflows' + - 'facebook_ads' + - 'landing_pages' + - 'transactional_emails' + - 'smtp_api' + - 'user_management' + - 'sales_platform' + - 'phone' + - 'conversations' + - 'senders_domains_dedicated_ips' + - 'push_notifications' + example: 'email_campaigns' + permissions: + description: Permissions for a given feature + type: array + items: + type: string + enum: + - 'create_edit_delete' + - 'send_schedule_suspend' + - 'view' + - 'import' + - 'export' + - 'list_and_attributes' + - 'forms' + - 'activate_deactivate' + - 'activate_deactivate_pause' + - 'settings' + - 'schedule_pause' + - 'all' + - 'logs' + - 'access' + - 'assign' + - 'configure' + - 'manage_owned_deals_tasks_companies' + - 'manage_others_deals_tasks_companies' + - 'reports' + - 'senders_management' + - 'domains_management' + - 'dedicated_ips_management' + - 'send' + - 'smtp' + - 'api_keys' + - 'authorized_ips' + - 'none' + example: "'create_edit_delete', 'send_schedule_suspend'" + example: [ { "feature": "email_campaigns", "permissions": [ "create_edit_delete", "send_schedule_suspend" ] },{ "feature": "sms_campaigns", "permissions": [ "create_edit_delete","send_schedule_suspend" ] },{ "feature": "facebook_ads","permissions": [ "create_edit_delete", "schedule_pause" ] } ] + + inviteuserResponse: + required: + - status + type: object + properties: + status: + type: string + description: Status of the API operation. + example: "OK" + invoice_id: + description: Invoice id + type: string + items: + type: string + example: "TEST-ID" + + updateUserResponse: + required: + - status + type: object + properties: + status: + type: string + description: Status of the API operation. + example: "OK" + credit_notes: + description: Credit note + type: array + items: + type: string + example: "TEST-123" + invoice_id: + description: Invoice id + type: string + items: + type: string + example: "TEST-ID" + + getChildrenList: + type: object + properties: + children: + type: array + description: Your children's account information + items: + type: object + allOf: + - $ref: '#/components/schemas/getChildInfo' + - type: object + properties: + id: + type: integer + description: ID of the child + format: int64 + example: 187588 + count: + type: integer + description: Number of child accounts + format: int64 + example: 24 + getChildInfo: + allOf: + - $ref: '#/components/schemas/getClient' + - required: + - password + type: object + properties: + credits: + type: object + properties: + emailCredits: + type: integer + description: Email credits available for your child + format: int64 + example: 98555 + smsCredits: + type: integer + description: SMS credits available for your child + format: int64 + example: 87556 + description: Credits available for your child + statistics: + type: object + properties: + previousMonthTotalSent: + type: integer + description: Overall emails sent for the previous month + format: int64 + example: 7654 + currentMonthTotalSent: + type: integer + description: Overall emails sent for current month + format: int64 + example: 4566 + totalSent: + type: integer + description: Overall emails sent for since the account exists + format: int64 + example: 987554 + description: Statistics about your child account activity + password: + type: string + description: The encrypted password of child account + format: password + example: abC01De2fGHI3jkL + ips: + type: array + description: IP(s) associated to a child account user + items: + type: string + description: IP(s) associated to the user + example: "" + apiKeys: + required: + - v2 + type: object + properties: + v2: + type: array + items: + required: + - key + - name + type: object + properties: + name: + type: string + description: Name of the key for version 2 + example: N˚2 + key: + type: string + description: API Key for version 2 + example: nOpxxxxxy7z + v3: + type: array + items: + required: + - key + - name + type: object + properties: + name: + type: string + description: Name of the key for version 3 + example: N˚3 + key: + type: string + description: API Key for version 3 + example: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + description: API Keys associated to child account + getChildAccountCreationStatus: + required: + - childAccountCreated + type: object + properties: + childAccountCreated: + type: boolean + description: Status of child account creation whether it is successfully + created (exists) or not. + example: true + getChildDomains: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getChildDomain' + getSsoToken: + required: + - token + type: object + properties: + token: + type: string + description: Session token, it will remain valid for 15 days. + example: ede520dxxxxxxxxxxxx76d631fba2 + createApiKeyResponse: + required: + - status + - key + type: object + properties: + status: + type: string + description: Status of the API operation. + example: success + key: + type: string + description: API key + example: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + getChildDomain: + type: object + properties: + domain: + type: string + description: Sender domain + example: mycustomdomain.com + active: + type: boolean + description: indicates whether a domain is verified or not + example: true + getClient: + required: + - companyName + - email + - firstName + - lastName + type: object + properties: + email: + type: string + description: Login Email + format: email + example: john.smith@example.com + firstName: + type: string + description: First Name + example: John + lastName: + type: string + description: Last Name + example: Smith + companyName: + type: string + description: Name of the company + example: MyCompany + getExtendedClient: + allOf: + - $ref: '#/components/schemas/getClient' + - required: + - address + type: object + properties: + address: + required: + - city + - country + - street + - zipCode + type: object + properties: + street: + type: string + description: Street information + example: 47 Harbour Street + city: + type: string + description: City information + example: New-York + zipCode: + type: string + description: Zip Code information + example: "9867" + country: + type: string + description: Country information + example: United States of America + description: Address informations + getSendersList: + type: object + properties: + senders: + type: array + description: List of the senders available in your account + items: + required: + - active + - email + - id + - name + type: object + properties: + id: + type: integer + description: Id of the sender + format: int64 + example: 0 + name: + type: string + description: From Name associated to the sender + example: Marketing + email: + type: string + description: From Email associated to the sender + example: marketing@mycompany.com + active: + type: boolean + description: Status of sender (true=activated, false=deactivated) + example: false + ips: + type: array + description: List of dedicated IP(s) available in the account. This + data is displayed only for dedicated IPs + items: + required: + - domain + - ip + - weight + type: object + properties: + ip: + type: string + description: Dedicated IP available in your account + example: 123.98.689.7 + domain: + type: string + description: Domain of the IP + example: mycompany.com + weight: + type: integer + description: Weight of the IP for this sender + format: int64 + example: 50 + getDomainsList: + type: object + properties: + domains: + type: array + description: List of the domains available in your account + items: + required: + - id + - domain_name + - authenticated + - verified + type: object + properties: + id: + type: integer + description: Id of the domain + format: int64 + example: 1 + domain_name: + type: string + description: Domain name + example: mycompany.com + authenticated: + type: boolean + description: Status of domain authentication (true=authenticated, false=non authenticated) + example: true + verified: + type: boolean + description: Status of domain verification (true=verified, false=non verified) + example: false + ip: + type: string + description: Dedicated IP associated with domain + example: 123.98.689.7 + + createChild: + required: + - companyName + - email + - firstName + - lastName + - password + type: object + properties: + email: + type: string + description: Email address to create the child account + format: email + example: josh.cruise@example.com + firstName: + type: string + description: First name to use to create the child account + example: Josh + lastName: + type: string + description: Last name to use to create the child account + example: Cruise + companyName: + type: string + description: Company name to use to create the child account + example: Your Company + password: + type: string + description: Password for the child account to login + format: password + example: Pa55w0rd65 + language: + type: string + description: Language of the child account + example: en + enum: + - fr + - es + - pt + - it + - de + - en + createSender: + required: + - email + - name + type: object + properties: + name: + type: string + description: From Name to use for the sender + example: Newsletter + email: + type: string + description: From email to use for the sender. A verification email will + be sent to this address. + format: email + example: newsletter@mycompany.com + ips: + type: array + description: | + **Mandatory in case of dedicated IP**. IPs to associate to the sender + items: + required: + - domain + - ip + type: object + properties: + ip: + type: string + description: Dedicated IP available in your account + example: 123.98.689.7 + domain: + type: string + description: Domain of the IP + example: mycompany.com + weight: + maximum: 1E+2 + minimum: 1 + type: integer + description: Weight to apply to the IP. Sum of all IP weights must + be 100. Should be passed for either ALL or NONE of the IPs. If it's + not passed, the sending will be equally balanced on all IPs. + format: int64 + example: 50 + updateSender: + type: object + properties: + name: + type: string + description: From Name to update the sender + example: Newsletter + email: + type: string + description: From Email to update the sender + format: email + example: newsletter@mycompany.com + ips: + type: array + description: | + **Only in case of dedicated IP**. IPs to associate to the sender. If passed, will replace all the existing IPs. + items: + required: + - domain + - ip + type: object + properties: + ip: + type: string + description: Dedicated IP available in your account + example: 123.98.689.7 + domain: + type: string + description: Domain of the IP + example: mycompany.com + weight: + maximum: 1E+2 + minimum: 1 + type: integer + description: Weight to apply to the IP. Sum of all IP weights must + be 100. Should be passed for either ALL or NONE of the IPs. If it's + not passed, the sending will be equally balanced on all IPs. + format: int64 + example: 50 + otp: + required: + - otp + type: object + properties: + otp: + type: integer + description: 6 digit OTP received on email + example: 123456 + createDomain: + required: + - name + type: object + properties: + name: + type: string + description: Domain name + example: mycompany.com + updateChild: + type: object + properties: + email: + type: string + description: New Email address to update the child account + format: email + example: josh.cruise@example.com + firstName: + type: string + description: New First name to use to update the child account + example: Josh + lastName: + type: string + description: New Last name to use to update the child account + example: Cruise + companyName: + type: string + description: New Company name to use to update the child account + example: Your Company + password: + type: string + description: New password for the child account to login + format: password + example: Pa55w0rd65 + updateChildAccountStatus: + type: object + properties: + transactionalEmail: + type: boolean + description: Status of Transactional Email Platform activation for your + account (true=enabled, false=disabled) + example: false + transactionalSms: + type: boolean + description: Status of Transactional SMS Platform activation for your account + (true=enabled, false=disabled) + example: false + marketingAutomation: + type: boolean + description: Status of Marketing Automation Platform activation for your + account (true=enabled, false=disabled) + example: true + smsCampaign: + type: boolean + description: Status of SMS Campaign Platform activation for your account + (true=enabled, false=disabled) + example: true + errorModel: + required: + - code + - message + type: object + properties: + code: + type: string + description: Error code displayed in case of a failure + example: method_not_allowed + enum: + - invalid_parameter + - missing_parameter + - out_of_range + - campaign_processing + - campaign_sent + - document_not_found + - reseller_permission_denied + - not_enough_credits + - permission_denied + - duplicate_parameter + - duplicate_request + - method_not_allowed + - unauthorized + - account_under_validation + - not_acceptable + - bad_request + message: + type: string + description: Readable message associated to the failure + example: POST Method is not allowed on this path + remainingCreditModel: + required: + - child + - reseller + type: object + properties: + child: + required: + - email + - sms + type: object + properties: + sms: + type: number + description: SMS Credits remaining for child account + format: double + example: 500.0 + email: + type: number + description: Email Credits remaining for child account + format: double + example: 2000.0 + description: Credits remaining for child account + reseller: + required: + - email + - sms + type: object + properties: + sms: + type: number + description: SMS Credits remaining for reseller account + format: double + example: 12900.0 + email: + type: number + description: Email Credits remaining for reseller account + format: double + example: 2000000.0 + addCredits: + type: object + properties: + sms: + type: integer + description: | + **Required if email credits are empty.** SMS credits to be added to the child account + format: int64 + example: 450 + email: + type: integer + description: | + **Required if sms credits are empty.** Email credits to be added to the child account + format: int64 + example: 1200 + removeCredits: + type: object + properties: + sms: + type: integer + description: | + **Required if email credits are empty.** SMS credits to be removed from the child account + format: int64 + example: 300 + email: + type: integer + description: | + **Required if sms credits are empty.** Email credits to be removed from the child account + format: int64 + example: 500 + addChildDomain: + type: object + properties: + domain: + type: string + description: Sender domain to add for a specific child account + example: mychilddomain.com + updateChildDomain: + type: object + properties: + domain: + type: string + description: Value for the sender domain that will replace the existing + domain + example: myupdateddomain.com + getProcesses: + type: object + properties: + processes: + type: array + description: List of processes available on your account + items: + $ref: '#/components/schemas/getProcess' + count: + type: integer + description: Number of processes available on your account + format: int64 + example: 5 + getProcess: + required: + - id + - name + - status + type: object + properties: + id: + type: integer + description: Id of the process + format: int64 + example: 145 + status: + type: string + description: Status of the process + example: queued + enum: + - queued + - in_process + - completed + name: + type: string + description: Process name + example: IMPORTUSER + export_url: + type: string + description: URL on which send export the of contacts once the process is + completed + example: http://requestb.in/16ua3aj1 + getEmailCampaigns: + type: object + properties: + campaigns: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getExtendedCampaignOverview' + - required: + - recipients + - statistics + type: object + properties: + recipients: + type: object + allOf: + - $ref: '#/components/schemas/getCampaignRecipients' + statistics: + type: object + allOf: + - $ref: '#/components/schemas/getExtendedCampaignStats' + shareLink: + type: string + description: Link to share the campaign on social medias + format: url + example: http://dhh.brevo.com/fhsgccc.html?t=9865448900 + count: + type: integer + description: Number of Email campaigns retrieved + format: int64 + example: 24 + getSmsCampaigns: + type: object + properties: + campaigns: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getSmsCampaignOverview' + - required: + - recipients + - statistics + type: object + properties: + recipients: + type: object + allOf: + - $ref: '#/components/schemas/getCampaignRecipients' + statistics: + type: object + allOf: + - $ref: '#/components/schemas/getSmsCampaignStats' + count: + type: integer + description: Number of SMS campaigns retrieved + format: int64 + example: 12 + getSmsCampaign: + allOf: + - $ref: '#/components/schemas/getSmsCampaignOverview' + - required: + - recipients + - statistics + type: object + properties: + recipients: + type: object + allOf: + - $ref: '#/components/schemas/getCampaignRecipients' + statistics: + type: object + allOf: + - $ref: '#/components/schemas/getSmsCampaignStats' + getEmailCampaign: + allOf: + - $ref: '#/components/schemas/getExtendedCampaignOverview' + - required: + - recipients + - statistics + type: object + properties: + recipients: + type: object + allOf: + - $ref: '#/components/schemas/getCampaignRecipients' + statistics: + type: object + allOf: + - $ref: '#/components/schemas/getExtendedCampaignStats' + getCampaignOverview: + required: + - id + - name + - status + - type + type: object + properties: + id: + type: integer + description: ID of the campaign + format: int64 + example: 12 + name: + type: string + description: Name of the campaign + example: EN - Sales Summer 2017 + subject: + type: string + description: Subject of the campaign. Only available if `abTesting` flag + of the campaign is `false` + example: 20% OFF for 2017 Summer Sales + previewText: + type: string + description: Preview text or preheader of the email campaign + example: Thanks for your order! + type: + type: string + description: Type of campaign + example: classic + enum: + - classic + - trigger + status: + type: string + description: Status of the campaign + example: sent + enum: + - draft + - sent + - archive + - queued + - suspended + - in_process + scheduledAt: + type: string + description: UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-06-01T12:30:00Z + abTesting: + type: boolean + description: Status of A/B Test for the campaign. abTesting = false means + it is disabled, & abTesting = true means it is enabled. + example: true + subjectA: + type: string + description: Subject A of the ab-test campaign. Only available if `abTesting` + flag of the campaign is `true` + example: Discover the New Collection! + subjectB: + type: string + description: Subject B of the ab-test campaign. Only available if `abTesting` + flag of the campaign is `true` + example: Want to discover the New Collection? + splitRule: + type: integer + description: The size of your ab-test groups. Only available if `abTesting` + flag of the campaign is `true` + example: 25 + winnerCriteria: + type: string + description: Criteria for the winning version. Only available if `abTesting` + flag of the campaign is `true` + example: open + winnerDelay: + type: integer + description: The duration of the test in hours at the end of which the winning + version will be sent. Only available if `abTesting` flag of the campaign + is `true` + example: 50 + sendAtBestTime: + type: boolean + description: It is true if you have chosen to send your campaign at best + time, otherwise it is false + example: true + getExtendedCampaignOverview: + allOf: + - $ref: '#/components/schemas/getCampaignOverview' + - required: + - createdAt + - footer + - header + - htmlContent + - modifiedAt + - replyTo + - sender + - testSent + type: object + properties: + testSent: + type: boolean + description: Retrieved the status of test email sending. (true=Test email + has been sent false=Test email has not been sent) + example: true + header: + type: string + description: Header of the campaign + example: '[DEFAULT_HEADER]' + footer: + type: string + description: Footer of the campaign + example: '[DEFAULT_FOOTER]' + sender: + type: object + properties: + name: + type: string + description: Sender name of the campaign + example: Marketing + email: + type: string + description: Sender email of the campaign + format: email + example: marketing@mycompany.com + id: + type: integer + format: int64 + description: Sender id of the campaign + example: 43 + replyTo: + type: string + description: Email defined as the "Reply to" of the campaign + format: email + example: replyto@domain.com + toField: + type: string + description: Customisation of the "to" field of the campaign + example: '{FNAME} {LNAME}' + htmlContent: + type: string + description: HTML content of the campaign + example: This is my HTML Content + shareLink: + type: string + description: Link to share the campaign on social medias + format: url + example: http://dhh.brevo.com/fhsgccc.html?t=9865448900 + tag: + type: string + description: Tag of the campaign + example: Newsletter + createdAt: + type: string + description: Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + modifiedAt: + type: string + description: UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + inlineImageActivation: + type: boolean + description: Status of inline image. inlineImageActivation = false means + image can’t be embedded, & inlineImageActivation = true means image + can be embedded, in the email. + example: true + mirrorActive: + type: boolean + description: Status of mirror links in campaign. mirrorActive = false + means mirror links are deactivated, & mirrorActive = true means mirror + links are activated, in the campaign + example: true + recurring: + type: boolean + description: FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false + means contact can receive the same Trigger campaign only once, & recurring + = true means contact can receive the same Trigger campaign several times + example: true + sentDate: + type: string + description: Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). + Only available if 'status' of the campaign is 'sent' + example: 2018-12-01T16:30:00Z + returnBounce: + type: integer + description: Total number of non-delivered campaigns for a particular + campaign id. + format: int64 + example: 5 + getCampaignRecipients: + required: + - exclusionLists + - lists + type: object + properties: + lists: + type: array + items: + type: integer + description: List IDs included in the campaign + format: int64 + example: 21 + exclusionLists: + type: array + items: + type: integer + description: List IDs excluded of the campaign + format: int64 + example: 13 + getExtendedCampaignStats: + required: + - campaignStats + - globalStats + - linksStats + - mirrorClick + - remaining + - statsByBrowser + - statsByDevice + - statsByDomain + type: object + properties: + globalStats: + type: object + description: Overall statistics of the campaign + allOf: + - $ref: '#/components/schemas/getCampaignStats' + campaignStats: + type: array + description: List-wise statistics of the campaign. + items: + type: object + allOf: + - $ref: '#/components/schemas/getCampaignStats' + mirrorClick: + type: integer + description: Number of clicks on mirror link + format: int64 + example: 120 + remaining: + type: integer + description: Number of remaning emails to send + format: int64 + example: 1000 + linksStats: + type: object + properties: { } + description: Statistics about the number of clicks for the links + example: + example.abc.com: 7 + example.domain.com: 10 + statsByDomain: + $ref: '#/components/schemas/getStatsByDomain' + statsByDevice: + $ref: '#/components/schemas/getStatsByDevice' + statsByBrowser: + $ref: '#/components/schemas/getStatsByBrowser' + getStatsByDomain: + type: object + additionalProperties: + $ref: '#/components/schemas/getCampaignStats' + getStatsByDevice: + type: object + properties: + desktop: + type: object + additionalProperties: + $ref: '#/components/schemas/getDeviceBrowserStats' + description: Statistics of the campaign on the basis of desktop devices + mobile: + type: object + additionalProperties: + $ref: '#/components/schemas/getDeviceBrowserStats' + description: Statistics of the campaign on the basis of mobile devices + tablet: + type: object + additionalProperties: + $ref: '#/components/schemas/getDeviceBrowserStats' + description: Statistics of the campaign on the basis of tablet devices + unknown: + type: object + additionalProperties: + $ref: '#/components/schemas/getDeviceBrowserStats' + description: Statistics of the campaign on the basis of unknown devices + getStatsByBrowser: + type: object + additionalProperties: + $ref: '#/components/schemas/getDeviceBrowserStats' + addContactToListByEmails: + type: object + properties: + emails: + maxItems: 150 + minItems: 1 + type: array + description: | + Emails to add to a list. You can pass a **maximum of 150 emails** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + items: + type: string + description: Email to add to a list + format: email + example: john.smith@contact.com + addContactToListByIDs: + type: object + properties: + ids: + maxItems: 150 + minItems: 1 + type: array + description: | + IDs to add to a list. You can pass a **maximum of 150 IDs** for addition in one request. **_If you need to add the emails in bulk, please prefer /contacts/import api._** + items: + type: integer + description: ID to add to a list + format: int64 + example: 10 + removeContactFromListByEmails: + type: object + properties: + emails: + maxItems: 150 + minItems: 1 + type: array + description: | + **Required if 'all' is false and 'ids' is empty.** Emails to remove from a list. You can pass a **maximum of 150 emails** for removal in one request. + items: + type: string + description: Email to remove from a list + format: email + example: john.smith@contact.com + + removeContactFromListByIDs: + type: object + properties: + ids: + maxItems: 150 + minItems: 1 + type: array + description: | + **Required if 'all' is false and 'emails' is empty.** IDs to remove from a list. You can pass a **maximum of 150 IDs** for removal in one request. + items: + type: integer + description: ID to remove from a list + format: int64 + example: 10 + + removeContactFromListByAll: + type: object + properties: + all: + type: boolean + description: | + **Required if 'emails' and 'ids' are empty.** Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress + example: true + getSmsCampaignOverview: + required: + - content + - createdAt + - id + - modifiedAt + - name + - sender + - status + type: object + properties: + id: + type: integer + description: ID of the SMS Campaign + format: int64 + example: 2 + name: + type: string + description: Name of the SMS Campaign + example: PROMO CODE + status: + type: string + description: Status of the SMS Campaign + example: draft + enum: + - draft + - sent + - archive + - queued + - suspended + - inProcess + content: + type: string + description: Content of the SMS Campaign + example: Visit our Store and get some discount ! + scheduledAt: + type: string + description: UTC date-time on which SMS campaign is scheduled. Should be + in YYYY-MM-DDTHH:mm:ss.SSSZ format + example: 2017-06-01T12:30:00Z + sender: + type: string + description: Sender of the SMS Campaign + example: MyCompany + createdAt: + type: string + description: Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-06-01T12:30:00Z + modifiedAt: + type: string + description: UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + getWhatsappCampaignOverview: + required: + - id + - campaignName + - campaignStatus + - senderNumber + - recipients + - createdAt + - template + - modifiedAt + type: object + properties: + id: + type: integer + description: ID of the WhatsApp Campaign + format: int64 + example: 1672035851100690 + campaignName: + type: string + description: Name of the WhatsApp Campaign + example: Test Campaign + campaignStatus: + type: string + description: Status of the WhatsApp Campaign + example: draft + enum: + - draft + - scheduled + - pending + - approved + - running + - suspended + - rejected + - sent + scheduledAt: + type: string + description: UTC date-time on which WhatsApp campaign is scheduled. Should be + in YYYY-MM-DDTHH:mm:ss.SSSZ format + example: 2017-06-01T12:30:00Z + senderNumber: + type: string + description: Sender of the WhatsApp Campaign + example: 9368207029 + stats: + $ref: '#/components/schemas/WhatsappCampStats' + template: + $ref: '#/components/schemas/WhatsappCampTemplate' + createdAt: + type: string + description: Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-06-01T12:30:00Z + modifiedAt: + type: string + description: UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + WhatsappCampStats: + type: object + required: + - sent + - delivered + - read + - unsubscribe + - notSent + properties: + sent: + type: integer + example: 3 + delivered: + type: integer + example: 3 + read: + type: integer + example: 2 + unsubscribe: + type: integer + example: 0 + notSent: + type: integer + example: 4 + WhatsappCampTemplate: + type: object + properties: + name: + type: string + example: wta107 + description: name of the template + category: + type: string + example: Marketing + description: description of the template + language: + type: string + example: en_GB + description: language of the template + contains_button: + type: boolean + example: false + display_header: + type: boolean + example: true + header_type: + type: string + example: text + description: type of header + components: + type: array + description: array of component item objects + items: + $ref: '#/components/schemas/componentItems' + header_variables: + type: array + description: array of variables item object + items: + $ref: '#/components/schemas/variablesItems' + body_variables: + type: array + description: array of variables item variables + items: + $ref: '#/components/schemas/variablesItems' + button_type: + type: string + example: QUICK_REPLIES + hide_footer: + type: boolean + example: true + componentItems: + type: object + properties: + type: + type: string + example: BODY + text: + type: string + example: Life is a long lesson in humility + variablesItems: + type: object + properties: + name: + type: string + example: FIRSTNAME + default: + type: string + example: INVALID_HEADER + datatype: + type: string + example: text + bodyVariablesItems: + type: object + getWhatsappTemplates: + type: object + properties: + templates: + type: array + items: + type: object + required: + - id + - name + - status + - type + - language + - category + - createdAt + - modifiedAt + properties: + id: + type: integer + description: ID of the WhatsApp template + format: int64 + example: 235 + name: + type: string + description: Name of the WhatsApp template + example: Test template + status: + type: string + description: Status of the WhatsApp template + example: approved + language: + type: string + description: Language in which template exists + example: en + category: + type: string + description: category of the template + example: MARKETING + errorReason: + type: string + description: Error reason in the template creation + example: NONE + createdAt: + type: string + description: Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-06-01T12:30:00Z + modifiedAt: + type: string + description: UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + count: + type: integer + description: Number of WhatsApp templates retrieved + format: int64 + example: 24 + getWhatsappCampaigns: + type: object + properties: + campaigns: + type: array + items: + type: object + required: + - id + - campaignName + - campaignStatus + - templateId + - scheduledAt + - createdAt + - modifiedAt + properties: + id: + type: integer + description: ID of the WhatsApp Campaign + format: int64 + example: 1672035851100690 + campaignName: + type: string + description: Name of the WhatsApp Campaign + example: Test Campaign + templateId: + type: string + description: Id of the WhatsApp template + example: 637660278078655 + campaignStatus: + type: string + description: Status of the WhatsApp Campaign + example: draft + enum: + - draft + - scheduled + - pending + - approved + - running + - suspended + - rejected + - sent + scheduledAt: + type: string + description: UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + example: 2017-06-01T12:30:00Z + errorReason: + type: string + description: Error Reason associated with the WhatsApp campaign sending + invalidatedContacts: + type: integer + description: Count of invalidated contacts + format: int64 + example: 0 + readPercentage: + type: number + description: Read percentage of the the WhatsApp campaign created + format: float + example: 28.57 + stats: + $ref: '#/components/schemas/WhatsappCampStats' + createdAt: + type: string + description: Creation UTC date-time of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-06-01T12:30:00Z + modifiedAt: + type: string + description: UTC date-time of last modification of the WhatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + count: + type: integer + description: Number of WhatsApp campaigns retrieved + format: int64 + example: 40 + createWhatsAppCampaign: + type: object + required: + - name + - templateId + - scheduledAt + - recipients + properties: + name: + type: string + description: Name of the WhatsApp campaign creation + example: Test Campaign + templateId: + type: integer + description: Id of the WhatsApp template in **approved** state + example: 19 + scheduledAt: + type: string + description: | + Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** + example: 2017-06-01T12:30:00+02:00 + recipients: + type: object + properties: + excludedListIds: + type: array + description: List ids to exclude from the campaign + items: + type: integer + format: int64 + example: 8 + listIds: + type: array + description: | + **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to + items: + type: integer + format: int64 + example: 32 + segments: + description: | + **Mandatory if listIds are not used**. Segment ids to send the campaign to. + type: array + items: + type: integer + format: int64 + example: 23 + description: Segment ids and List ids to include/exclude from campaign + getWhatsAppConfig: + type: object + properties: + whatsappBusinessAccountId: + type: string + description: Id of the WhatsApp business account + example: 105569359072383 + sendingLimit: + type: string + description: Sending limit Information of the WhatsApp API account + example: TIER_1K + phoneNumberQuality: + type: string + description: Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** + example: GREEN + enum: + - GREEN + - YELLOW + - RED + whatsappBusinessAccountStatus: + type: string + description: Status information related to WhatsApp API account + example: APPROVED + enum: + - APPROVED + - PENDING + - REJECTED + businessStatus: + type: string + description: Verification status information of the Business account + example: verified + phoneNumberNameStatus: + type: string + description: Status of the name associated with WhatsApp Phone number + example: APPROVED + enum: + - APPROVED + - PENDING + - REJECTED + createWhatsAppTemplate: + type: object + required: + - name + - language + - category + - bodyText + properties: + name: + type: string + description: Name of the template + example: Test template + language: + type: string + description: | + Language of the template. For Example : + **en** for English + example: en + category: + type: string + description: Category of the template + example: MARKETING + enum: + - MARKETING + - UTILITY + mediaUrl: + type: string + description: | + Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty**. + Allowed extensions for media files are: + #### jpeg | png | mp4 | pdf + example: https://attachment.domain.com + bodyText: + type: string + description: Body of the template. **Maximum allowed characters are 1024** + example: making it look like readable English + headerText: + type: string + description: | + Text content of the header in the template. **Maximum allowed characters are 45** + **Use this field to add text content in template header and if mediaUrl is empty** + example: Test WhatsApp campaign + source: + type: string + description: source of the template + enum: + - Automation + - Conversations + updateWhatsAppCampaign: + type: object + properties: + campaignName: + type: string + description: Name of the campaign + example: Test WhatsApp + campaignStatus: + type: string + description: Status of the campaign + example: scheduled + enum: + - scheduled + - suspended + default: scheduled + rescheduleFor: + type: string + description: | + Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** + Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. + example: 2017-06-01T12:30:00+02:00 + recipients: + type: object + properties: + excludedListIds: + type: array + description: List ids to exclude from the campaign + items: + type: integer + format: int64 + example: 8 + listIds: + type: array + description: | + **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to + items: + type: integer + format: int64 + example: 32 + segments: + description: | + **Mandatory if listIds are not used**. Segment ids to send the campaign to. + type: array + items: + type: integer + format: int64 + example: 23 + description: Segment ids and List ids to include/exclude from campaign + createModel: + required: + - id + type: object + properties: + id: + type: integer + description: ID of the object created + format: int64 + example: 5 + createUpdateContactModel: + type: object + properties: + id: + type: integer + description: ID of the contact when a new contact is created + format: int64 + example: 122 + updateBatchContactsModel: + type: object + properties: + successIds: + type: array + items: + type: integer + description: IDs which are successfully updated + format: int64 + example: 1,2 + failureIds: + type: array + items: + type: integer + description: IDs which are not updated + format: int64 + example: 3,4 + createSenderModel: + required: + - id + type: object + properties: + id: + type: integer + description: ID of the Sender created + format: int64 + example: 5 + spfError: + type: boolean + description: Status of SPF configuration for the sender (true = SPF not + well configured, false = SPF well configured) + example: true + dkimError: + type: boolean + description: Status of DKIM configuration for the sender (true = DKIM not + well configured, false = DKIM well configured) + example: false + createDomainModel: + required: + - id + type: object + properties: + id: + type: integer + description: ID of the Domain created + format: int64 + example: 5 + domain_name: + type: string + description: Domain + example: true + message: + type: string + description: Success message + example: Domain added successfully. To authenticate it, add following DNS records + dns_records: + type: object + properties: + dkim_record: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + brevo_code: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + dmarc_record: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + authenticateDomainModel: + required: + - domain_name + - message + type: object + properties: + domain_name: + type: string + description: Domain + example: myexample.com + message: + type: string + description: Success message + example: Domain has been authenticated successfully. + getDomainConfigurationModel: + required: + - domain + - verified + - authenticated + - dns_records + type: object + properties: + domain: + type: string + description: Domain + example: myexample.com + verified: + type: boolean + description: Status of domain verification (true=verified, false=non verified) + example: true + authenticated: + type: boolean + description: Status of domain authentication (true=authenticated, false=non authenticated) + example: false + dns_records: + type: object + properties: + dkim_record: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + brevo_code: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + dmarc_record: + type: object + properties: + type: + type: string + value: + type: string + host_name: + type: string + status: + type: boolean + createSmtpEmail: + type: object + properties: + messageId: + type: string + description: Message ID of the transactional email sent + example: <201798300811.5787683@relay.domain.com> + messageIds: + type: array + items: + type: string + description: version wise message ID's of the transactional emails sent + example: [ '<201798300811.5787683@relay.domain.com>','<201798300811.5787683@relay.domain.com>' ] + uploadImageModel: + type: object + properties: + url: + type: string + description: URL of the image uploaded + example: 'https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg' + scheduleSmtpEmail: + type: object + properties: + messageId: + type: string + description: Message ID of the transactional email scheduled + example: <201798300811.5787683@relay.domain.com> + messageIds: + type: array + items: + type: string + description: version wise message ID's of the transactional emails scheduled + batchId: + type: string + description: Batch ID of the batch transactional email scheduled + example: 5c6cfa04-eed9-42c2-8b5c-6d470d978e9d + createReseller: + required: + - authKey + type: object + properties: + authKey: + type: string + description: AuthKey of Reseller child created + example: xkeysib-21881axxxxxcc92e04-mIrexxxx7z + id: + type: integer + description: Id of Reseller child created + format: int64 + example: 1234567 + sendSms: + required: + - messageId + - reference + type: object + properties: + reference: + type: string + example: ab1cde2fgh3i4jklmno + messageId: + type: integer + format: int64 + example: 1511882900176220 + smsCount: + type: integer + description: Count of SMS's to send multiple text messages + format: int64 + example: 2 + usedCredits: + type: number + description: SMS credits used per text message + format: float + example: 0.7 + remainingCredits: + type: number + description: Remaining SMS credits of the user + format: float + example: 82.85 + createdProcessId: + required: + - processId + type: object + properties: + processId: + type: integer + description: Id of the process created + format: int64 + example: 78 + createUpdateFolder: + type: object + properties: + name: + type: string + description: Name of the folder + example: Wordpress Contacts + postSendFailed: + required: + - code + - message + type: object + properties: + code: + type: string + description: Response code + example: invalid_parameter + message: + type: string + description: Response message + example: The email could not be sent to all recipients + unexistingEmails: + type: array + items: + type: string + description: Email addresses you tried to sent an email to, but not existing + in your contacts + format: email + example: matthew.dow@example.com, elisa.carrely@example.com + withoutListEmails: + type: array + items: + type: string + description: Email addresses you sent an email to, without a contact list + format: email + example: jeff.dean@example.com, jim.sue@example.com + blackListedEmails: + type: array + items: + type: string + description: Email addresses which are blacklisted. ONLY FOR email-campign's + sendTest OR smtp-template's sendTest api's. + format: email + example: jeff.dean@example.com, jim.sue@example.com + postSendSmsTestFailed: + required: + - code + - message + type: object + properties: + code: + type: string + description: Response code + example: invalid_parameter + message: + type: string + description: Response message + example: The SMS could not be sent to all recipients + unexistingSms: + type: array + items: + type: string + description: Email addresses you tried to sent a SMS to, but not existing + in your contacts + format: email + example: 337699086644@mailin.com, 41778899954@mailin.com + withoutListSms: + type: array + items: + type: string + description: Email addresses you sent a SMS to, without a contact list + format: email + example: 3542388988@mailin.com, 10976444477@mailin.com + postContactInfo: + required: + - contacts + type: object + properties: + contacts: + type: object + properties: + success: + oneOf: + - type: array + items: + type: string + description: Email addresses which are successfully imported/removed + format: email + example: jeff32@example.com, jim56@example.com + - type: array + items: + type: integer + description: IDs which are successfully imported/removed + format: int64 + example: 1, 2 + failure: + oneOf: + - type: array + items: + type: string + description: Email addresses which can not be imported/removed, could be already in/out list and/or doesn't exist + format: email + example: jeff32@example.com, jim56@example.com + - type: array + items: + type: integer + description: IDs which can not be imported/removed, could be already in/out list and/or doesn't exist + format: int64 + example: 5, 6 + total: + type: integer + description: Displays the count of total number of contacts removed + from list when user opts for "all" option. + format: int64 + example: 27 + processId: + type: integer + description: Id of the process created to remove contacts from list + when user opts for "all" option. + format: int64 + example: 78 + getAggregatedReport: + type: object + properties: + range: + type: string + description: Time frame of the report + example: 2016-09-08|2017-04-06 + requests: + type: integer + description: Number of requests for the timeframe + format: int64 + example: 263 + delivered: + type: integer + description: Number of delivered emails for the timeframe + format: int64 + example: 249 + hardBounces: + type: integer + description: Number of hardbounces for the timeframe + format: int64 + example: 1 + softBounces: + type: integer + description: Number of softbounces for the timeframe + format: int64 + example: 4 + clicks: + type: integer + description: Number of clicks for the timeframe + format: int64 + example: 12 + uniqueClicks: + type: integer + description: Number of unique clicks for the timeframe + format: int64 + example: 8 + opens: + type: integer + description: Number of openings for the timeframe + format: int64 + example: 47 + uniqueOpens: + type: integer + description: Number of unique openings for the timeframe + format: int64 + example: 37 + spamReports: + type: integer + description: Number of complaint (spam report) for the timeframe + format: int64 + example: 0 + blocked: + type: integer + description: Number of blocked contact emails for the timeframe + format: int64 + example: 2 + invalid: + type: integer + description: Number of invalid emails for the timeframe + format: int64 + example: 0 + unsubscribed: + type: integer + description: Number of unsubscribed emails for the timeframe + format: int64 + example: 0 + getTransacBlockedContacts: + type: object + properties: + count: + type: integer + description: Count of blocked or unsubscribed contact + format: int64 + example: 1 + contacts: + type: array + items: + required: + - blockedAt + - email + - reason + - senderEmail + type: object + properties: + email: + type: string + description: Email address of the blocked or unsubscribed contact + format: email + example: john.smith@example.com + senderEmail: + type: string + description: Sender email address of the blocked or unsubscribed contact + format: email + example: john.smith@example.com + reason: + type: object + properties: + code: + type: string + description: Reason code for blocking / unsubscribing (This code + is safe for comparison) + example: AdminBlocked + enum: + - unsubscribedViaMA + - unsubscribedViaEmail + - adminBlocked + - unsubscribedViaApi + - hardBounce + - contactFlaggedAsSpam + message: + type: string + description: Reason for blocking / unsubscribing (This string + is not safe for comparison) + example: Admin blocked + description: Reason for blocking / unsubscribing + example: Admin blocked + blockedAt: + type: string + description: Date when the contact was blocked or unsubscribed on + example: 2017-05-01T12:30:00Z + getReports: + type: object + properties: + reports: + type: array + items: + required: + - blocked + - clicks + - date + - delivered + - hardBounces + - invalid + - opens + - requests + - softBounces + - spamReports + - uniqueClicks + - uniqueOpens + - unsubscribed + type: object + properties: + date: + type: string + description: Date of the statistics + format: date + example: 2017-04-06 + requests: + type: integer + description: Number of requests for the date + format: int64 + example: 65 + delivered: + type: integer + description: Number of delivered emails for the date + format: int64 + example: 63 + hardBounces: + type: integer + description: Number of hardbounces for the date + format: int64 + example: 1 + softBounces: + type: integer + description: Number of softbounces for the date + format: int64 + example: 1 + clicks: + type: integer + description: Number of clicks for the date + format: int64 + example: 6 + uniqueClicks: + type: integer + description: Number of unique clicks for the date + format: int64 + example: 5 + opens: + type: integer + description: Number of openings for the date + format: int64 + example: 58 + uniqueOpens: + type: integer + description: Number of unique openings for the date + format: int64 + example: 52 + spamReports: + type: integer + description: Number of complaints (spam reports) for the date + format: int64 + example: 0 + blocked: + type: integer + description: Number of blocked emails for the date + format: int64 + example: 0 + invalid: + type: integer + description: Number of invalid emails for the date + format: int64 + example: 0 + unsubscribed: + type: integer + description: Number of unsubscribed emails for the date + format: int64 + example: 0 + getEmailEventReport: + type: object + properties: + events: + type: array + items: + required: + - date + - email + - event + - messageId + type: object + properties: + email: + type: string + description: Email address which generates the event + format: email + example: john.smith@example.com + date: + type: string + description: UTC date-time on which the event has been generated + example: 2017-03-12T12:30:00Z + subject: + type: string + description: Subject of the event + example: Sib client test + messageId: + type: string + description: Message ID which generated the event + example: <201798300811.5787683@relay.domain.com> + event: + type: string + description: Event which occurred + example: delivered + enum: + - bounces + - hardBounces + - softBounces + - delivered + - spam + - requests + - opened + - clicks + - invalid + - deferred + - blocked + - unsubscribed + - error + - loadedByProxy + reason: + type: string + description: Reason of bounce (only available if the event is hardbounce + or softbounce) + example: Error connection timeout + tag: + type: string + description: Tag of the email which generated the event + example: OrderConfirmation + ip: + type: string + description: IP from which the user has opened the email or clicked + on the link (only available if the event is opened or clicks) + example: 165.87.3.15 + link: + type: string + description: The link which is sent to the user (only available if + the event is requests or opened or clicks) + example: https://www.someexamplelink.com + from: + type: string + description: Sender email from which the emails are sent + format: email + example: john@example.com + templateId: + type: integer + description: ID of the template (only available if the email is template based) + format: int64 + example: 4 + getSmsEventReport: + type: object + properties: + events: + type: array + items: + type: object + properties: + phoneNumber: + type: string + description: Phone number which has generated the event + example: "00189001094" + date: + type: string + description: UTC date-time on which the event has been generated + example: 2017-03-12T12:30:00Z + messageId: + type: string + description: Message ID which generated the event + example: "1472640582425378" + event: + type: string + description: Event which occurred + example: accepted + enum: + - bounces + - hardBounces + - softBounces + - delivered + - sent + - accepted + - unsubscription + - replies + - blocked + - rejected + reason: + type: string + description: Reason of bounce (only available if the event is hardbounce + or softbounce) + example: Message is undeliverable due to an incorrect / invalid / + blacklisted / permanently barred MSISDN for this operator + reply: + type: string + tag: + type: string + description: Tag of the SMS which generated the event + example: CabWaiting + getSmtpTemplateOverview: + required: + - createdAt + - htmlContent + - id + - isActive + - modifiedAt + - name + - replyTo + - sender + - subject + - tag + - testSent + - toField + type: object + properties: + id: + type: integer + description: ID of the template + format: int64 + example: 4 + name: + type: string + description: Name of the template + example: Order Confirmation - EN + subject: + type: string + description: Subject of the template + example: Thanks for your order ! + isActive: + type: boolean + description: Status of template (true=active, false=inactive) + example: true + testSent: + type: boolean + description: Status of test sending for the template (true=test email has + been sent, false=test email has not been sent) + example: true + sender: + type: object + properties: + name: + type: string + description: From email for the template + example: Mary form MyShop + email: + type: string + description: From email for the template + format: email + example: contact@myshop.fr + id: + type: string + description: Sender id of the template + example: "43" + replyTo: + type: string + description: Email defined as the "Reply to" for the template + format: email + example: replyto@domain.com + toField: + type: string + description: Customisation of the "to" field for the template + example: '{FIRSTNAME} {LASTNAME}' + tag: + type: string + description: Tag of the template + example: sports + htmlContent: + type: string + description: HTML content of the template + example: Your order n°xxxxx has been confirmed. Thanks for your purchase. + createdAt: + type: string + description: Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-01T12:30:00Z + modifiedAt: + type: string + description: Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + doiTemplate: + type: boolean + description: It is true if template is a valid Double opt-in (DOI) template, + otherwise it is false. This field will be available only in case of single + template detail call. + example: false + getSmtpTemplates: + type: object + properties: + count: + type: integer + description: Count of transactional email templates + format: int64 + example: 1 + templates: + type: array + items: + $ref: '#/components/schemas/getSmtpTemplateOverview' + getWebhook: + required: + - createdAt + - description + - events + - id + - modifiedAt + - type + - url + type: object + properties: + url: + type: string + description: URL of the webhook + format: url + example: http://requestb.in/173lyyx1 + id: + type: integer + description: ID of the webhook + format: int64 + example: 654 + description: + type: string + description: Description of the webhook + example: Webhook triggered on campaign openings + events: + type: array + items: + type: string + description: Events which will trigger the webhook when they occure + example: opens,clicks + type: + type: string + description: Type of webhook (marketing or transactional) + example: marketing + enum: + - marketing + - transactional + createdAt: + type: string + description: Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2016-12-01T12:50:00Z + modifiedAt: + type: string + description: Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T13:15:00Z + batched: + type: boolean + description: Batching configuration of the webhook, we send batched webhooks if its true + example: true + auth: + type: object + description: Authentication header to be send with the webhook requests + example: + type: bearer + token: test-auth-token1234 + headers: + type: array + items: + type: object + description: Headers send with the requests to the webhook + example: + key: cf-secret + value: test-header-value + getWebhooks: + required: + - webhooks + type: object + properties: + webhooks: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getWebhook' + getContactDetails: + required: + - attributes + - createdAt + - emailBlacklisted + - id + - listIds + - modifiedAt + - smsBlacklisted + type: object + properties: + email: + type: string + description: Email address of the contact for which you requested the details + format: email + example: john.smith@example.com + id: + type: integer + description: ID of the contact for which you requested the details + format: int64 + example: 32 + emailBlacklisted: + type: boolean + description: Blacklist status for email campaigns (true=blacklisted, false=not + blacklisted) + example: false + smsBlacklisted: + type: boolean + description: Blacklist status for SMS campaigns (true=blacklisted, false=not + blacklisted) + example: true + createdAt: + type: string + description: Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + modifiedAt: + type: string + description: Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + listIds: + type: array + items: + type: integer + description: List(s) in which the contact is included + format: int64 + listUnsubscribed: + type: array + items: + type: integer + description: List(s) in which the contact is included (only available + if unsubscription per list is activated for the account) + format: int64 + attributes: + type: object + properties: { } + description: Set of attributes of the contact + example: + name: Joe + email: joe@example.com + getExtendedContactDetails: + allOf: + - $ref: '#/components/schemas/getContactDetails' + - required: + - statistics + type: object + properties: + statistics: + type: object + properties: + messagesSent: + type: array + description: Listing of the sent campaign for the contact + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + hardBounces: + type: array + description: Listing of the hardbounes generated by the contact + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + softBounces: + type: array + description: Listing of the softbounes generated by the contact + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + complaints: + type: array + description: Listing of the complaints generated by the contact + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + unsubscriptions: + required: + - adminUnsubscription + - userUnsubscription + type: object + properties: + userUnsubscription: + type: array + description: Contact unsubscribe via unsubscription link in a + campaign + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has unsubscribed + example: 165.87.3.15 + adminUnsubscription: + type: array + description: Contact has been unsubscribed from the administrator + items: + required: + - eventTime + type: object + properties: + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has been unsubscribed + example: 165.87.3.15 + description: Listing of the unsubscription for the contact + opened: + type: array + description: Listing of the openings generated by the contact + items: + required: + - campaignId + - count + - eventTime + - ip + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + count: + type: integer + description: Number of openings for the campaign + format: int64 + example: 1 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has opened the email + example: 165.87.3.15 + clicked: + type: array + description: Listing of the clicks generated by the contact + items: + required: + - campaignId + - links + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + links: + type: array + description: Listing of the clicked links for the campaign + items: + required: + - count + - eventTime + - ip + - url + type: object + properties: + count: + type: integer + description: Number of clicks on this link for the campaign + format: int64 + example: 1 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has clicked on the + link + example: 165.87.3.15 + url: + type: string + description: URL of the clicked link + example: www.myshop.com + transacAttributes: + type: array + description: Listing of the transactional attributes for the contact + items: + type: object + properties: { } + delivered: + type: array + description: Listing of the delivered campaign for the contact + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + description: Campaign statistics of the contact + getContactCampaignStats: + type: object + properties: + messagesSent: + type: array + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + hardBounces: + type: array + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + softBounces: + type: array + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + complaints: + type: array + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + unsubscriptions: + required: + - adminUnsubscription + - userUnsubscription + type: object + properties: + userUnsubscription: + type: array + description: Contact has unsubscribed via the unsubscription link in + the email + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has unsubscribed + example: 165.87.3.15 + adminUnsubscription: + type: array + description: Contact has been unsubscribed from the administrator + items: + required: + - eventTime + type: object + properties: + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has been unsubscribed + example: 165.87.3.15 + opened: + type: array + items: + required: + - campaignId + - count + - eventTime + - ip + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + count: + type: integer + description: Number of openings of the campaign + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has opened the campaign + example: 165.87.3.15 + clicked: + type: array + items: + required: + - campaignId + - links + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + links: + type: array + items: + required: + - count + - eventTime + - ip + - url + type: object + properties: + count: + type: integer + description: Number of clicks on this link for the campaign + format: int64 + example: 1 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + ip: + type: string + description: IP from which the user has clicked on the link + example: 165.87.3.15 + url: + type: string + description: URL of the clicked link + example: www.myshop.com + transacAttributes: + type: array + items: + required: + - orderDate + - orderId + - orderPrice + type: object + properties: + orderDate: + type: string + description: Date of the order + format: date + example: 2017-03-12 + orderPrice: + type: number + description: Price of the order + format: float + example: 24.99 + orderId: + type: integer + description: ID of the order + format: int64 + example: 248 + delivered: + type: array + items: + required: + - campaignId + - eventTime + type: object + properties: + campaignId: + type: integer + description: ID of the campaign which generated the event + format: int64 + example: 3 + eventTime: + type: string + description: UTC date-time of the event + example: 2017-03-12T20:15:13Z + description: Campaign Statistics for the contact + getContacts: + required: + - contacts + - count + type: object + properties: + contacts: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getContactDetails' + count: + type: integer + description: Number of contacts + format: int64 + example: 17655 + getAttributes: + required: + - attributes + type: object + properties: + attributes: + type: array + description: Listing of available contact attributes in your account + items: + required: + - category + - name + type: object + properties: + name: + type: string + description: Name of the attribute + example: LASTNAME + category: + type: string + description: Category of the attribute + example: category + enum: + - normal + - transactional + - category + - calculated + - global + type: + type: string + description: Type of the attribute + example: text + enum: + - text + - date + - float + - id + - boolean + enumeration: + type: array + description: Parameter only available for "category" type attributes. + items: + required: + - label + - value + type: object + properties: + value: + type: integer + description: ID of Value of the "category" type attribute + format: int64 + example: 1 + label: + type: string + description: Label of the "category" type attribute + example: Women + calculatedValue: + type: string + description: Calculated value formula + example: COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)] + getFolders: + type: object + properties: + folders: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getFolder' + count: + type: integer + description: Number of folders available in your account + format: int64 + example: 10 + getFolder: + required: + - id + - name + - totalBlacklisted + - totalSubscribers + - uniqueSubscribers + type: object + properties: + id: + type: integer + description: ID of the folder + format: int64 + example: 2 + name: + type: string + description: Name of the folder + example: Magento Customers + totalBlacklisted: + type: integer + description: Number of blacklisted contacts in the folder + format: int64 + example: 32 + totalSubscribers: + type: integer + description: Number of contacts in the folder + format: int64 + example: 19777 + uniqueSubscribers: + type: integer + description: Number of unique contacts in the folder + format: int64 + example: 16222 + getFolderLists: + type: object + properties: + lists: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getList' + count: + type: integer + description: Number of lists in the folder + format: int64 + example: 6 + getLists: + type: object + properties: + lists: + type: array + description: Listing of all the lists available in your account + items: + type: object + allOf: + - $ref: '#/components/schemas/getList' + - required: + - folderId + type: object + properties: + folderId: + type: integer + description: ID of the folder + format: int64 + example: 2 + count: + type: integer + description: Number of lists in your account + format: int64 + example: 150 + getSegments: + type: object + properties: + segments: + type: array + description: Listing of all the segments available in your account + items: + type: object + required: + - id + - name + - segmentName + - categoryName + properties: + id: + type: integer + description: ID of the list + format: int64 + example: 23 + segmentName: + type: string + description: Name of the Segment + example: My Segment + categoryName: + type: string + description: Name of the Segment Category + format: string + example: New Category + updatedAt: + type: string + description: Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: '2017-03-13T17:05:09Z' + count: + type: integer + description: Number of Segments in your account + format: int64 + example: 10 + getList: + required: + - id + - name + - totalBlacklisted + - totalSubscribers + - uniqueSubscribers + type: object + properties: + id: + type: integer + description: ID of the list + format: int64 + example: 23 + name: + type: string + description: Name of the list + example: Magento Customers - EN + totalBlacklisted: + type: integer + description: Number of blacklisted contacts in the list + format: int64 + example: 13 + totalSubscribers: + type: integer + description: Number of contacts in the list + format: int64 + example: 1776 + uniqueSubscribers: + type: integer + description: Number of unique contacts in the list + format: int64 + example: 1789 + getExtendedList: + allOf: + - $ref: '#/components/schemas/getList' + - required: + - createdAt + - folderId + type: object + properties: + folderId: + type: integer + description: ID of the folder + format: int64 + example: 2 + createdAt: + type: string + description: Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-03-13T17:05:09Z + campaignStats: + type: array + items: + required: + - campaignId + - stats + type: object + properties: + campaignId: + type: integer + description: ID of the campaign + format: int64 + example: 143 + stats: + $ref: '#/components/schemas/getCampaignStats' + dynamicList: + type: boolean + description: Status telling if the list is dynamic or not (true=dynamic, + false=not dynamic) + example: false + getSmsCampaignStats: + required: + - answered + - delivered + - hardBounces + - processing + - sent + - softBounces + - unsubscriptions + type: object + properties: + delivered: + type: integer + description: Number of delivered SMS + format: int64 + example: 2987 + sent: + type: integer + description: Number of sent SMS + format: int64 + example: 3000 + processing: + type: integer + description: Number of processing SMS + format: int64 + example: 0 + softBounces: + type: integer + description: Number of softbounced SMS + format: int64 + example: 3 + hardBounces: + type: integer + description: Number of hardbounced SMS + format: int64 + example: 1 + unsubscriptions: + type: integer + description: Number of unsubscription SMS + format: int64 + example: 3 + answered: + type: integer + description: Number of replies to the SMS + format: int64 + example: 2 + getDeviceBrowserStats: + required: + - clickers + - uniqueClicks + - uniqueViews + - viewed + type: object + properties: + clickers: + type: integer + description: Number of total clicks for the campaign using the particular + browser + format: int64 + example: 2665 + uniqueClicks: + type: integer + description: Number of unique clicks for the campaign using the particular + browser + format: int64 + example: 2300 + viewed: + type: integer + description: Number of openings for the campaign using the particular browser + format: int64 + example: 8999 + uniqueViews: + type: integer + description: Number of unique openings for the campaign using the particular + browser + format: int64 + example: 7779 + getCampaignStats: + required: + - clickers + - complaints + - delivered + - hardBounces + - sent + - softBounces + - uniqueClicks + - uniqueViews + - unsubscriptions + - viewed + - trackableViews + type: object + properties: + listId: + type: integer + description: List Id of email campaign (only in case of get email campaign(s)(not + for global stats)) + format: int64 + example: 2 + uniqueClicks: + type: integer + description: Number of unique clicks for the campaign + format: int64 + example: 2300 + clickers: + type: integer + description: Number of total clicks for the campaign + format: int64 + example: 2665 + complaints: + type: integer + description: Number of complaints (Spam reports) for the campaign + format: int64 + example: 1 + delivered: + type: integer + description: Number of delivered emails for the campaign + format: int64 + example: 19765 + sent: + type: integer + description: Number of sent emails for the campaign + format: int64 + example: 19887 + softBounces: + type: integer + description: Number of softbounce for the campaign + format: int64 + example: 100 + hardBounces: + type: integer + description: Number of harbounce for the campaign + format: int64 + example: 87 + uniqueViews: + type: integer + description: Number of unique openings for the campaign + format: int64 + example: 7779 + trackableViews: + type: integer + description: Recipients without any privacy protection option enabled in their email client + format: int64 + example: 5661 + trackableViewsRate: + type: number + description: Rate of recipients without any privacy protection option enabled in their email client + format: float + example: 23.45 + estimatedViews: + type: integer + description: Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails + format: int64 + example: 560 + unsubscriptions: + type: integer + description: Number of unsubscription for the campaign + format: int64 + example: 2 + viewed: + type: integer + description: Number of openings for the campaign + format: int64 + example: 8999 + deferred: + type: integer + description: Number of deferred emails for the campaign + format: int64 + example: 30 + returnBounce: + type: integer + description: Total number of non-delivered campaigns for a particular campaign + id. + format: int64 + example: 5 + updateSmtpTemplate: + type: object + properties: + tag: + type: string + description: Tag of the template + example: OrderConfirmation + sender: + type: object + properties: + name: + type: string + description: Name of the sender + example: Mary from MyShop + email: + type: string + description: Email of the sender + format: email + example: contact@myshop.com + id: + type: integer + description: | + Select the sender for the template on the basis of sender id. + _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + format: int64 + example: 3 + description: | + Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: + **{"name":"xyz", "email":"example@abc.com"}** + **{"name":"xyz", "id":123}** + templateName: + type: string + description: Name of the template + example: Order Confirmation - EN + htmlContent: + type: string + description: | + **Required if htmlUrl is empty**. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) + example: The order n°xxxxx has been confirmed. Thanks for your purchase + htmlUrl: + type: string + description: | + **Required if htmlContent is empty**. URL to the body of the email (HTML) + format: url + example: https://html.domain.com + subject: + type: string + description: Subject of the email + example: Thanks for your purchase ! + replyTo: + type: string + description: Email on which campaign recipients will be able to reply to + format: email + example: support@myshop.com + toField: + type: string + description: | + To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + example: '{FNAME} {LNAME}' + attachmentUrl: + type: string + description: | + Absolute url of the attachment (**no local file**). Extensions allowed: + #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + format: url + example: https://attachment.domain.com + isActive: + type: boolean + description: Status of the template. isActive = false means template is + inactive, isActive = true means template is active + example: true + updateCampaignStatus: + type: object + properties: + status: + type: string + description: | + Note:- **replicateTemplate** status will be available **only for template type campaigns.** + enum: + - suspended + - archive + - darchive + - sent + - queued + - replicate + - replicateTemplate + - draft + description: Status of the campaign + example: draft + createSmtpTemplate: + required: + - sender + - subject + - templateName + type: object + properties: + tag: + type: string + description: Tag of the template + example: OrderConfirmation + sender: + type: object + properties: + name: + type: string + description: | + Name of the sender. **If not passed, will be set to default** + example: Mary from MyShop + email: + type: string + description: Email of the sender + format: email + example: contact@myshop.com + id: + type: integer + description: | + Select the sender for the template on the basis of sender id. + _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + format: int64 + example: 3 + description: | + Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: + **{"name":"xyz", "email":"example@abc.com"}** + **{"name":"xyz", "id":123}** + templateName: + type: string + description: Name of the template + example: Order Confirmation - EN + htmlContent: + type: string + description: | + Body of the message (HTML version). The field must have more than 10 characters. **REQUIRED if htmlUrl is empty** + example: The order n°xxxxx has been confirmed. Thanks for your purchase + htmlUrl: + type: string + description: Url which contents the body of the email message. REQUIRED + if htmlContent is empty + format: url + example: https://html.domain.com + subject: + type: string + description: Subject of the template + example: Thanks for your purchase ! + replyTo: + type: string + description: Email on which campaign recipients will be able to reply to + format: email + example: support@myshop.com + toField: + type: string + description: | + To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + example: '{FNAME} {LNAME}' + attachmentUrl: + type: string + description: | + Absolute url of the attachment (**no local file**). Extension allowed: + #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' + format: url + example: https://attachment.domain.com + isActive: + type: boolean + description: Status of template. isActive = true means template is active + and isActive = false means template is inactive + example: true + createEmailCampaign: + required: + - name + - sender + type: object + properties: + tag: + type: string + description: Tag of the campaign + example: Newsletter + sender: + type: object + properties: + name: + type: string + description: Sender Name + example: Mary from MyShop + email: + type: string + description: Sender email + format: email + example: newsletter@myshop.com + id: + type: integer + description: | + Select the sender for the campaign on the basis of sender id. + _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. + format: int64 + example: 3 + description: | + Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: + **{"name":"xyz", "email":"example@abc.com"}** + **{"name":"xyz", "id":123}** + name: + type: string + description: Name of the campaign + example: Newsletter - May 2017 + htmlContent: + type: string + description: | + Mandatory if htmlUrl and templateId are empty. Body of the message (HTML). + example: '

Confirm you email

Please confirm your email address by clicking on the link below

' + htmlUrl: + type: string + description: | + **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: + **https://html.domain.com** + format: url + example: https://html.domain.com + templateId: + type: integer + description: | + **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional + email template with status _active_. Used to copy only its content fetched + from htmlContent/htmlUrl to an email campaign for RSS feature. + format: int64 + scheduledAt: + type: string + description: | + Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. + If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: + **2017-06-01T12:30:00+02:00** + example: 2017-06-01T12:30:00+02:00 + subject: + type: string + description: | + Subject of the campaign. **Mandatory if abTesting is false**. + Ignored if abTesting is true. + example: Discover the New Collection ! + previewText: + type: string + description: Preview text or preheader of the email campaign + example: Thanks for your order! + replyTo: + type: string + description: Email on which the campaign recipients will be able to reply + to + format: email + example: support@myshop.com + toField: + type: string + description: | + To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + example: '{FNAME} {LNAME}' + recipients: + type: object + properties: + exclusionListIds: + type: array + description: List ids to exclude from the campaign + items: + type: integer + format: int64 + example: 8 + listIds: + type: array + description: | + **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to + items: + type: integer + format: int64 + example: 32 + segmentIds: + description: | + **Mandatory if listIds are not used**. Segment ids to send the campaign to. + type: array + items: + type: integer + format: int64 + example: 23 + description: Segment ids and List ids to include/exclude from campaign + attachmentUrl: + type: string + description: | + Absolute url of the attachment (no local file). + Extension allowed: + #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + format: url + example: https://attachment.domain.com + inlineImageActivation: + type: boolean + description: | + Use true to embedded the images in your email. Final size of + the email should be less than **4MB**. Campaigns with embedded images can + _not be sent to more than 5000 contacts_ + example: true + default: false + mirrorActive: + type: boolean + description: Use true to enable the mirror link + example: true + footer: + type: string + description: Footer of the email campaign + example: '[DEFAULT_FOOTER]' + header: + type: string + description: Header of the email campaign + example: '[DEFAULT_HEADER]' + utmCampaign: + type: string + description: Customize the utm_campaign value. If this field is empty, the + campaign name will be used. Only alphanumeric characters and spaces are + allowed + example: NL_05_2017 + params: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** + example: + FNAME: Joe + LNAME: Doe + sendAtBestTime: + type: boolean + description: Set this to true if you want to send your campaign at best time. + example: true + default: false + abTesting: + type: boolean + description: | + Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. + subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. + You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + example: true + default: false + subjectA: + type: string + description: | + Subject A of the campaign. **Mandatory if abTesting = true**. + subjectA & subjectB should have unique value + example: Discover the New Collection! + subjectB: + type: string + description: | + Subject B of the campaign. **Mandatory if abTesting = true**. + subjectA & subjectB should have unique value + example: Want to discover the New Collection? + splitRule: + maximum: 5E+1 + minimum: 1 + type: integer + description: | + Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + format: int64 + example: 50 + winnerCriteria: + type: string + description: | + Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + example: open + enum: + - open + - click + winnerDelay: + maximum: 168 + minimum: 1 + type: integer + description: | + Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed + format: int64 + example: 50 + ipWarmupEnable: + type: boolean + description: | + **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. + example: true + default: false + initialQuota: + type: integer + description: | + **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + format: int64 + example: 3000 + increaseRate: + maximum: 1E+2 + minimum: 0 + type: integer + description: | + **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + format: int64 + example: 70 + unsubscriptionPageId: + description: | + Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. + type: string + example: "62cbb7fabbe85021021aac52" + updateFormId: + description: | + **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. + type: string + example: "6313436b9ad40e23b371d095" + updateEmailCampaign: + type: object + properties: + tag: + type: string + description: Tag of the campaign + example: Newsletter + sender: + type: object + properties: + name: + type: string + description: Sender Name from which the campaign emails are sent + example: Mary from MyShop + email: + type: string + description: Sender email from which the campaign emails are sent + format: email + example: newsletter@myshop.com + id: + type: integer + description: | + Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**. + format: int64 + example: 3 + description: | + Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: + **{"name":"xyz", "email":"example@abc.com"}** + **{"name":"xyz", "id":123}** + name: + type: string + description: Name of the campaign + example: Newsletter - May 2017 + htmlContent: + type: string + description: | + Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty** + example: '

Confirm you email

Please confirm your email address by clicking on the link below

' + htmlUrl: + type: string + description: | + Url which contents the body of the email message. **REQUIRED if htmlContent is empty** + format: url + example: https://html.domain.com + scheduledAt: + type: string + description: | + UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). + **Prefer to pass your timezone in date-time format for accurate result.** + If sendAtBestTime is set to true, your campaign will be sent according + to the date passed (ignoring the time part). + example: 2017-06-01T12:30:00+02:00 + subject: + type: string + description: Subject of the campaign + example: Discover the New Collection ! + previewText: + type: string + description: Preview text or preheader of the email campaign + example: Thanks for your order! + replyTo: + type: string + description: Email on which campaign recipients will be able to reply to + format: email + example: support@myshop.com + toField: + type: string + description: | + To personalize the **To** Field. If you want to include the first + name and last name of your recipient, add **{FNAME} {LNAME}**. These contact + attributes must already exist in your Brevo account. If input parameter + **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization + example: '{FNAME} {LNAME}' + recipients: + type: object + properties: + exclusionListIds: + type: array + description: List ids which have to be excluded from a campaign + items: + type: integer + format: int64 + example: 8 + listIds: + type: array + description: | + Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty** + items: + type: integer + format: int64 + example: 32 + segmentIds: + description: | + **Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to. + type: array + items: + type: integer + format: int64 + example: 23 + description: Segment ids and List ids to include/exclude from campaign + attachmentUrl: + type: string + description: | + Absolute url of the attachment (no local file). + Extension allowed: + #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' + format: url + example: https://attachment.domain.com + inlineImageActivation: + type: boolean + description: | + Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_. + example: true + default: false + mirrorActive: + type: boolean + description: Status of mirror links in campaign. mirrorActive = false means + mirror links are deactivated, & mirrorActive = true means mirror links + are activated, in the campaign + example: true + recurring: + type: boolean + description: | + **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + example: false + default: false + footer: + type: string + description: Footer of the email campaign + example: '[DEFAULT_FOOTER]' + header: + type: string + description: Header of the email campaign + example: '[DEFAULT_HEADER]' + utmCampaign: + type: string + description: Customize the utm_campaign value. If this field is empty, the + campaign name will be used. Only alphanumeric characters and spaces are + allowed + example: NL_05_2017 + params: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** + example: + FNAME: Joe + LNAME: Doe + sendAtBestTime: + type: boolean + description: | + Set this to true if you want to send your campaign at best time. + Note:- **if true, warmup ip will be disabled.** + example: true + abTesting: + type: boolean + description: | + Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. + subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. + You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + example: true + default: false + subjectA: + type: string + description: | + Subject A of the campaign. **Mandatory if abTesting = true**. + subjectA & subjectB should have unique value + example: Discover the New Collection! + subjectB: + type: string + description: | + Subject B of the campaign. **Mandatory if abTesting = true**. + subjectA & subjectB should have unique value + example: Want to discover the New Collection? + splitRule: + maximum: 5E+1 + minimum: 1 + type: integer + description: | + Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + format: int64 + example: 50 + winnerCriteria: + type: string + description: | + Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed + example: open + enum: + - open + - click + winnerDelay: + maximum: 168 + minimum: 1 + type: integer + description: | + Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed + format: int64 + example: 50 + ipWarmupEnable: + type: boolean + description: | + **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. + example: true + default: false + initialQuota: + type: integer + description: | + Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + format: int64 + example: 3000 + increaseRate: + maximum: 1E+2 + minimum: 0 + type: integer + description: | + Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + format: int64 + example: 70 + unsubscriptionPageId: + description: | + Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. + type: string + example: "62cbb7fabbe85021021aac52" + updateFormId: + description: | + **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. + type: string + example: "6313436b9ad40e23b371d095" + getSharedTemplateUrl: + required: + - sharedUrl + type: object + properties: + sharedUrl: + type: string + description: A unique URL for the email campaign or transactional template. + This URL can be shared with other Brevo users. + format: url + example: https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx- + abTestCampaignResult: + type: object + properties: + winningVersion: + type: string + description: Winning Campaign Info. pending = Campaign has been picked for + sending and winning version is yet to be decided, tie = A tie happened + between both the versions, notAvailable = Campaign has not yet been picked + for sending. + example: A + enum: + - notAvailable + - pending + - tie + - A + - B + winningCriteria: + type: string + description: Criteria choosen for winning version (Open/Click) + example: Open + enum: + - Open + - Click + winningSubjectLine: + type: string + description: Subject Line of current winning version + example: Subject Line A + openRate: + type: string + description: Open rate for current winning version + example: 70% + clickRate: + type: string + description: Click rate for current winning version + example: 70% + winningVersionRate: + type: string + description: Open/Click rate for the winner version + example: 70% + statistics: + required: + - clicks + - complaints + - hardBounces + - openers + - softBounces + - unsubscribed + type: object + properties: + openers: + $ref: '#/components/schemas/abTestVersionStats' + clicks: + $ref: '#/components/schemas/abTestVersionStats' + unsubscribed: + $ref: '#/components/schemas/abTestVersionStats' + hardBounces: + $ref: '#/components/schemas/abTestVersionStats' + softBounces: + $ref: '#/components/schemas/abTestVersionStats' + complaints: + $ref: '#/components/schemas/abTestVersionStats' + clickedLinks: + required: + - Version A + - Version B + type: object + properties: + Version A: + $ref: '#/components/schemas/abTestVersionClicks' + Version B: + $ref: '#/components/schemas/abTestVersionClicks' + emailExportRecipients: + required: + - recipientsType + type: object + properties: + notifyURL: + type: string + description: Webhook called once the export process is finished. For reference, + https://help.brevo.com/hc/en-us/articles/360007666479 + format: url + example: http://requestb.in/173lyyx1 + recipientsType: + type: string + description: Type of recipients to export for a campaign + example: openers + enum: + - all + - nonClickers + - nonOpeners + - clickers + - openers + - softBounces + - hardBounces + - unsubscribed + requestSmsRecipientExport: + required: + - recipientsType + type: object + properties: + notifyURL: + type: string + description: URL that will be called once the export process is finished. + For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + format: url + example: http://requestb.in/173lyyx1 + recipientsType: + type: string + description: Filter the recipients based on how they interacted with the + campaign + example: answered + enum: + - all + - delivered + - answered + - softBounces + - hardBounces + - unsubscribed + sendReport: + required: + - email + type: object + properties: + language: + type: string + description: Language of email content for campaign report sending. + example: en + default: fr + enum: + - fr + - es + - pt + - it + - de + - en + email: + required: + - body + - to + type: object + properties: + to: + type: array + description: Email addresses of the recipients + items: + type: string + description: Email address of the recipient + format: email + example: jim.suehan@example.com + body: + type: string + description: Custom text message to be presented in the report email. + example: Please find attached the report of our last email campaign. + description: Custom attributes for the report email. + uploadImageToGallery: + required: + - imageUrl + type: object + properties: + imageUrl: + type: string + description: | + The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. + Allowed extensions for images are: + #### jpeg, jpg, png, bmp, gif. + example: https://somedomain.com/image1.jpg + name: + type: string + description: Name of the image. + example: nature.jpg + sendSmtpEmail: + type: object + properties: + sender: + description: | + **Mandatory if `templateId` is not passed**. Pass name (_optional_) and email or id of sender from which emails will be sent. **`name` will be ignored if passed along with sender `id`**. For example, + **{"name":"Mary from MyShop", "email":"no-reply@myshop.com"}** + **{"id":2}** + type: object + properties: + name: + type: string + description: | + description: Name of the sender from which the emails will be sent. **Maximum allowed characters are 70**. Applicable only when email is passed. + example: Mary from MyShop + email: + type: string + description: Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. + format: email + example: no-reply@myshop.com + id: + type: integer + description: Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. + format: int64 + example: 2 + to: + type: array + description: | + **Mandatory if messageVersions are not passed, ignored if messageVersions are passed** + List of email addresses and names (_optional_) of the recipients. For example, + **[{"name":"Jimmy", "email":"jimmy98@example.com"}, {"name":"Joe", "email":"joe@example.com"}]** + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient + format: email + example: jimmy98@example.com + name: + type: string + description: | + Name of the recipient. **Maximum allowed characters are 70**. + example: Jimmy + bcc: + type: array + description: | + List of email addresses and names (_optional_) of the recipients in bcc + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient in bcc + format: email + example: helen9766@example.com + name: + type: string + description: | + Name of the recipient in bcc. **Maximum allowed characters are 70**. + example: Helen + cc: + type: array + description: | + List of email addresses and names (_optional_) of the recipients in cc + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient in cc + format: email + example: ann6533@example.com + name: + type: string + description: | + Name of the recipient in cc. **Maximum allowed characters are 70**. + example: Ann + htmlContent: + type: string + description: | + HTML body of the message. **Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed** + example:

Confirm you email

Please + confirm your email address by clicking on the link below

+ textContent: + type: string + description: | + Plain Text body of the message. **Ignored if 'templateId' is passed** + example: Please confirm your email address by clicking on the link https://text.domain.com + subject: + type: string + description: | + Subject of the message. **Mandatory if 'templateId' is not passed** + example: Login Email confirmation + replyTo: + required: + - email + type: object + properties: + email: + type: string + description: Email address in reply to + format: email + example: ann6533@example.com + name: + type: string + description: | + Name in reply to. **Maximum allowed characters are 70**. + example: Ann + description: | + Email (**required**), along with name (_optional_), on which transactional mail recipients will be able to reply back. For example, + **{"email":"ann6533@example.com", "name":"Ann"}** + attachment: + type: array + description: | + Pass the _absolute URL_ (**no local file**) or the _base64 content_ of the attachment along with the attachment name. **Mandatory if attachment content is passed**. For example, + **[{"url":"https://attachment.domain.com/myAttachmentFromUrl.jpg", "name":"myAttachmentFromUrl.jpg"}, {"content":"base64 example content", "name":"myAttachmentFromBase64.jpg"}]**. + Allowed extensions for attachment file: + #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm. + If `templateId` is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then `attachment` is ignored + items: + type: object + properties: + url: + type: string + description: | + Absolute url of the attachment (**no local file**). + format: url + example: https://attachment.domain.com/myAttachmentFromUrl.jpg + content: + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + description: Base64 encoded chunk data of the attachment generated + on the fly + format: byte + example: b3JkZXIucGRm + name: + type: string + description: | + **Required if content is passed**. Name of the attachment + example: myAttachment.png + headers: + type: object + additionalProperties: { } + description: | + Pass the set of custom headers (_not the standard headers_) that shall be sent along the mail headers in the original email. **'sender.ip'** header can be set (**only for dedicated ip users**) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, + **{"sender.ip":"1.2.3.4", "X-Mailin-custom":"some_custom_header", "idempotencyKey":"abc-123"}**. + example: + sender.ip: 1.2.3.4 + X-Mailin-custom: some_custom_header + idempotencyKey: abc-123 + templateId: + type: integer + description: Id of the template. + format: int64 + example: 2 + params: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to customize the template. For example, **{"FNAME":"Joe", "LNAME":"Doe"}**. It's **considered only if template is in New Template Language format**. + example: + FNAME: Joe + LNAME: Doe + messageVersions: + type: array + description: | + You can customize and send out multiple versions of a mail. **templateId** can be customized only if global parameter contains templateId. **htmlContent and textContent** can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. + Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. + The size of individual params in all the messageVersions shall not exceed **100 KB** limit and that of cumulative params shall not exceed **1000 KB**. + You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - **https://developers.brevo.com/docs/batch-send-transactional-emails** + items: + type: object + required: + - to + properties: + to: + type: array + description: | + List of email addresses and names (_optional_) of the recipients. For example, + **[{"name":"Jimmy", "email":"jimmy98@example.com"}, {"name":"Joe", "email":"joe@example.com"}]** + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient + format: email + example: jimmy98@example.com + name: + type: string + description: | + Name of the recipient. **Maximum allowed characters are 70**. + example: Jimmy + params: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to customize the template. For example, **{"FNAME":"Joe", "LNAME":"Doe"}**. It's **considered only if template is in New Template Language format**. + example: + FNAME: Joe + LNAME: Doe + bcc: + type: array + description: | + List of email addresses and names (_optional_) of the recipients in bcc + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient in bcc + format: email + example: helen9766@example.com + name: + type: string + description: | + Name of the recipient in bcc. **Maximum allowed characters are 70**. + example: Helen + cc: + type: array + description: | + List of email addresses and names (_optional_) of the recipients in cc + items: + required: + - email + type: object + properties: + email: + type: string + description: Email address of the recipient in cc + format: email + example: ann6533@example.com + name: + type: string + description: | + Name of the recipient in cc. **Maximum allowed characters are 70**. + example: Ann + replyTo: + required: + - email + type: object + properties: + email: + type: string + description: Email address in reply to + format: email + example: ann6533@example.com + name: + type: string + description: | + Name in reply to. **Maximum allowed characters are 70**. + example: Ann + description: | + Email (**required**), along with name (_optional_), on which transactional mail recipients will be able to reply back. For example, + **{"email":"ann6533@example.com", "name":"Ann"}** + subject: + type: string + description: | + Custom subject specific to message version + example: Login Email confirmation + tags: + type: array + description: Tag your emails to find them more easily + items: + type: string + example: tag1 + scheduledAt: + type: string + description: UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. + format: date-time + example: '2022-04-05T12:30:00+02:00' + batchId: + type: string + description: Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. + example: '5c6cfa04-eed9-42c2-8b5c-6d470d978e9d' + deleteHardbounces: + type: object + properties: + startDate: + type: string + description: Starting date (YYYY-MM-DD) of the time period for deletion. + The hardbounces occurred after this date will be deleted. Must be less + than or equal to the endDate + example: 2016-12-31 + endDate: + type: string + description: Ending date (YYYY-MM-DD) of the time period for deletion. The + hardbounces until this date will be deleted. Must be greater than or equal + to the startDate + example: 2017-01-31 + contactEmail: + type: string + description: Target a specific email address + format: email + example: alex76@example.com + blockDomain: + type: object + required: + - domain + properties: + domain: + type: string + description: name of the domain to be blocked + example: "example.com" + createWebhook: + required: + - events + - url + type: object + properties: + url: + type: string + description: URL of the webhook + format: url + example: http://requestb.in/173lyyx1 + description: + type: string + description: Description of the webhook + example: Webhook triggered on unsubscription + events: + type: array + description: | + - Events triggering the webhook. Possible values for **Transactional** type webhook: + #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` + - Possible values for **Marketing** type webhook: + #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` + - Possible values for **Inbound** type webhook: + #### `inboundEmailProcessed` + items: + type: string + example: unsubscribed + enum: + - sent + - hardBounce + - softBounce + - blocked + - spam + - delivered + - request + - click + - invalid + - deferred + - opened + - uniqueOpened + - unsubscribed + - listAddition + - contactUpdated + - contactDeleted + - inboundEmailProcessed + type: + type: string + description: Type of the webhook + example: marketing + default: transactional + enum: + - transactional + - marketing + - inbound + domain: + type: string + description: Inbound domain of webhook, required in case of event type `inbound` + example: example.com + batched: + type: boolean + description: Batching configuration of the webhook, we send batched webhooks if its true + example: true + auth: + type: object + description: Authentication header to be send with the webhook requests + example: + type: bearer + token: test-auth-token1234 + headers: + type: array + items: + type: object + description: Headers send with the requests to the webhook + example: + key: cf-secret + value: test-header-value + updateWebhook: + type: object + properties: + url: + type: string + description: URL of the webhook + format: url + example: http://requestb.in/173lyyx1 + description: + type: string + description: Description of the webhook + example: Webhook triggered on contact hardbounce + events: + type: array + description: | + - Events triggering the webhook. Possible values for **Transactional** type webhook: + #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` + - Possible values for **Marketing** type webhook: + #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` + - Possible values for **Inbound** type webhook: + #### `inboundEmailProcessed` + items: + type: string + example: hardBounce + enum: + - sent + - hardBounce + - softBounce + - blocked + - spam + - delivered + - request + - click + - invalid + - deferred + - opened + - uniqueOpened + - unsubscribed + - listAddition + - contactUpdated + - contactDeleted + - inboundEmailProcessed + domain: + type: string + description: Inbound domain of webhook, used in case of event type `inbound` + example: example.com + batched: + type: boolean + description: Batching configuration of the webhook, we send batched webhooks if its true + example: true + auth: + type: object + description: Authentication header to be send with the webhook requests + example: + type: bearer + token: test-auth-token1234 + headers: + type: array + items: + type: object + description: Headers send with the requests to the webhook + example: + key: cf-secret + value: test-header-value + createDoiContact: + required: + - email + - includeListIds + - redirectionUrl + - templateId + type: object + properties: + email: + type: string + description: Email address where the confirmation email will be sent. This + email address will be the identifier for all other contact attributes. + format: email + example: elly@example.com + attributes: + type: object + additionalProperties: { } + description: | + Pass the set of attributes and their values. **These attributes must be present in your Brevo account**. For eg. **{'FNAME':'Elly', 'LNAME':'Roger'}** + example: + FNAME: Elly + LNAME: Roger + includeListIds: + type: array + description: Lists under user account where contact should be added + items: + type: integer + description: Id of the list + format: int64 + example: 36 + excludeListIds: + type: array + description: Lists under user account where contact should not be added + items: + type: integer + description: Id of the list + format: int64 + example: 36 + templateId: + type: integer + description: Id of the Double opt-in (DOI) template + format: int64 + example: 2 + redirectionUrl: + type: string + description: | + URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag **{{ params.DOIurl }}**. + format: url + example: http://requestb.in/173lyyx1 + createContact: + type: object + properties: + email: + type: string + description: | + Email address of the user. **Mandatory if "SMS" field is not passed in "attributes" parameter**. Mobile Number in **SMS** field should be passed with proper country code. For example: + **{"SMS":"+91xxxxxxxxxx"}** or **{"SMS":"0091xxxxxxxxxx"}** + format: email + example: elly@example.com + ext_id: + description: Pass your own Id to create a contact. + type: string + example: 'externalId' + attributes: + type: object + additionalProperties: { } + description: | + Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account.**. For eg: + **{"FNAME":"Elly", "LNAME":"Roger"}** + example: + FNAME: Elly + LNAME: Roger + emailBlacklisted: + type: boolean + description: Set this field to blacklist the contact for emails (emailBlacklisted + = true) + example: false + smsBlacklisted: + type: boolean + description: Set this field to blacklist the contact for SMS (smsBlacklisted + = true) + example: false + listIds: + type: array + description: Ids of the lists to add the contact to + items: + type: integer + description: Id of the list to add the contact to + format: int64 + example: 36 + updateEnabled: + type: boolean + description: Facilitate to update the existing contact in the same request + (updateEnabled = true) + example: false + default: false + smtpBlacklistSender: + type: array + description: transactional email forbidden sender for contact. Use only + for email Contact ( only available if updateEnabled = true ) + items: + type: string + format: email + updateContact: + type: object + properties: + attributes: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger"}**. + The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** + example: + EMAIL: newemail@domain.com + FNAME: Ellie + LNAME: Roger + ext_id: + description: Pass your own Id to update ext_id of a contact. + type: string + example: 'updateExternalId' + emailBlacklisted: + type: boolean + description: Set/unset this field to blacklist/allow the contact for emails + (emailBlacklisted = true) + example: false + smsBlacklisted: + type: boolean + description: Set/unset this field to blacklist/allow the contact for SMS + (smsBlacklisted = true) + example: true + listIds: + type: array + description: Ids of the lists to add the contact to + items: + type: integer + description: Id of the list to add the contact to + format: int64 + example: 65 + unlinkListIds: + type: array + description: Ids of the lists to remove the contact from + items: + type: integer + description: Id of the list to remove the contact from + format: int64 + example: 36 + smtpBlacklistSender: + type: array + description: transactional email forbidden sender for contact. Use only + for email Contact + items: + type: string + format: email + updateBatchContacts: + type: object + properties: + contacts: + type: array + description: List of contacts to be updated + items: + type: object + properties: + email: + type: string + description: Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + format: email + example: elly@example.com + id: + type: integer + description: id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + format: int64 + example: 31 + sms: + type: string + description: SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + example: +91xxxxxxxxxx + ext_id: + description: Pass your own Id to update ext_id of a contact. + type: string + example: 'UpdateExternalId' + attributes: + type: object + additionalProperties: { } + description: | + Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger"}**. + Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** + example: + EMAIL: newemail@domain.com + FNAME: Ellie + LNAME: Roger + emailBlacklisted: + type: boolean + description: Set/unset this field to blacklist/allow the contact for emails + (emailBlacklisted = true) + example: false + smsBlacklisted: + type: boolean + description: Set/unset this field to blacklist/allow the contact for SMS + (smsBlacklisted = true) + example: true + listIds: + type: array + description: Ids of the lists to add the contact to + items: + type: integer + description: Id of the list to add the contact to + format: int64 + example: 65 + unlinkListIds: + type: array + description: Ids of the lists to remove the contact from + items: + type: integer + description: Id of the list to remove the contact from + format: int64 + example: 36 + smtpBlacklistSender: + type: array + description: transactional email forbidden sender for contact. Use only + for email Contact + items: + type: string + format: email + createAttribute: + type: object + properties: + value: + type: string + description: | + Value of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** + example: COUNT[BLACKLISTED,BLACKLISTED,<,NOW()] + isRecurring: + type: boolean + description: | + Type of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** + example: true + enumeration: + type: array + description: | + List of values and labels that the attribute can take. **Use only if the attribute's category is "category"**. For example: + **[{"value":1, "label":"male"}, {"value":2, "label":"female"}]** + items: + required: + - label + - value + type: object + properties: + value: + type: integer + description: Id of the value + example: 1 + label: + type: string + description: Label of the value + example: Women + type: + type: string + description: | + Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** + Type **boolean** is only available if the category is **normal** attribute + Type **id** is only available if the category is **transactional** attribute + Type **category** is only available if the category is **category** attribute + example: text + enum: + - text + - date + - float + - boolean + - id + - category + updateAttribute: + type: object + properties: + value: + type: string + description: | + Value of the attribute to update. **Use only if the attribute's category is 'calculated' or 'global'** + example: COUNT[BLACKLISTED,BLACKLISTED,<,NOW()] + enumeration: + type: array + description: | + List of the values and labels that the attribute can take. **Use only if the attribute's category is "category"**. For example, + **[{"value":1, "label":"male"}, {"value":2, "label":"female"}]** + items: + required: + - label + - value + type: object + properties: + value: + type: integer + description: Id of the value + example: 1 + label: + type: string + description: Label of the value + example: Men + createList: + required: + - folderId + - name + type: object + properties: + name: + type: string + description: Name of the list + example: Magento Customer - ES + folderId: + type: integer + description: Id of the parent folder in which this list is to be created + format: int64 + example: 2 + updateList: + type: object + properties: + name: + type: string + description: Name of the list. Either of the two parameters (name, folderId) + can be updated at a time. + example: Magento Customer - ES + folderId: + type: integer + description: Id of the folder in which the list is to be moved. Either of + the two parameters (name, folderId) can be updated at a time. + format: int64 + example: 2 + requestContactExport: + type: object + required: + - customContactFilter + properties: + exportAttributes: + type: array + description: | + List of all the attributes that you want to export. **These attributes must be present in your contact database.** For example: + **['fname', 'lname', 'email']** + items: + type: string + example: NAME + customContactFilter: + type: object + properties: + actionForContacts: + type: string + description: | + **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. + * **allContacts** - Fetch the list of all contacts for a particular list. + * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. + * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. + enum: + - allContacts + - subscribed + - unsubscribed + - unsubscribedPerList + actionForEmailCampaigns: + type: string + description: | + **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. + * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. + * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. + * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. + * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). + enum: + - openers + - nonOpeners + - clickers + - nonClickers + - unsubscribed + - hardBounces + - softBounces + actionForSmsCampaigns: + type: string + description: | + **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. + * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. + * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. + enum: + - hardBounces + - softBounces + - unsubscribed + listId: + type: integer + description: | + **Mandatory if actionForContacts is passed, ignored otherwise.** Id of the list for which the corresponding action shall be applied in the filter. + format: int64 + example: 2 + emailCampaignId: + type: integer + description: | + Considered only if **actionForEmailCampaigns** is passed, ignored otherwise. **Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed.** + The id of the email campaign for which the corresponding action shall be applied in the filter. + format: int64 + example: 12 + smsCampaignId: + type: integer + description: | + Considered only if **actionForSmsCampaigns** is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. + format: int64 + example: 12 + description: | + Set the filter for the contacts to be exported. + notifyUrl: + type: string + description: Webhook that will be called once the export process is finished. + For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + format: url + example: http://requestb.in/173lyyx1 + requestContactImport: + type: object + properties: + fileUrl: + type: string + description: | + **Mandatory if fileBody and jsonBody is not defined.** URL of the file to be imported (**no local file**). Possible file formats: + #### .txt, .csv, .json + format: url + example: https://importfile.domain.com + fileBody: + type: string + description: | + **Mandatory if fileUrl and jsonBody is not defined.** CSV content to be imported. Use semicolon to separate multiple attributes. **Maximum allowed file body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. + example: "NAME;SURNAME;EMAIL\nSmith;John;john.smith@example.com\nRoger;Ellie;ellie36@example.com" + jsonBody: + type: array + description: | + **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. + items: + type: object + properties: + email: + type: string + attributes: + type: object + additionalProperties: true + description: List of attributes to be imported + example: { "email": "ndicky0@ocn.ne.jp","attributes": { "LNAME": "Noemi","FNAME": "Dicky","COUNTRY": "DE","BIRTHDAY": "11/02/1989","PREFERED_COLOR": "BLACK","WHATSAPP": "33689965433","LANDLINE_NUMBER": "33689965433", "SMS": "33689965433" } } + listIds: + type: array + description: | + **Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**. + items: + type: integer + description: List Id in which the contacts shall be imported + format: int64 + example: 76 + notifyUrl: + type: string + description: URL that will be called once the import process is finished. + For reference, https://help.brevo.com/hc/en-us/articles/360007666479 + format: url + example: http://requestb.in/173lyyx1 + newList: + type: object + properties: + listName: + type: string + description: | + List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**. + example: ContactImport - 2017-05 + folderId: + type: integer + description: | + Id of the folder where this new list shall be created. **Mandatory if listName is not empty** + format: int64 + example: 2 + description: To create a new list and import the contacts into it, pass + the listName and an optional folderId. + emailBlacklist: + type: boolean + description: To blacklist all the contacts for email + example: false + default: false + disableNotification: + type: boolean + description: To disable email notification + example: false + default: false + smsBlacklist: + type: boolean + description: To blacklist all the contacts for sms + example: false + default: false + updateExistingContacts: + type: boolean + description: To facilitate the choice to update the existing contacts + example: true + default: true + emptyContactsAttributes: + type: boolean + description: | + To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( **only available if `updateExistingContacts` set to true **) + example: true + default: false + createSmsCampaign: + required: + - content + - name + - sender + type: object + properties: + name: + type: string + description: Name of the campaign + example: Spring Promo Code + sender: + maxLength: 15 + type: string + description: | + Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + example: MyShop + content: + type: string + description: | + Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS + example: 'Get a discount by visiting our NY store and saying : Happy Spring!' + recipients: + required: + - listIds + type: object + properties: + listIds: + type: array + description: | + Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** + items: + type: integer + description: List Id to send the campaign to + format: int64 + example: 54 + exclusionListIds: + type: array + description: List ids which have to be excluded from a campaign + items: + type: integer + description: List Id to exclude from the campaign + format: int64 + example: 15 + scheduledAt: + type: string + description: | + UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + example: 2017-05-05T12:30:00+02:00 + unicodeEnabled: + type: boolean + description: | + Format of the message. It indicates whether the content should be treated as unicode or not. + example: true + default: false + organisationPrefix: + description: A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + type: string + example: MyCompany + unsubscribeInstruction: + description: Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** + type: string + example: send Stop if you want to unsubscribe. + updateSmsCampaign: + type: object + properties: + name: + type: string + description: Name of the campaign + example: Spring Promo Code + sender: + maxLength: 15 + type: string + description: | + Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + example: MyShop + content: + type: string + description: | + Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS + example: 'Get a discount by visiting our NY store and saying : Happy Spring!' + recipients: + required: + - listIds + type: object + properties: + listIds: + type: array + description: | + Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** + items: + type: integer + description: List Id to send the campaign to + format: int64 + example: 54 + exclusionListIds: + type: array + description: List ids which have to be excluded from a campaign + items: + type: integer + description: List Id to exclude from the campaign + format: int64 + example: 15 + scheduledAt: + type: string + description: | + UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** + example: 2017-05-05T12:30:00+02:00 + unicodeEnabled: + type: boolean + description: | + Format of the message. It indicates whether the content should be treated as unicode or not. + example: true + default: false + organisationPrefix: + description: A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + type: string + example: MyCompany + unsubscribeInstruction: + description: Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** + type: string + example: send Stop if you want to unsubscribe. + sendTransacSms: + required: + - content + - recipient + - sender + type: object + properties: + sender: + maxLength: 15 + type: string + description: | + Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + example: MyShop + recipient: + type: string + description: Mobile number to send SMS with the country code + example: "33689965433" + content: + type: string + description: | + Content of the message. If more than **160 characters** long, will be sent as multiple text messages + example: Enter this code:CCJJG8 to validate your account + type: + type: string + description: Type of the SMS. Marketing SMS messages are those sent typically + with marketing content. Transactional SMS messages are sent to individuals + and are triggered in response to some action, such as a sign-up, purchase, + etc. + example: marketing + default: transactional + enum: + - transactional + - marketing + tag: + type: string + description: Tag of the message + example: accountValidation + webUrl: + type: string + description: Webhook to call for each event triggered by the message (delivered + etc.) + format: url + example: http://requestb.in/173lyyx1 + unicodeEnabled: + type: boolean + description: | + Format of the message. It indicates whether the content should be treated as unicode or not. + example: true + default: false + organisationPrefix: + type: string + description: A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** + example: MyCompany + sendTestEmail: + type: object + properties: + emailTo: + type: array + description: | + List of the email addresses of the recipients whom you wish to send the test mail. + _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_. + items: + type: string + description: Email addres of the recipient + format: email + example: helen.jurger@example.com + sendTestSms: + type: object + properties: + phoneNumber: + type: string + description: | + Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** + example: "33689965433" + getTransacAggregatedSmsReport: + type: object + properties: + range: + type: string + description: Time frame of the report + example: 2016-09-08|2017-04-06 + requests: + type: integer + description: Number of requests for the timeframe + format: int64 + example: 263 + delivered: + type: integer + description: Number of delivered SMS for the timeframe + format: int64 + example: 249 + hardBounces: + type: integer + description: Number of hardbounces for the timeframe + format: int64 + example: 1 + softBounces: + type: integer + description: Number of softbounces for the timeframe + format: int64 + example: 4 + blocked: + type: integer + description: Number of blocked contact for the timeframe + format: int64 + example: 2 + unsubscribed: + type: integer + description: Number of unsubscription for the timeframe + format: int64 + example: 6 + replied: + type: integer + description: Number of answered SMS for the timeframe + format: int64 + example: 12 + accepted: + type: integer + description: Number of accepted for the timeframe + format: int64 + example: 252 + rejected: + type: integer + description: Number of rejected for the timeframe + format: int64 + example: 8 + getTransacSmsReport: + type: object + properties: + reports: + type: array + items: + type: object + properties: + date: + type: string + description: Date for which statistics are retrieved + format: date + example: 2017-03-17 + requests: + type: integer + description: Number of requests for the date + format: int64 + example: 87 + delivered: + type: integer + description: Number of delivered SMS for the date + format: int64 + example: 85 + hardBounces: + type: integer + description: Number of hardbounces for the date + format: int64 + example: 1 + softBounces: + type: integer + description: Number of softbounces for the date + format: int64 + example: 1 + blocked: + type: integer + description: Number of blocked contact for the date + format: int64 + example: 0 + unsubscribed: + type: integer + description: Number of unsubscription for the date + format: int64 + example: 1 + replied: + type: integer + description: Number of answered SMS for the date + format: int64 + example: 2 + accepted: + type: integer + description: Number of accepted for the date + format: int64 + example: 85 + rejected: + type: integer + description: Number of rejected for the date + format: int64 + example: 1 + getIp: + required: + - active + - domain + - id + - ip + type: object + properties: + id: + type: integer + description: ID of the dedicated IP + format: int64 + example: 3 + ip: + type: string + description: Dedicated IP + example: 123.65.8.22 + active: + type: boolean + description: Status of the IP (true=active, false=inactive) + example: true + domain: + type: string + description: Domain associated to the IP + example: mailing.myshop.com + getIpsFromSender: + required: + - ips + type: object + properties: + ips: + type: array + description: Dedicated IP(s) linked to a sender + items: + $ref: '#/components/schemas/getIpFromSender' + getIps: + required: + - ips + type: object + properties: + ips: + type: array + description: Dedicated IP(s) available on your account + items: + $ref: '#/components/schemas/getIp' + getIpFromSender: + required: + - domain + - id + - ip + - weight + type: object + properties: + id: + type: integer + description: ID of the dedicated IP + format: int64 + example: 3 + ip: + type: string + description: Dedicated IP + example: 123.65.8.22 + domain: + type: string + description: Domain associated to the IP + example: mailing.myshop.dom + weight: + type: integer + description: Weight of the IP + format: int64 + example: 75 + manageIp: + type: object + properties: + ip: + type: string + description: Dedicated ID + example: 123.65.8.22 + getTransacEmailContent: + required: + - attachmentCount + - body + - date + - email + - events + - subject + type: object + properties: + email: + type: string + description: Email address to which transactional email has been sent + format: email + example: abc@example.com + subject: + type: string + description: Subject of the sent email + example: Summer Camp + templateId: + type: integer + description: Id of the template + format: int64 + example: 2 + date: + type: string + description: Date on which transactional email was sent + example: 2017-03-12T12:30:00Z + events: + type: array + description: Series of events which occurred on the transactional email + items: + required: + - name + - time + type: object + properties: + name: + type: string + description: Name of the event that occurred on the sent email + example: delivered + time: + type: string + description: Time at which the event occurred + example: 2017-03-12T12:30:00Z + body: + type: string + description: Actual content of the transactional email that has been sent + example:

Greetings from the team

+

This is the actual html content sent

+ attachmentCount: + type: integer + description: Count of the attachments that were sent in the email + format: int64 + example: 2 + getTransacEmailsList: + type: object + properties: + count: + type: integer + description: Total number of transactional emails available on your account according to the passed filter + format: int64 + example: 5 + transactionalEmails: + type: array + items: + required: + - date + - email + - messageId + - subject + - uuid + type: object + properties: + email: + type: string + description: Email address to which transactional email has been sent + format: email + example: john.smith@example.com + subject: + type: string + description: Subject of the sent email + example: Summer Camp + templateId: + type: integer + description: Id of the template + format: int64 + example: 2 + messageId: + type: string + description: Message Id of the sent email + example: <201798300811.5700093@relay.domain.com> + uuid: + type: string + description: Unique id of the email sent to a particular contact + example: 5a78c-209ok98262910-s99a341 + date: + type: string + description: Date on which transactional email was sent + example: 2017-03-12T12:30:00Z + from: + type: string + description: Email address of the sender from which the email was + sent + format: email + example: diana.doe@example.com + tags: + type: array + description: Tags used for your email + items: + type: string + example: tag1 + getBlockedDomains: + type: object + required: + - domains + properties: + domains: + description: List of all blocked domains + type: array + items: + type: string + description: name of blocked domain + example: "contact.com" + abTestVersionStats: + required: + - Version A + - Version B + type: object + properties: + Version A: + type: string + description: percentage of an event for version A + example: 50% + Version B: + type: string + description: percentage of an event for version B + example: 50% + description: Percentage of a particular event for both versions + abTestVersionClicks: + type: array + description: Information on clicked links for a particular version + items: + required: + - clickRate + - clicksCount + - link + type: object + properties: + link: + type: string + description: URL of the link + example: https://facbook.com/versionA + clicksCount: + type: integer + description: Number of times a link is clicked + format: int64 + example: 3.0 + clickRate: + type: string + description: Percentage of clicks of link with respect to total clicks + example: 40% + getInboundEmailEvents: + type: object + properties: + events: + type: array + items: + type: object + required: + - uuid + - sender + - date + - recipient + properties: + uuid: + description: 'UUID that can be used to fetch additional data' + type: string + format: uuid + date: + description: 'Date when email was received on SMTP relay' + type: string + format: date-time + sender: + description: 'Sender’s email address' + type: string + format: email + recipient: + description: 'Recipient’s email address' + type: string + format: email + getInboundEmailEventsByUuid: + type: object + properties: + receivedAt: + description: 'Date when email was received on SMTP relay' + type: string + format: date-time + example: "2019-05-25T11:53:26Z" + deliveredAt: + description: 'Date when email was delivered successfully to client’s webhook' + type: string + nullable: true + format: date-time + recipient: + description: 'Recipient’s email address' + type: string + format: email + sender: + description: 'Sender’s email address' + type: string + format: email + messageId: + description: 'Value of the Message-ID header. This will be present only after the processing is done.' + type: string + subject: + description: 'Value of the Subject header. This will be present only after the processing is done. ' + type: string + attachments: + description: 'List of attachments of the email. This will be present only after the processing is done.' + type: array + items: + type: object + properties: + name: + description: 'filename specified in the Content-Disposition header of the attachment' + type: string + contentType: + description: 'value of the Content-Type header of the attachment' + type: string + contentId: + description: 'value of the Content-ID header of the attachment.' + type: string + contentLength: + description: 'size of the attachment in bytes' + type: integer + logs: + description: 'List of events/logs that describe the lifecycle of the email on SIB platform' + type: array + items: + type: object + properties: + date: + description: 'Date of the event' + type: string + format: date-time + type: + description: 'Type of the event' + type: string + enum: + - received + - processed + - webhookFailed + - webhookDelivered + getScheduledEmailByBatchId: + type: object + properties: + count: + type: integer + description: 'Total number of batches' + batches: + type: array + items: + type: object + required: + - scheduledAt + - createdAt + - status + properties: + scheduledAt: + description: 'Datetime for which the batch was scheduled' + type: string + format: date-time + createdAt: + description: 'Datetime on which the batch was scheduled' + type: string + format: date-time + status: + description: 'Current status of the scheduled batch' + type: string + enum: + - inProgress + - queued + - processed + - error + getScheduledEmailByMessageId: + type: object + required: + - scheduledAt + - createdAt + - status + properties: + scheduledAt: + description: 'Datetime for which the email was scheduled' + type: string + format: date-time + createdAt: + description: 'Datetime on which the email was scheduled' + type: string + format: date-time + status: + description: 'Current status of the scheduled email' + type: string + enum: + - inProgress + - queued + - processed + - error + subAccountsResponse: + type: object + properties: + count: + type: integer + description: 'Total number of subaccounts' + subAccounts: + type: array + items: + type: object + required: + - id + - companyName + - active + - createdAt + properties: + id: + description: 'id of the sub-account' + type: integer + format: int64 + companyName: + description: 'Name of the sub-account company' + type: string + active: + description: 'Whether the sub-account is active or not' + type: boolean + createdAt: + description: 'Timestamp when the sub-account was created' + type: integer + format: int64 + createSubAccount: + type: object + required: + - companyName + - email + properties: + companyName: + description: 'Set the name of the sub-account company' + type: string + email: + description: 'Email address for the organization' + type: string + language: + description: 'Set the language of the sub-account' + type: string + enum: + - en + - fr + - it + - es + - pt + - de + timezone: + description: 'Set the timezone of the sub-account' + type: string + example: + companyName: 'Test Sub-account' + email: test-sub@example.com + timezone: Europe/Paris + language: en + createSubAccountResponse: + required: + - id + type: object + properties: + id: + type: integer + description: ID of the sub-account created + format: int64 + example: 5 + corporateGroupDetailsResponse: + type: object + properties: + group: + type: object + properties: + id: + type: string + description: Group id + groupName: + type: string + description: Name of the group + createdAt: + type: string + description: Group creation date + sub-accounts: + type: array + items: + type: object + properties: + id: + type: integer + format: int64 + description: Id of the sub-account organzation + companyName: + type: string + description: Name of the sub-account organzation + createdAt: + type: string + description: Creation date of the sub-account organzation + users: + type: array + items: + type: object + properties: + email: + type: string + description: Email address of the user + lastName: + type: string + description: Last name of the user + firstName: + type: string + description: First name of the user + masterDetailsResponse: + type: object + properties: + email: + type: string + description: Email id of master account + companyName: + type: string + description: Company name of master account organization + id: + type: integer + format: int64 + description: Unique identifier of the master account organization + currencyCode: + type: string + description: Currency code of the master account organization + timezone: + type: string + description: Timezone of the master account organization + billingInfo: + type: object + description: Billing details of the master account organization + properties: + email: + type: string + description: Billing email id of master account + companyName: + type: string + description: Company name of master account + name: + type: object + description: Billing name of master account holder + properties: + givenName: + type: string + description: First name for billing + familyName: + type: string + description: Last name for billing + address: + type: object + description: Billing address of master account + properties: + streetAddress: + type: string + description: Street address + locality: + type: string + description: Locality + postalCode: + type: string + description: Postal code + stateCode: + type: string + description: State code + countryCode: + type: string + description: Country code + planInfo: + type: object + description: Plan details + properties: + currencyCode: + type: string + description: Plan currency + nextBillingAt: + type: integer + format: int64 + description: Timestamp of next billing date + price: + type: number + description: Plan amount + planPeriod: + type: string + description: Plan period type + enum: + - month + - year + subAccounts: + type: integer + description: Number of sub-accounts + features: + type: array + description: List of provided features in the plan + items: + type: object + properties: + name: + type: string + description: Name of the feature + unitValue: + type: string + description: Unit value of the feature + quantity: + type: integer + format: int64 + description: Quantity provided in the plan + quantityWithOverages: + type: integer + format: int64 + description: Quantity with overages provided in the plan (only applicable on ENTv2) + used: + type: integer + format: int64 + description: Quantity consumed by master + usedOverages: + type: integer + format: int64 + description: Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2) + remaining: + type: integer + format: int64 + description: Quantity remaining in the plan + subAccountDetailsResponse: + type: object + properties: + name: + type: string + description: Name of the sub-account user + email: + type: string + description: Email id of the sub-account organization + companyName: + type: string + description: Sub-account company name + planInfo: + type: object + description: Sub-account plan details + properties: + credits: + type: object + description: Credits quota and remaining credits on the sub-account + properties: + sms: + type: integer + format: int64 + description: SMS credits remaining on the sub-account + emails: + type: object + description: Email credits remaining on the sub-account + properties: + quantity: + type: integer + format: int64 + description: Quantity of email messaging limits provided + remaining: + type: integer + format: int64 + description: Available email messaging limits for use + features: + type: object + description: Features available on the sub-account + properties: + inbox: + type: object + description: Inbox details / Not available on ENTv2 + properties: + quantity: + type: integer + format: int64 + description: Quantity of inbox provided + remaining: + type: integer + format: int64 + description: Available inboxes for use + landingPage: + type: object + description: Landing page details / Not available on ENTv2 + properties: + quantity: + type: integer + format: int64 + description: Quantity of landing pages provided + remaining: + type: integer + format: int64 + description: Available landing pages for use + users: + type: object + description: Multi-account details + properties: + quantity: + type: integer + format: int64 + description: Quantity of multi-account's provided + remaining: + type: integer + format: int64 + description: Available multi-accounts for use + planType: + type: string + description: type of the plan + subAccountUpdatePlanRequest: + type: object + description: Details of the plan to be changed + properties: + credits: + type: object + description: Credit details to update + properties: + email: + type: integer + format: int64 + description: Number of email credits + features: + type: object + description: Features details to update + properties: + users: + type: integer + format: int64 + description: Number of multi-users + landingPage: + type: integer + format: int64 + description: Number of landing pages / Not required on ENTv2 + inbox: + type: integer + format: int64 + description: Number of inboxes / Not required on ENTv2 + example: + credits: + email: 5000 + features: + users: 15 + landingPage: 20 + inbox: 10 + + subAccountAppsToggleRequest: + type: object + description: List of enable/disable applications on the sub-account + properties: + inbox: + type: boolean + description: Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2 + whatsapp: + type: boolean + description: Set this field to enable or disable Whatsapp campaigns on the sub-account + automation: + type: boolean + description: Set this field to enable or disable Automation on the sub-account + email-campaigns: + type: boolean + description: Set this field to enable or disable Email Campaigns on the sub-account + sms-campaigns: + type: boolean + description: Set this field to enable or disable SMS Marketing on the sub-account + landing-pages: + type: boolean + description: Set this field to enable or disable Landing pages on the sub-account + transactional-emails: + type: boolean + description: Set this field to enable or disable Transactional Email on the sub-account + transactional-sms: + type: boolean + description: Set this field to enable or disable Transactional SMS on the sub-account + facebook-ads: + type: boolean + description: Set this field to enable or disable Facebook ads on the sub-account + web-push: + type: boolean + description: Set this field to enable or disable Web Push on the sub-account + meetings: + type: boolean + description: Set this field to enable or disable Meetings on the sub-account + conversations: + type: boolean + description: Set this field to enable or disable Conversations on the sub-account + crm: + type: boolean + description: Set this field to enable or disable Sales CRM on the sub-account + example: + landing-pages: true + sms-campaigns: false + whatsapp: true + meetings: true + web-push: false + + TaskTypes: + type: object + description: Task types details + properties: + id: + type: string + description: Id of task type + example: "61a88a2eb7a574180261234" + title: + type: string + description: Title of task type + example: "Email" + Task: + required: + - taskTypeId + - name + - date + type: object + description: Task Details + properties: + id: + type: string + description: Unique task id + example: "61a5cd07ca1347c82306ad06" + taskTypeId: + type: string + description: Id for type of task e.g Call / Email / Meeting etc. + example: "61a5cd07ca1347c82306ad09" + name: + type: string + description: Name of task + example: "Task: Connect with client" + contactsIds: + items: + type: integer + type: array + description: Contact ids for contacts linked to this task + example: [ 1, 2, 3 ] + dealsIds: + items: + type: string + type: array + description: Deal ids for deals a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + companiesIds: + items: + type: string + type: array + description: Companies ids for companies a task is linked to + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + TaskReminder: + required: + - value + - unit + - types + type: object + description: Task reminder date/time for a task + properties: + value: + type: integer + example: 10 + description: Value of time unit before reminder is to be sent + unit: + type: string + enum: + - minutes + - hours + - weeks + - days + description: Unit of time before reminder is to be sent + types: + items: + type: string + enum: + - email + - push + description: Type of task reminder e.g email, push + type: array + example: [ + "email" + ] + FileList: + type: array + description: List of files + items: + $ref: '#/components/schemas/FileData' + FileDownloadableLink: + type: object + description: Downloadable file link + properties: + fileUrl: + type: string + description: A unique link to download the requested file. + example: 'https://storage.googleapis.com/brevo-app-crm.......-sample.pdf' + FileData: + type: object + description: File data that is uploaded + properties: + name: + type: string + description: Name of uploaded file + example: "example.png" + authorId: + type: string + description: Account id of user which created the file + example: "61a5ce58y5d4795761045991" + contactId: + type: integer + format: int64 + description: Contact id of contact on which file is uploaded + example: 1 + dealId: + type: string + description: Deal id linked to a file + example: "61a5ce58c5d4795761045991" + companyId: + type: string + description: Company id linked to a file + example: "61a5ce58c5d4795761045991" + size: + type: integer + format: int64 + description: Size of file in bytes + example: 10 + createdAt: + type: string + format: date-time + example: "2017-05-01T17:05:03.000Z" + description: File created date/time + NoteData: + required: + - text + type: object + description: Note data to be saved + properties: + text: + type: string + maxLength: 3000 + minLength: 1 + example: "In communication with client for resolution of queries." + description: Text content of a note + contactIds: + items: + type: integer + description: Contact Ids linked to a note + type: array + example: [ + 247, 1, 2 + ] + dealIds: + items: + type: string + description: Deal Ids linked to a note + type: array + example: [ + "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" + ] + companyIds: + items: + type: string + description: Company Ids linked to a note + type: array + example: [ + "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" + ] + Note: + required: + - text + type: object + description: Note Details + properties: + id: + type: string + description: Unique note Id + example: "61a5cd07ca1347c82306ad09" + text: + type: string + maxLength: 3000 + minLength: 1 + example: "In communication with client for resolution of queries." + description: Text content of a note + contactIds: + items: + type: integer + description: Contact ids linked to a note + type: array + example: [ + 247, 1, 2 + ] + dealIds: + items: + type: string + description: Deal ids linked to a note + type: array + example: [ + "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" + ] + authorId: + type: object + description: Account details of user which created the note + example: { + id: "61a5ce58y5d4795761045991", + email: "johndoe@example.com", + locale: "en_GB", + timezone: "Asia/Kolkata", + name: { + fullName: "John Doe" + } + } + createdAt: + type: string + format: date-time + example: "2017-05-01T17:05:03.000Z" + description: Note created date/time + updatedAt: + type: string + format: date-time + example: "2017-05-01T17:05:03.000Z" + description: Note updated date/time + NoteId: + type: object + description: Updated Note ID + properties: + id: + type: string + description: Unique note Id + example: "61a5cd07ca1347c82306ad09" + NoteList: + type: array + description: List of notes + items: + $ref: '#/components/schemas/Note' + TaskList: + type: object + description: List of tasks + properties: + items: + type: array + description: List of tasks + items: + $ref: '#/components/schemas/Task' + Pipelines: + type: array + description: List of pipeline + items: + $ref: '#/components/schemas/Pipeline' + PipelineStage: + type: object + description: List of stages + properties: + id: + type: string + description: Stage id + example: "9e577ff7-8e42-4ab3-be26-2b5e01b42518" + name: + type: string + description: Stage name + example: "New" + Pipeline: + type: object + description: List of stages + properties: + pipeline_name: + type: string + description: Pipeline name + example: Sales Pipeline + pipeline: + type: string + description: Pipeline id + example: "5ea675e3da0dd085acaea610" + stages: + type: array + description: List of stages + items: + $ref: '#/components/schemas/PipelineStage' + DealAttributes: + type: array + description: List of deal attributes + items: + type: object + description: List of attributes + properties: + internalName: + type: string + example: "deal_name" + label: + type: string + example: "Deal Name" + attributeTypeName: + type: string + example: "text" + attributeOptions: + type: array + items: + type: object + example: { + key: "custom key", + value: "custom label" + } + isRequired: + type: boolean + example: true + DealsList: + type: object + description: List of Deals + properties: + items: + type: array + description: List of deals + items: + $ref: '#/components/schemas/Deal' + Deal: + type: object + description: Deal Details + properties: + id: + type: string + description: Unique deal id + example: "629475917295261d9b1f4403" + attributes: + type: object + description: Deal attributes with values + example: { + deal_name: "testname", + deal_owner: "6093d2425a9b436e9519d034", + amount: 12, + pipeline: "6093d296ad1e9c5cf2140a58", + deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + stage_updated_at: "2022-05-30T07:42:05.671Z", + created_at: "2022-05-30T07:42:05.671Z", + number_of_contacts: 1, + last_updated_date: "2022-06-06T08:38:36.761Z", + last_activity_date: "2022-06-06T08:38:36.000Z", + next_activity_date: null, + number_of_activities: 0 + } + linkedContactsIds: + items: + type: integer + type: array + description: Contact ids for contacts linked to this deal + example: [ 1, 2, 3 ] + linkedCompaniesIds: + items: + type: string + type: array + description: Companies ids for companies linked to this deal + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + CompaniesList: + type: object + description: List of companies + properties: + items: + type: array + description: List of compaies + items: + $ref: '#/components/schemas/Company' + Company: + type: object + description: Company Details + properties: + id: + type: string + description: Unique comoany id + example: "629475917295261d9b1f4403" + attributes: + type: object + description: Company attributes with values + example: { + "created_at": "2022-01-13T19:04:24.376+05:30", + "domain": "xyz", + "last_updated_at": "2022-04-01T18:47:48.283+05:30", + "name": "text", + "number_of_contacts": 0, + "owner": "62260474111b1101704a9d85", + "owner_assign_date": "2022-04-01T18:21:13.379+05:30", + "phone_number": 8171844192, + "revenue": 10 + } + linkedContactsIds: + items: + type: integer + type: array + format: in64 + description: Contact ids for contacts linked to this company + example: [ 1, 2, 3 ] + linkedDealsIds: + items: + type: string + type: array + format: objectID + description: Deals ids for companies linked to this company + example: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991" , "61a5ce58c5d4795761045992" ] + CompanyAttributes: + type: array + description: List of company attributes + items: + type: object + description: List of attributes + properties: + internalName: + type: string + example: "name" + label: + type: string + example: "Company Name" + attributeTypeName: + type: string + example: "text" + attributeOptions: + type: array + items: + type: object + example: { + key: "custom key", + value: "custom label" + } + isRequired: + type: boolean + example: true + ConversationsMessage: + type: object + description: a Conversations message + properties: + id: + type: string + description: Message ID. It can be used for further manipulations with the message. + example: eYBEm3gq3zc5ayE2g + type: + type: string + enum: [ "agent", "visitor" ] + description: '`"agent"` for agents’ messages, `"visitor"` for visitors’ messages.' + example: agent + text: + type: string + description: Message text or name of the attached file + example: Good morning! How can I help you? + visitorId: + type: string + description: visitor’s ID + example: kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg + agentId: + type: string + description: ID of the agent on whose behalf the message was sent (only in messages sent by an agent). + example: d9nKoegKSjmCtyK78 + agentName: + type: string + description: Agent’s name as displayed to the visitor. Only in the messages sent by an agent. + example: Liz + createdAt: + type: integer + format: int64 + minimum: 0 + description: Timestamp in milliseconds. + example: 1470222622433 + isPushed: + type: boolean + description: '`true` for pushed messages' + example: true + receivedFrom: + type: string + description: In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. + example: SuperAwesomeHelpdesk + file: + type: object + properties: + filename: + type: string + description: Name of the file + example: conversations.png + size: + type: integer + format: int64 + minimum: 0 + description: Size in bytes + example: 15538 + isImage: + type: boolean + description: Whether the file is an image + example: true + url: + type: string + format: url + description: URL of the file + example: https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/ + imageInfo: + type: object + description: image info is passed in case the file is an image + properties: + width: + type: integer + format: int64 + minimum: 0 + description: Width of the image + example: 1129 + height: + type: integer + format: int64 + minimum: 0 + description: height of the image + example: 525 + previewUrl: + type: string + format: url + description: URL of the preview + example: https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/ + order: + type: object + required: + - id + - createdAt + - updatedAt + - status + - amount + - products + properties: + id: + description: 'Unique ID of the order.' + type: string + example: "14" + createdAt: + description: 'Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created.' + type: string + example: "2021-07-29T20:59:23.383Z" + updatedAt: + description: 'Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated.' + type: string + example: "2021-07-30T10:59:23.383Z" + status: + description: 'State of the order.' + type: string + example: "completed" + amount: + description: 'Total amount of the order, including all shipping expenses, tax and the price of items.' + type: number + example: 308.42 + products: + type: array + items: + type: object + required: + - productId + - quantity + - price + description: 'Details for the Products in an order.' + properties: + productId: + type: string + description: 'ID of the product.' + example: "P1" + quantity: + type: number + description: 'How many pieces of the product the visitor has added to the cart.' + example: 10 + variantId: + type: string + description: 'Product ID of the red color shirts.' + example: "P100" + price: + type: number + description: 'The price of a unit of product' + example: 99.99 + email: + description: 'Email of the contact, Mandatory if "phone" field is not passed in "billing" parameter.' + type: string + example: "example@brevo.com" + billing: + description: 'Billing details of an order.' + type: object + properties: + address: + type: string + description: 'Full billing address.' + example: "15 Somewhere Road, Brynmenyn" + city: + type: string + description: 'Exact city of the address.' + example: "Basel" + countryCode: + type: string + description: 'Billing country 2-letter ISO code.' + example: "CA" + phone: + type: string + description: 'Phone number to contact for further details about the order, Mandatory if "email" field is not passed.' + example: "01559 032133" + postCode: + type: string + description: 'Postcode for delivery and billing.' + example: "4052" + paymentMethod: + type: string + description: 'How the visitor will pay for the item(s), e.g. paypal, check, etc.' + example: "PayPal" + region: + type: string + description: 'Exact region (state/province) for delivery and billing.' + example: "Northwestern Switzerland" + coupons: + description: 'Coupons applied to the order. Stored case insensitive.' + type: array + example: + - "EASTER15OFF" + items: + type: string + orderBatch: + type: object + required: + - orders + properties: + orders: + description: "array of order objects" + type: array + items: + $ref: '#/components/schemas/order' + notifyUrl: + description: 'Notify Url provided by client to get the status of batch request' + type: string + example: "https://en.wikipedia.org/wiki/Webhook" + historical: + description: 'Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual.' + type: boolean + default: true + example: true + createdBatchId: + type: object + required: + - batchId + properties: + batchId: + type: number + description: 'Batch ID of the request' + example: '1' + count: + type: integer + description: Number of orders + format: int64 + example: 17655 + getCategories: + required: + - categories + - count + type: object + properties: + categories: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getCategoryDetails' + count: + type: integer + description: Number of categories + format: int64 + example: 17655 + getCategoryDetails: + required: + - id + - name + - createdAt + - modifiedAt + type: object + properties: + id: + type: string + description: Category ID for which you requested the details + format: string + example: C11 + name: + type: string + description: Name of the category for which you requested the details + format: string + example: Electronics + createdAt: + type: string + description: Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + modifiedAt: + type: string + description: Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + url: + type: string + description: URL to the category + format: string + example: http://mydomain.com/category/clothing + isDeleted: + type: boolean + description: category deleted from the shop's database + format: string + example: true + createUpdateCategory: + type: object + required: + - id + properties: + id: + type: string + description: | + Unique Category ID as saved in the shop + format: email + example: CAT123 + name: + type: string + description: | + **Mandatory in case of creation**. Name of the Category, as displayed in the shop + example: Electronics + url: + type: string + description: URL to the category + example: http://mydomain.com/category/electronics + updateEnabled: + type: boolean + description: Facilitate to update the existing category in the same request + (updateEnabled = true) + example: false + default: false + deletedAt: + type: string + description: UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database + example: 2017-05-12T12:30:00Z + createUpdateCategories: + type: object + required: + - id + properties: + id: + type: string + description: | + Unique Category ID as saved in the shop + format: email + example: CAT123 + name: + type: string + description: | + **Mandatory in case of creation**. Name of the Category, as displayed in the shop + example: Electronics + url: + type: string + description: URL to the category + example: http://mydomain.com/category/electronics + deletedAt: + type: string + description: UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database + example: 2017-05-12T12:30:00Z + createUpdateBatchCategory: + type: object + required: + - categories + properties: + categories: + description: "array of categories objects" + type: array + items: + $ref: '#/components/schemas/createUpdateCategories' + updateEnabled: + type: boolean + description: Facilitate to update the existing categories in the same request + (updateEnabled = true) + createCategoryModel: + type: object + properties: + id: + type: integer + description: ID of the category when a new category is created + format: int64 + example: 122 + createUpdateBatchCategoryModel: + type: object + properties: + createdCount: + type: integer + description: Number of the new created categories + format: int64 + example: 7 + updatedCount: + type: integer + description: Number of the existing categories updated + format: int64 + example: 5 + getProducts: + required: + - products + - count + type: object + properties: + products: + type: array + items: + type: object + allOf: + - $ref: '#/components/schemas/getProductDetails' + count: + type: integer + description: Number of products + format: int64 + example: 17655 + getProductDetails: + required: + - id + - name + - createdAt + - modifiedAt + - s3ThumbAnalytics + - s3ThumbEditor + type: object + properties: + id: + type: string + description: Product ID for which you requested the details + format: string + example: P11 + name: + type: string + description: Name of the product for which you requested the details + format: string + example: Iphone 11 + createdAt: + type: string + description: Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + modifiedAt: + type: string + description: Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) + example: 2017-05-12T12:30:00Z + url: + type: string + description: URL to the product + format: string + example: http://mydomain.com/product/electronics/product1 + imageUrl: + type: string + description: Absolute URL to the cover image of the product + format: string + example: http://mydomain.com/product-absoulte-url/img.jpeg + sku: + type: string + description: Product identifier from the shop + format: string + price: + type: number + description: Price of the product + format: float + categories: + type: array + items: + type: string + description: Category ID-s of the product + parentId: + type: string + description: Parent product id of the product + format: string + s3Original: + type: string + description: S3 url of original image + format: string + s3ThumbAnalytics: + type: string + description: S3 thumbnail url of original image in 120x120 dimension for analytics section + format: string + s3ThumbEditor: + type: string + description: S3 thumbnail url of original image in 600x400 dimension for editor section + format: string + metaInfo: + type: object + description: Meta data of product such as description, vendor, producer, stock level, etc. + example: { + "description": "Shoes for sports", + "brand": "addidas" + } + isDeleted: + type: boolean + description: product deleted from the shop's database + example: true + createUpdateProduct: + type: object + required: + - id + - name + properties: + id: + type: string + description: Product ID for which you requested the details + format: string + example: P11 + name: + type: string + description: Mandatory in case of creation**. Name of the product for which you requested the details + format: string + example: Iphone 11 + url: + type: string + description: URL to the product + format: string + example: http://mydomain.com/product/electronics/product1 + imageUrl: + type: string + description: Absolute URL to the cover image of the product + format: string + example: http://mydomain.com/product-absoulte-url/img.jpeg + sku: + type: string + description: Product identifier from the shop + format: string + price: + type: number + description: Price of the product + format: float + categories: + type: array + items: + type: string + description: Category ID-s of the product + parentId: + type: string + description: Parent product id of the product + format: string + metaInfo: + type: object + additionalProperties: + oneOf: + - type: string + - type: integer + description: Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. + example: { + "description": "Shoes for sports", + "brand": "addidas" + } + updateEnabled: + type: boolean + description: Facilitate to update the existing category in the same request + (updateEnabled = true) + example: false + default: false + deletedAt: + type: string + description: UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database + + createUpdateBatchProducts: + type: object + required: + - products + properties: + products: + description: "array of products objects" + type: array + items: + $ref: '#/components/schemas/createUpdateProducts' + updateEnabled: + type: boolean + description: Facilitate to update the existing categories in the same request + (updateEnabled = true) + createUpdateProducts: + type: object + required: + - id + - name + properties: + id: + type: string + description: Product ID for which you requested the details + format: string + example: P11 + name: + type: string + description: Mandatory in case of creation**. Name of the product for which you requested the details + format: string + example: Iphone 11 + url: + type: string + description: URL to the product + format: string + example: http://mydomain.com/product/electronics/product1 + imageUrl: + type: string + description: Absolute URL to the cover image of the product + format: string + example: http://mydomain.com/product-absoulte-url/img.jpeg + sku: + type: string + description: Product identifier from the shop + format: string + price: + type: number + description: Price of the product + format: float + categories: + type: array + items: + type: string + description: Category ID-s of the product + parentId: + type: string + description: Parent product id of the product + format: string + metaInfo: + type: object + additionalProperties: + oneOf: + - type: string + - type: integer + description: Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. + example: { + "description": "Shoes for sports", + "brand": "addidas" + } + deletedAt: + type: string + description: UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database + createProductModel: + type: object + properties: + id: + type: integer + description: ID of the Product when a new product is created + format: int64 + example: 122 + createUpdateBatchProductsModel: + type: object + properties: + createdCount: + type: integer + description: Number of the new created products + format: int64 + example: 7 + updatedCount: + type: integer + description: Number of the existing products updated + format: int64 + example: 5 + getCouponCollection: + required: + - id + - name + - defaultCoupon + - createdAt + - totalCoupons + - remainingCoupons + type: object + properties: + id: + type: string + description: The id of the collection + format: uuidv4 + example: "23befbae-1505-47a8-bd27-e30ef739f32c" + name: + type: string + description: The name of the collection + format: uuidv4 + example: "SummerPromotions" + defaultCoupon: + type: string + description: The default coupon of the collection + example: 10 OFF + createdAt: + description: Datetime on which the collection was created + type: string + format: date-time + example: 2023-01-06T05:03:47.053000000Z + totalCoupons: + description: Total coupons in the collection + type: integer + format: int64 + example: 10000 + remainingCoupons: + description: Not sent coupons in the collection + type: integer + format: int64 + example: 5000 + sendWhatsappMessageTemplate: + required: + - senderNumber + - templateId + - contactNumbers + type: object + properties: + templateId: + type: integer + description: ID of the template to send + example: 123 + senderNumber: + type: string + format: mobile + description: WhatsApp Number with country code. Example, 85264318721 + example: 919876543210 + # mediaUrl: + # type: string + # description: URL of the media to be sent + # format: url + # example: https://example.com/image.png + params: + type: object + description: Pass the set of attributes to customize the template. For example, {"FNAME":"Joe", "LNAME":"Doe"}. + example: { "FNAME": "Joe", "LNAME": "Doe" } + contactNumbers: + type: array + description: List of phone numbers of the contacts + items: + type: string + description: WhatsApp Number with country code. Example, 85264318721 + format: mobile + example: 919876543210 + sendWhatsappMessageText: + required: + - senderNumber + - contactNumbers + - authType + - text + type: object + properties: + senderNumber: + type: string + format: mobile + description: WhatsApp Number with country code. Example, 85264318721 + example: 919876543210 + text: + type: string + description: Text to be sent as message body (will be overridden if templateId is passed in the same request) + example: Hi! There i am a message + contactNumbers: + type: array + description: List of phone numbers of the contacts + items: + type: string + description: WhatsApp Number with country code. Example, 85264318721 + format: mobile + example: 919876543210 + getWhatsappEventReport: + type: object + properties: + events: + type: array + items: + required: + - contactNumber + - date + - messageId + - event + - senderNumber + type: object + properties: + contactNumber: + type: string + format: mobile + description: WhatsApp Number with country code. Example, 85264318721 + example: 919876543210 + date: + type: string + description: UTC date-time on which the event has been generated + example: 2017-03-12T12:30:00Z + messageId: + type: string + description: Message ID which generated the event + example: 23befbae-1505-47a8-bd27-e30ef739f32c + event: + type: string + description: Event which occurred + example: delivered + enum: + - sent + - delivered + - read + - error + - unsubscribe + - reply + - soft-bounce + reason: + type: string + description: Reason for the event (will be there in case of `error` and `soft-bounce` events) + example: 23befbae-1505-47a8-bd27-e30ef739f32c + body: + type: string + description: Text of the reply (will be there only in case of `reply` event with text) + example: "Hi! I am a reply" + mediaUrl: + type: string + format: url + description: Url of the media reply (will be there only in case of `reply` event with media) + example: "https://example.com/media.png" + senderNumber: + type: string + format: mobile + description: WhatsApp Number with country code. Example, 85264318721 + example: 919876543210 + getExternalFeedByUUID: + type: object + required: + - id + - name + - url + - authType + - headers + - maxRetries + - cache + - createdAt + - modifiedAt + properties: + id: + description: 'ID of the feed' + type: string + format: uuidv4 + example: 54377442-20a2-4c20-b761-d636c72de7b7 + name: + description: 'Name of the feed' + type: string + example: New feed + url: + description: 'URL of the feed' + type: string + format: url + example: http://requestb.in/173lyyx1 + authType: + type: string + enum: [ basic, token, noAuth ] + description: > + Auth type of the feed: + * `basic` + * `token` + * `noAuth` + username: + type: string + description: Username for authType `basic` + example: user + password: + type: string + description: Password for authType `basic` + example: password + token: + type: string + description: Token for authType `token` + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + headers: + type: array + description: Custom headers for the feed + items: + type: object + properties: + name: + type: string + description: Name of the header + example: userId + value: + type: string + description: Value of the header + example: 'user12345' + maxRetries: + type: integer + description: Maximum number of retries on the feed url + example: 5 + minimum: 0 + maximum: 5 + default: 5 + cache: + type: boolean + description: Toggle caching of feed url response + example: true + createdAt: + description: 'Datetime on which the feed was created' + type: string + format: date-time + example: '2022-10-06T05:03:47.053000000Z' + modifiedAt: + description: 'Datetime on which the feed was modified' + type: string + format: date-time + example: '2022-10-06T05:03:47.053000000Z' + getAllExternalFeeds: + type: object + properties: + count: + type: integer + description: 'Total number of batches' + feeds: + type: array + items: + type: object + required: + - id + - name + - url + - authType + - headers + - maxRetries + - cache + - createdAt + - modifiedAt + properties: + id: + description: 'ID of the feed' + type: string + format: uuidv4 + example: 54377442-20a2-4c20-b761-d636c72de7b7 + name: + description: 'Name of the feed' + type: string + example: New feed + url: + description: 'URL of the feed' + type: string + format: url + example: http://requestb.in/173lyyx1 + authType: + type: string + enum: [ basic, token, noAuth ] + description: > + Auth type of the feed: + * `basic` + * `token` + * `noAuth` + username: + type: string + description: Username for authType `basic` + example: user + password: + type: string + description: Password for authType `basic` + example: password + token: + type: string + description: Token for authType `token` + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + headers: + type: array + description: Custom headers for the feed + items: + type: object + properties: + name: + type: string + description: Name of the header + example: userId + value: + type: string + description: Value of the header + example: 'user12345' + maxRetries: + type: integer + description: Maximum number of retries on the feed url + example: 5 + minimum: 0 + maximum: 5 + default: 5 + cache: + type: boolean + description: Toggle caching of feed url response + example: true + createdAt: + description: 'Datetime on which the feed was created' + type: string + format: date-time + example: '2022-10-06T05:03:47.053000000Z' + modifiedAt: + description: 'Datetime on which the feed was modified' + type: string + format: date-time + example: '2022-10-06T05:03:47.053000000Z' + createExternalFeed: + required: + - name + - url + type: object + properties: + name: + type: string + description: Name of the feed + example: New feed + url: + type: string + description: URL of the feed + format: url + example: http://requestb.in/173lyyx1 + authType: + type: string + enum: [ basic, token, noAuth ] + default: noAuth + description: > + Auth type of the feed: + * `basic` + * `token` + * `noAuth` + username: + type: string + description: Username for authType `basic` + example: user + password: + type: string + description: Password for authType `basic` + example: password + token: + type: string + description: Token for authType `token` + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + headers: + type: array + description: Custom headers for the feed + items: + type: object + properties: + name: + type: string + description: Name of the header + example: userId + value: + type: string + description: Value of the header + example: 'user12345' + example: + - name: header1 + value: value1 + - name: header2 + value: value2 + maxRetries: + type: integer + description: Maximum number of retries on the feed url + example: 5 + minimum: 0 + maximum: 5 + default: 5 + cache: + type: boolean + description: Toggle caching of feed url response + example: true + default: false + updateExternalFeed: + type: object + properties: + name: + type: string + description: Name of the feed + example: New feed + url: + type: string + description: URL of the feed + format: url + example: http://requestb.in/173lyyx1 + authType: + type: string + enum: [ basic, token, noAuth ] + description: > + Auth type of the feed: + * `basic` + * `token` + * `noAuth` + username: + type: string + description: Username for authType `basic` + example: user + password: + type: string + description: Password for authType `basic` + example: password + token: + type: string + description: Token for authType `token` + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + headers: + type: array + description: Custom headers for the feed + items: + type: object + properties: + name: + type: string + description: Name of the header + example: userId + value: + type: string + description: Value of the header + example: 'user12345' + example: + - name: header1 + value: value1 + - name: header2 + value: value2 + maxRetries: + type: integer + description: Maximum number of retries on the feed url + example: 5 + minimum: 0 + maximum: 5 + default: 5 + cache: + type: boolean + description: Toggle caching of feed url response + example: true + default: false + exportWebhooksHistory: + required: + - event + - notifyURL + - type + type: object + properties: + days: + type: integer + description: Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ + example: 7 + startDate: + type: string + description: Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate + example: 2023-02-13 + endDate: + type: string + description: Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + example: 2023-02-17 + sort: + type: string + description: Sorting order of records (asc or desc) + example: desc + type: + type: string + description: Filter the history based on webhook type + example: transactional + enum: + - transactional + - marketing + event: + type: string + description: Filter the history for a specific event type + example: request + enum: + - invalid_parameter + - missing_parameter + - hardBounce + - softBounce + - delivered + - spam + - request + - opened + - click + - invalid + - deferred + - blocked + - unsubscribed + - error + - uniqueOpened + - loadedByProxy + - allEvents + notifyURL: + type: string + description: Webhook URL to receive CSV file link + example: https://brevo.com + webhookId: + type: integer + description: Filter the history for a specific webhook id + example: 2345 + email: + type: string + description: Filter the history for a specific email + example: example@brevo.com + messageId: + type: integer + description: Filter the history for a specific message id. Applicable only for transactional webhooks. + example: <23befbae-1505-47a8-bd27-e30ef739f32c@fr.sib> + responses: + createModel: + description: successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/createModel' + createdProcessId: + description: process id created + content: + application/json: + schema: + $ref: '#/components/schemas/createdProcessId' + createdBatchId: + description: batch id created + content: + application/json: + schema: + $ref: '#/components/schemas/createdBatchId' + securitySchemes: + api-key: + type: apiKey + description: The API key should be passed in the request headers as `api-key` + for authentication. + name: api-key + in: header +x-samples-languages: + - curl diff --git a/pom.xml b/pom.xml index 58221aa..b0cc131 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - openapi-client-maven-template-root + brevo-java-client-root 1.0.0-SNAPSHOT pom @@ -15,8 +15,8 @@ - openapi-client-maven-template - openapi-client-maven-template-demo + brevo-java-client + brevo-java-client-demo