diff --git a/CHANGELOG.md b/CHANGELOG.md
index c47f2cf8..a2fa1c4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.
+[2024-06-27] Version 5.0.0-rc.1
+--------------------------------
+- Generating Sendgrid Code using open api spec.
+
[2024-06-27] Version 5.0.0-rc.0
--------------------------------
- Release Candidate prep
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a5973600..005c7647 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -69,7 +69,7 @@ touch Example.java
Add the example you want to test to Example.java, including the headers at the top of the file.
``` bash
-javac -classpath ../repo/com/sendgrid/4.10.2/sendgrid-4.10.2-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.10.2/sendgrid-4.10.2-jar.jar:. Example
+javac -classpath ../repo/com/sendgrid/5.0.0-rc.1/sendgrid-5.0.0-rc.1-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/5.0.0-rc.1/sendgrid-5.0.0-rc.1-jar.jar:. Example
```
diff --git a/README.md b/README.md
index c00f214f..7c840693 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ Add the following to your build.gradle file in the root of your project.
...
dependencies {
...
- implementation 'com.sendgrid:sendgrid-java:4.10.2'
+ implementation 'com.sendgrid:sendgrid-java:5.0.0-rc.1'
}
repositories {
@@ -81,7 +81,7 @@ mvn install
You can just drop the jar file in. It's a fat jar - it has all the dependencies built in.
-[sendgrid-java.jar](https://github.com/sendgrid/sendgrid-java/releases/download/4.10.2/sendgrid-java.jar)
+[sendgrid-java.jar](https://github.com/sendgrid/sendgrid-java/releases/download/5.0.0-rc.1/sendgrid-java.jar)
## Dependencies
diff --git a/pom.xml b/pom.xml
index 3ac5876a..39321ba8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
com.sendgrid
sendgrid-java
Twilio SendGrid Java helper library
- 4.10.2
+ 5.0.0-rc.1
This Java module allows you to quickly and easily send emails through Twilio SendGrid using Java.
https://github.com/sendgrid/sendgrid-java
@@ -26,7 +26,7 @@
https://github.com/sendgrid/sendgrid-java
scm:git:git@github.com:sendgrid/sendgrid-java.git
scm:git:git@github.com:sendgrid/sendgrid-java.git
- 4.10.2
+ 5.0.0-rc.1
diff --git a/src/main/java/com/sendgrid/constant/Config.java b/src/main/java/com/sendgrid/constant/Config.java
index 19076f3d..8d129930 100644
--- a/src/main/java/com/sendgrid/constant/Config.java
+++ b/src/main/java/com/sendgrid/constant/Config.java
@@ -4,7 +4,7 @@
@UtilityClass
public class Config {
- public static final String VERSION = "5.0.0-rc.0";
+ public static final String VERSION = "5.0.0-rc.1";
public static final String JAVA_VERSION = System.getProperty("java.version");
public static final String OS_NAME = System.getProperty("os.name");
public static final String OS_ARCH = System.getProperty("os.arch");
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/AuthenticateAccount.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/AuthenticateAccount.java
new file mode 100644
index 00000000..913a763a
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/AuthenticateAccount.java
@@ -0,0 +1,113 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class AuthenticateAccount extends ApiKeyBase {
+
+ private final String accountID;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/partners/accounts/{accountID}/sso";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "AuthenticateAccount creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(statusCode, response.getHeaders());
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/CreateAccount.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/CreateAccount.java
new file mode 100644
index 00000000..46660c36
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/CreateAccount.java
@@ -0,0 +1,136 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningAccountId;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.CreateAccountParams;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class CreateAccount extends ApiKeyBase {
+
+ @Setter
+ private String tTestAccount;
+
+ @Setter
+ private CreateAccountParams createAccountParams;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/partners/accounts";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "CreateAccount creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AccountProvisioningAccountId.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (tTestAccount != null) {
+ request.addHeaderParam("T-Test-Account", tTestAccount.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (createAccountParams != null) {
+ request.addBody(JsonUtil.toJson(createAccountParams));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/DeleteAccount.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/DeleteAccount.java
new file mode 100644
index 00000000..fe0e8ce3
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/DeleteAccount.java
@@ -0,0 +1,126 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class DeleteAccount extends ApiKeyBase {
+
+ private final String accountID;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/partners/accounts/{accountID}";
+ Request request = new Request(
+ HttpMethod.DELETE,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "DeleteAccount creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(statusCode, response.getHeaders());
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/GetAccountState.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/GetAccountState.java
new file mode 100644
index 00000000..249ce286
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/GetAccountState.java
@@ -0,0 +1,136 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningStateRead;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class GetAccountState extends ApiKeyBase {
+
+ private final String accountID;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/partners/accounts/{accountID}/state";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "GetAccountState creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AccountProvisioningStateRead.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccount.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccount.java
new file mode 100644
index 00000000..b323fb8c
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccount.java
@@ -0,0 +1,139 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountList;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ListAccount extends ApiKeyBase {
+
+ @Setter
+ private String offset;
+
+ @Setter
+ private Integer limit;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/partners/accounts";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addQueryParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListAccount creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), AccountList.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addQueryParams(Request request) {
+ if (offset != null) {
+ request.addQueryParam("offset", offset.toString());
+ }
+ if (limit != null) {
+ request.addQueryParam("limit", limit.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccountOffering.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccountOffering.java
new file mode 100644
index 00000000..85288e50
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccountOffering.java
@@ -0,0 +1,136 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingList;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class ListAccountOffering extends ApiKeyBase {
+
+ private final String accountID;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/partners/accounts/{accountID}/offerings";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListAccountOffering creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AccountProvisioningOfferingList.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListOffering.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListOffering.java
new file mode 100644
index 00000000..08d81f3b
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListOffering.java
@@ -0,0 +1,127 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningCatalog;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class ListOffering extends ApiKeyBase {
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/partners/offerings";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListOffering creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AccountProvisioningCatalog.class
+ ),
+ response.getHeaders()
+ );
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountOffering.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountOffering.java
new file mode 100644
index 00000000..5999a4f0
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountOffering.java
@@ -0,0 +1,135 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingList;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.OfferingsToAdd;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateAccountOffering extends ApiKeyBase {
+
+ private final String accountID;
+
+ @Setter
+ private OfferingsToAdd offeringsToAdd;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/partners/accounts/{accountID}/offerings";
+ Request request = new Request(
+ HttpMethod.PUT,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "UpdateAccountOffering creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AccountProvisioningOfferingList.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (offeringsToAdd != null) {
+ request.addBody(JsonUtil.toJson(offeringsToAdd));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountState.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountState.java
new file mode 100644
index 00000000..b3d83f6e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountState.java
@@ -0,0 +1,125 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningStateWrite;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateAccountState extends ApiKeyBase {
+
+ private final String accountID;
+
+ @Setter
+ private AccountProvisioningStateWrite accountProvisioningStateWrite;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/partners/accounts/{accountID}/state";
+ Request request = new Request(
+ HttpMethod.PUT,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "UpdateAccountState creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(statusCode, response.getHeaders());
+ }
+
+ private void addPathParams(Request request) {
+ if (accountID != null) {
+ request.addPathParam("accountID", accountID.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (accountProvisioningStateWrite != null) {
+ request.addBody(JsonUtil.toJson(accountProvisioningStateWrite));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountList.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountList.java
new file mode 100644
index 00000000..10a0cced
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountList.java
@@ -0,0 +1,82 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningAccount;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningPagination;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountList {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("accounts")
+ @Getter
+ @Setter
+ private List accounts;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("pages")
+ @Getter
+ @Setter
+ private AccountProvisioningPagination pages;
+
+ public AccountList() {}
+
+ private AccountList(Builder builder) {
+ this.accounts = builder.accounts;
+ this.pages = builder.pages;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List accounts;
+ private AccountProvisioningPagination pages;
+
+ public Builder() {}
+
+ public Builder accounts(List accounts) {
+ this.accounts = accounts;
+ return this;
+ }
+
+ public Builder pages(AccountProvisioningPagination pages) {
+ this.pages = pages;
+ return this;
+ }
+
+ public AccountList build() {
+ return new AccountList(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountList.class.getSimpleName() + "(",
+ ")"
+ );
+ if (accounts != null) joiner.add("accounts=" + accounts);
+ if (pages != null) joiner.add("pages=" + pages);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccount.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccount.java
new file mode 100644
index 00000000..3c62934e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccount.java
@@ -0,0 +1,73 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningAccount {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private String id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("created_at")
+ @Getter
+ @Setter
+ private OffsetDateTime createdAt;
+
+ public AccountProvisioningAccount() {}
+
+ private AccountProvisioningAccount(Builder builder) {
+ this.id = builder.id;
+ this.createdAt = builder.createdAt;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String id;
+ private OffsetDateTime createdAt;
+
+ public Builder(String id, OffsetDateTime createdAt) {
+ this.id = id;
+ this.createdAt = createdAt;
+ }
+
+ public AccountProvisioningAccount build() {
+ return new AccountProvisioningAccount(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningAccount.class.getSimpleName() + "(",
+ ")"
+ );
+ if (id != null) joiner.add("id=" + id);
+ if (createdAt != null) joiner.add("createdAt=" + createdAt);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccountId.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccountId.java
new file mode 100644
index 00000000..d18696ee
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningAccountId.java
@@ -0,0 +1,62 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningAccountId {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("account_id")
+ @Getter
+ @Setter
+ private String accountId;
+
+ public AccountProvisioningAccountId() {}
+
+ private AccountProvisioningAccountId(Builder builder) {
+ this.accountId = builder.accountId;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String accountId;
+
+ public Builder(String accountId) {
+ this.accountId = accountId;
+ }
+
+ public AccountProvisioningAccountId build() {
+ return new AccountProvisioningAccountId(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningAccountId.class.getSimpleName() + "(",
+ ")"
+ );
+ if (accountId != null) joiner.add("accountId=" + accountId);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningCatalog.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningCatalog.java
new file mode 100644
index 00000000..00939c45
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningCatalog.java
@@ -0,0 +1,67 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.CatalogEntry;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningCatalog {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("catalog")
+ @Getter
+ @Setter
+ private List catalog;
+
+ public AccountProvisioningCatalog() {}
+
+ private AccountProvisioningCatalog(Builder builder) {
+ this.catalog = builder.catalog;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List catalog;
+
+ public Builder() {}
+
+ public Builder catalog(List catalog) {
+ this.catalog = catalog;
+ return this;
+ }
+
+ public AccountProvisioningCatalog build() {
+ return new AccountProvisioningCatalog(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningCatalog.class.getSimpleName() + "(",
+ ")"
+ );
+ if (catalog != null) joiner.add("catalog=" + catalog);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingList.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingList.java
new file mode 100644
index 00000000..ab98ee23
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingList.java
@@ -0,0 +1,69 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingV1;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningOfferingList {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("offerings")
+ @Getter
+ @Setter
+ private List offerings;
+
+ public AccountProvisioningOfferingList() {}
+
+ private AccountProvisioningOfferingList(Builder builder) {
+ this.offerings = builder.offerings;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List offerings;
+
+ public Builder() {}
+
+ public Builder offerings(
+ List offerings
+ ) {
+ this.offerings = offerings;
+ return this;
+ }
+
+ public AccountProvisioningOfferingList build() {
+ return new AccountProvisioningOfferingList(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningOfferingList.class.getSimpleName() + "(",
+ ")"
+ );
+ if (offerings != null) joiner.add("offerings=" + offerings);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingV1.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingV1.java
new file mode 100644
index 00000000..93547de5
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningOfferingV1.java
@@ -0,0 +1,87 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.Type;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningOfferingV1 {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private Type type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("quantity")
+ @Getter
+ @Setter
+ private Long quantity;
+
+ public AccountProvisioningOfferingV1() {}
+
+ private AccountProvisioningOfferingV1(Builder builder) {
+ this.name = builder.name;
+ this.type = builder.type;
+ this.quantity = builder.quantity;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String name;
+ private Type type;
+ private Long quantity;
+
+ public Builder(String name, Type type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public Builder quantity(Long quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ public AccountProvisioningOfferingV1 build() {
+ return new AccountProvisioningOfferingV1(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningOfferingV1.class.getSimpleName() + "(",
+ ")"
+ );
+ if (name != null) joiner.add("name=" + name);
+ if (type != null) joiner.add("type=" + type);
+ if (quantity != null) joiner.add("quantity=" + quantity);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningPagination.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningPagination.java
new file mode 100644
index 00000000..84499c67
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningPagination.java
@@ -0,0 +1,79 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningPagination {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("last")
+ @Getter
+ @Setter
+ private String last;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("example")
+ @Getter
+ @Setter
+ private Object example;
+
+ public AccountProvisioningPagination() {}
+
+ private AccountProvisioningPagination(Builder builder) {
+ this.last = builder.last;
+ this.example = builder.example;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String last;
+ private Object example;
+
+ public Builder() {}
+
+ public Builder last(String last) {
+ this.last = last;
+ return this;
+ }
+
+ public Builder example(Object example) {
+ this.example = example;
+ return this;
+ }
+
+ public AccountProvisioningPagination build() {
+ return new AccountProvisioningPagination(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningPagination.class.getSimpleName() + "(",
+ ")"
+ );
+ if (last != null) joiner.add("last=" + last);
+ if (example != null) joiner.add("example=" + example);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningProfile.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningProfile.java
new file mode 100644
index 00000000..2c21a37e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningProfile.java
@@ -0,0 +1,151 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningProfile {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("first_name")
+ @Getter
+ @Setter
+ private String firstName;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("last_name")
+ @Getter
+ @Setter
+ private String lastName;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("company_name")
+ @Getter
+ @Setter
+ private String companyName;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("company_website")
+ @Getter
+ @Setter
+ private String companyWebsite;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email")
+ @Getter
+ @Setter
+ private String email;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("phone")
+ @Getter
+ @Setter
+ private String phone;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("timezone")
+ @Getter
+ @Setter
+ private String timezone;
+
+ public AccountProvisioningProfile() {}
+
+ private AccountProvisioningProfile(Builder builder) {
+ this.firstName = builder.firstName;
+ this.lastName = builder.lastName;
+ this.companyName = builder.companyName;
+ this.companyWebsite = builder.companyWebsite;
+ this.email = builder.email;
+ this.phone = builder.phone;
+ this.timezone = builder.timezone;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String firstName;
+ private String lastName;
+ private String companyName;
+ private String companyWebsite;
+ private String email;
+ private String phone;
+ private String timezone;
+
+ public Builder() {}
+
+ public Builder firstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public Builder lastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public Builder companyName(String companyName) {
+ this.companyName = companyName;
+ return this;
+ }
+
+ public Builder companyWebsite(String companyWebsite) {
+ this.companyWebsite = companyWebsite;
+ return this;
+ }
+
+ public Builder email(String email) {
+ this.email = email;
+ return this;
+ }
+
+ public Builder phone(String phone) {
+ this.phone = phone;
+ return this;
+ }
+
+ public Builder timezone(String timezone) {
+ this.timezone = timezone;
+ return this;
+ }
+
+ public AccountProvisioningProfile build() {
+ return new AccountProvisioningProfile(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningProfile.class.getSimpleName() + "(",
+ ")"
+ );
+ if (firstName != null) joiner.add("firstName=" + firstName);
+ if (lastName != null) joiner.add("lastName=" + lastName);
+ if (companyName != null) joiner.add("companyName=" + companyName);
+ if (companyWebsite != null) joiner.add(
+ "companyWebsite=" + companyWebsite
+ );
+ if (email != null) joiner.add("email=" + email);
+ if (phone != null) joiner.add("phone=" + phone);
+ if (timezone != null) joiner.add("timezone=" + timezone);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateRead.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateRead.java
new file mode 100644
index 00000000..4cfbb40f
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateRead.java
@@ -0,0 +1,63 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.State;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningStateRead {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("state")
+ @Getter
+ @Setter
+ private State state;
+
+ public AccountProvisioningStateRead() {}
+
+ private AccountProvisioningStateRead(Builder builder) {
+ this.state = builder.state;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private State state;
+
+ public Builder(State state) {
+ this.state = state;
+ }
+
+ public AccountProvisioningStateRead build() {
+ return new AccountProvisioningStateRead(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningStateRead.class.getSimpleName() + "(",
+ ")"
+ );
+ if (state != null) joiner.add("state=" + state);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateWrite.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateWrite.java
new file mode 100644
index 00000000..02eb30dc
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningStateWrite.java
@@ -0,0 +1,63 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.State1;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AccountProvisioningStateWrite {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("state")
+ @Getter
+ @Setter
+ private State1 state;
+
+ public AccountProvisioningStateWrite() {}
+
+ private AccountProvisioningStateWrite(Builder builder) {
+ this.state = builder.state;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private State1 state;
+
+ public Builder(State1 state) {
+ this.state = state;
+ }
+
+ public AccountProvisioningStateWrite build() {
+ return new AccountProvisioningStateWrite(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AccountProvisioningStateWrite.class.getSimpleName() + "(",
+ ")"
+ );
+ if (state != null) joiner.add("state=" + state);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntry.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntry.java
new file mode 100644
index 00000000..f7f94117
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntry.java
@@ -0,0 +1,81 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingV1;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.CatalogEntryEntitlements;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CatalogEntry {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("offering")
+ @Getter
+ @Setter
+ private AccountProvisioningOfferingV1 offering;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("entitlements")
+ @Getter
+ @Setter
+ private CatalogEntryEntitlements entitlements;
+
+ public CatalogEntry() {}
+
+ private CatalogEntry(Builder builder) {
+ this.offering = builder.offering;
+ this.entitlements = builder.entitlements;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private AccountProvisioningOfferingV1 offering;
+ private CatalogEntryEntitlements entitlements;
+
+ public Builder() {}
+
+ public Builder offering(AccountProvisioningOfferingV1 offering) {
+ this.offering = offering;
+ return this;
+ }
+
+ public Builder entitlements(CatalogEntryEntitlements entitlements) {
+ this.entitlements = entitlements;
+ return this;
+ }
+
+ public CatalogEntry build() {
+ return new CatalogEntry(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CatalogEntry.class.getSimpleName() + "(",
+ ")"
+ );
+ if (offering != null) joiner.add("offering=" + offering);
+ if (entitlements != null) joiner.add("entitlements=" + entitlements);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntryEntitlements.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntryEntitlements.java
new file mode 100644
index 00000000..c31552b8
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CatalogEntryEntitlements.java
@@ -0,0 +1,111 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CatalogEntryEntitlements {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_sends_max_monthly")
+ @Getter
+ @Setter
+ private Long emailSendsMaxMonthly;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("ip_count")
+ @Getter
+ @Setter
+ private Long ipCount;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("teammates_max_total")
+ @Getter
+ @Setter
+ private Long teammatesMaxTotal;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("users_max_total")
+ @Getter
+ @Setter
+ private Long usersMaxTotal;
+
+ public CatalogEntryEntitlements() {}
+
+ private CatalogEntryEntitlements(Builder builder) {
+ this.emailSendsMaxMonthly = builder.emailSendsMaxMonthly;
+ this.ipCount = builder.ipCount;
+ this.teammatesMaxTotal = builder.teammatesMaxTotal;
+ this.usersMaxTotal = builder.usersMaxTotal;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Long emailSendsMaxMonthly;
+ private Long ipCount;
+ private Long teammatesMaxTotal;
+ private Long usersMaxTotal;
+
+ public Builder() {}
+
+ public Builder emailSendsMaxMonthly(Long emailSendsMaxMonthly) {
+ this.emailSendsMaxMonthly = emailSendsMaxMonthly;
+ return this;
+ }
+
+ public Builder ipCount(Long ipCount) {
+ this.ipCount = ipCount;
+ return this;
+ }
+
+ public Builder teammatesMaxTotal(Long teammatesMaxTotal) {
+ this.teammatesMaxTotal = teammatesMaxTotal;
+ return this;
+ }
+
+ public Builder usersMaxTotal(Long usersMaxTotal) {
+ this.usersMaxTotal = usersMaxTotal;
+ return this;
+ }
+
+ public CatalogEntryEntitlements build() {
+ return new CatalogEntryEntitlements(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CatalogEntryEntitlements.class.getSimpleName() + "(",
+ ")"
+ );
+ if (emailSendsMaxMonthly != null) joiner.add(
+ "emailSendsMaxMonthly=" + emailSendsMaxMonthly
+ );
+ if (ipCount != null) joiner.add("ipCount=" + ipCount);
+ if (teammatesMaxTotal != null) joiner.add(
+ "teammatesMaxTotal=" + teammatesMaxTotal
+ );
+ if (usersMaxTotal != null) joiner.add("usersMaxTotal=" + usersMaxTotal);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CreateAccountParams.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CreateAccountParams.java
new file mode 100644
index 00000000..6bdfc565
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/CreateAccountParams.java
@@ -0,0 +1,79 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingV1;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningProfile;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CreateAccountParams {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("profile")
+ @Getter
+ @Setter
+ private AccountProvisioningProfile profile;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("offerings")
+ @Getter
+ @Setter
+ private List offerings;
+
+ public CreateAccountParams() {}
+
+ private CreateAccountParams(Builder builder) {
+ this.profile = builder.profile;
+ this.offerings = builder.offerings;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private AccountProvisioningProfile profile;
+ private List offerings;
+
+ public Builder(List offerings) {
+ this.offerings = offerings;
+ }
+
+ public Builder profile(AccountProvisioningProfile profile) {
+ this.profile = profile;
+ return this;
+ }
+
+ public CreateAccountParams build() {
+ return new CreateAccountParams(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CreateAccountParams.class.getSimpleName() + "(",
+ ")"
+ );
+ if (profile != null) joiner.add("profile=" + profile);
+ if (offerings != null) joiner.add("offerings=" + offerings);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/ErrorResponse.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/ErrorResponse.java
new file mode 100644
index 00000000..1c2c593c
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/ErrorResponse.java
@@ -0,0 +1,82 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ErrorResponse {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("message")
+ @Getter
+ @Setter
+ private String message;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("field")
+ @Getter
+ @Setter
+ private String field;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("error_id")
+ @Getter
+ @Setter
+ private String errorId;
+
+ public ErrorResponse() {}
+
+ private ErrorResponse(Builder builder) {
+ this.message = builder.message;
+ this.field = builder.field;
+ this.errorId = builder.errorId;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String message;
+ private String field;
+ private String errorId;
+
+ public Builder(String message, String field, String errorId) {
+ this.message = message;
+ this.field = field;
+ this.errorId = errorId;
+ }
+
+ public ErrorResponse build() {
+ return new ErrorResponse(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ErrorResponse.class.getSimpleName() + "(",
+ ")"
+ );
+ if (message != null) joiner.add("message=" + message);
+ if (field != null) joiner.add("field=" + field);
+ if (errorId != null) joiner.add("errorId=" + errorId);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/OfferingsToAdd.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/OfferingsToAdd.java
new file mode 100644
index 00000000..8a385aa5
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/OfferingsToAdd.java
@@ -0,0 +1,64 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.accountprovisioning.models.AccountProvisioningOfferingV1;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class OfferingsToAdd {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("offerings")
+ @Getter
+ @Setter
+ private List offerings;
+
+ public OfferingsToAdd() {}
+
+ private OfferingsToAdd(Builder builder) {
+ this.offerings = builder.offerings;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List offerings;
+
+ public Builder(List offerings) {
+ this.offerings = offerings;
+ }
+
+ public OfferingsToAdd build() {
+ return new OfferingsToAdd(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ OfferingsToAdd.class.getSimpleName() + "(",
+ ")"
+ );
+ if (offerings != null) joiner.add("offerings=" + offerings);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State.java
new file mode 100644
index 00000000..7ec52560
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State.java
@@ -0,0 +1,48 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum State {
+ ACTIVATED("activated"),
+
+ DEACTIVATED("deactivated"),
+
+ SUSPENDED("suspended"),
+
+ BANNED("banned"),
+
+ INDETERMINATE("indeterminate");
+
+ private final String value;
+
+ private State(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static State forValue(final String value) {
+ return Promoter.enumFromString(value, State.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State1.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State1.java
new file mode 100644
index 00000000..e0b7bd09
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/State1.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum State1 {
+ ACTIVATED("activated"),
+
+ DEACTIVATED("deactivated");
+
+ private final String value;
+
+ private State1(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static State1 forValue(final String value) {
+ return Promoter.enumFromString(value, State1.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/Type.java b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/Type.java
new file mode 100644
index 00000000..dd8adffd
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/Type.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Account Provisioning API
+ * The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.accountprovisioning.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum Type {
+ PACKAGE("package"),
+
+ ADDON("addon");
+
+ private final String value;
+
+ private Type(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static Type forValue(final String value) {
+ return Promoter.enumFromString(value, Type.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/CreateAlert.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/CreateAlert.java
new file mode 100644
index 00000000..dbdbbf58
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/CreateAlert.java
@@ -0,0 +1,111 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.alerts.models.CreateAlert201Response;
+import com.sendgrid.rest.api.v3.alerts.models.CreateAlertRequest;
+import com.sendgrid.rest.api.v3.alerts.models.ErrorResponse;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class CreateAlert extends ApiKeyBase {
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private CreateAlertRequest createAlertRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/alerts";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "CreateAlert creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ CreateAlert201Response.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (createAlertRequest != null) {
+ request.addBody(JsonUtil.toJson(createAlertRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/DeleteAlert.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/DeleteAlert.java
new file mode 100644
index 00000000..81b973d2
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/DeleteAlert.java
@@ -0,0 +1,84 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class DeleteAlert extends ApiKeyBase {
+
+ private final Integer alertId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/alerts/{alert_id}";
+ Request request = new Request(
+ HttpMethod.DELETE,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "DeleteAlert creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(statusCode, response.getHeaders());
+ }
+
+ private void addPathParams(Request request) {
+ if (alertId != null) {
+ request.addPathParam("alert_id", alertId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/GetAlert.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/GetAlert.java
new file mode 100644
index 00000000..37fe4fa4
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/GetAlert.java
@@ -0,0 +1,91 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.alerts.models.GetAlert200Response;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class GetAlert extends ApiKeyBase {
+
+ private final Integer alertId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/alerts/{alert_id}";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "GetAlert creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), GetAlert200Response.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (alertId != null) {
+ request.addPathParam("alert_id", alertId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/ListAlert.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/ListAlert.java
new file mode 100644
index 00000000..495cdb32
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/ListAlert.java
@@ -0,0 +1,83 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.alerts.models.ListAlert200ResponseInner;
+import com.sendgrid.util.JsonUtil;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ListAlert extends ApiKeyBase {
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse> send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/alerts";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListAlert creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), List.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/UpdateAlert.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/UpdateAlert.java
new file mode 100644
index 00000000..42655995
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/UpdateAlert.java
@@ -0,0 +1,105 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.alerts.models.UpdateAlert200Response;
+import com.sendgrid.rest.api.v3.alerts.models.UpdateAlertRequest;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateAlert extends ApiKeyBase {
+
+ private final Integer alertId;
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private UpdateAlertRequest updateAlertRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/alerts/{alert_id}";
+ Request request = new Request(
+ HttpMethod.PATCH,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "UpdateAlert creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ UpdateAlert200Response.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (alertId != null) {
+ request.addPathParam("alert_id", alertId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (updateAlertRequest != null) {
+ request.addBody(JsonUtil.toJson(updateAlertRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlert201Response.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlert201Response.java
new file mode 100644
index 00000000..05b3041c
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlert201Response.java
@@ -0,0 +1,136 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CreateAlert201Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("created_at")
+ @Getter
+ @Setter
+ private Integer createdAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private Integer id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private String type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("updated_at")
+ @Getter
+ @Setter
+ private Integer updatedAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ public CreateAlert201Response() {}
+
+ private CreateAlert201Response(Builder builder) {
+ this.createdAt = builder.createdAt;
+ this.emailTo = builder.emailTo;
+ this.frequency = builder.frequency;
+ this.id = builder.id;
+ this.type = builder.type;
+ this.updatedAt = builder.updatedAt;
+ this.percentage = builder.percentage;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Integer createdAt;
+ private String emailTo;
+ private String frequency;
+ private Integer id;
+ private String type;
+ private Integer updatedAt;
+ private Integer percentage;
+
+ public Builder(
+ Integer createdAt,
+ String emailTo,
+ Integer id,
+ String type,
+ Integer updatedAt
+ ) {
+ this.createdAt = createdAt;
+ this.emailTo = emailTo;
+ this.id = id;
+ this.type = type;
+ this.updatedAt = updatedAt;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public CreateAlert201Response build() {
+ return new CreateAlert201Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CreateAlert201Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (createdAt != null) joiner.add("createdAt=" + createdAt);
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ if (id != null) joiner.add("id=" + id);
+ if (type != null) joiner.add("type=" + type);
+ if (updatedAt != null) joiner.add("updatedAt=" + updatedAt);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlertRequest.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlertRequest.java
new file mode 100644
index 00000000..d60f28c1
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/CreateAlertRequest.java
@@ -0,0 +1,101 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.alerts.models.Type;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CreateAlertRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private Type type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ public CreateAlertRequest() {}
+
+ private CreateAlertRequest(Builder builder) {
+ this.type = builder.type;
+ this.emailTo = builder.emailTo;
+ this.frequency = builder.frequency;
+ this.percentage = builder.percentage;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Type type;
+ private String emailTo;
+ private String frequency;
+ private Integer percentage;
+
+ public Builder(Type type, String emailTo) {
+ this.type = type;
+ this.emailTo = emailTo;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public CreateAlertRequest build() {
+ return new CreateAlertRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CreateAlertRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (type != null) joiner.add("type=" + type);
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponse.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponse.java
new file mode 100644
index 00000000..c77cfe60
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponse.java
@@ -0,0 +1,81 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.alerts.models.ErrorResponseErrorsInner;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ErrorResponse {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("errors")
+ @Getter
+ @Setter
+ private List errors;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private String id;
+
+ public ErrorResponse() {}
+
+ private ErrorResponse(Builder builder) {
+ this.errors = builder.errors;
+ this.id = builder.id;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List errors;
+ private String id;
+
+ public Builder() {}
+
+ public Builder errors(List errors) {
+ this.errors = errors;
+ return this;
+ }
+
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public ErrorResponse build() {
+ return new ErrorResponse(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ErrorResponse.class.getSimpleName() + "(",
+ ")"
+ );
+ if (errors != null) joiner.add("errors=" + errors);
+ if (id != null) joiner.add("id=" + id);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponseErrorsInner.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponseErrorsInner.java
new file mode 100644
index 00000000..e8c3c308
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ErrorResponseErrorsInner.java
@@ -0,0 +1,93 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ErrorResponseErrorsInner {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("message")
+ @Getter
+ @Setter
+ private String message;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("field")
+ @Getter
+ @Setter
+ private String field;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("help")
+ @Getter
+ @Setter
+ private Object help;
+
+ public ErrorResponseErrorsInner() {}
+
+ private ErrorResponseErrorsInner(Builder builder) {
+ this.message = builder.message;
+ this.field = builder.field;
+ this.help = builder.help;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String message;
+ private String field;
+ private Object help;
+
+ public Builder() {}
+
+ public Builder message(String message) {
+ this.message = message;
+ return this;
+ }
+
+ public Builder field(String field) {
+ this.field = field;
+ return this;
+ }
+
+ public Builder help(Object help) {
+ this.help = help;
+ return this;
+ }
+
+ public ErrorResponseErrorsInner build() {
+ return new ErrorResponseErrorsInner(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ErrorResponseErrorsInner.class.getSimpleName() + "(",
+ ")"
+ );
+ if (message != null) joiner.add("message=" + message);
+ if (field != null) joiner.add("field=" + field);
+ if (help != null) joiner.add("help=" + help);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/GetAlert200Response.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/GetAlert200Response.java
new file mode 100644
index 00000000..3befcc58
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/GetAlert200Response.java
@@ -0,0 +1,137 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.alerts.models.Type2;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class GetAlert200Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("created_at")
+ @Getter
+ @Setter
+ private Integer createdAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private Integer id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private Type2 type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("updated_at")
+ @Getter
+ @Setter
+ private Integer updatedAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ public GetAlert200Response() {}
+
+ private GetAlert200Response(Builder builder) {
+ this.createdAt = builder.createdAt;
+ this.emailTo = builder.emailTo;
+ this.frequency = builder.frequency;
+ this.id = builder.id;
+ this.type = builder.type;
+ this.updatedAt = builder.updatedAt;
+ this.percentage = builder.percentage;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Integer createdAt;
+ private String emailTo;
+ private String frequency;
+ private Integer id;
+ private Type2 type;
+ private Integer updatedAt;
+ private Integer percentage;
+
+ public Builder(
+ Integer createdAt,
+ String emailTo,
+ Integer id,
+ Type2 type,
+ Integer updatedAt
+ ) {
+ this.createdAt = createdAt;
+ this.emailTo = emailTo;
+ this.id = id;
+ this.type = type;
+ this.updatedAt = updatedAt;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public GetAlert200Response build() {
+ return new GetAlert200Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ GetAlert200Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (createdAt != null) joiner.add("createdAt=" + createdAt);
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ if (id != null) joiner.add("id=" + id);
+ if (type != null) joiner.add("type=" + type);
+ if (updatedAt != null) joiner.add("updatedAt=" + updatedAt);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ListAlert200ResponseInner.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ListAlert200ResponseInner.java
new file mode 100644
index 00000000..9408858f
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/ListAlert200ResponseInner.java
@@ -0,0 +1,140 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.alerts.models.Type1;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ListAlert200ResponseInner {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("created_at")
+ @Getter
+ @Setter
+ private Integer createdAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private Integer id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private Type1 type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("updated_at")
+ @Getter
+ @Setter
+ private Integer updatedAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ public ListAlert200ResponseInner() {}
+
+ private ListAlert200ResponseInner(Builder builder) {
+ this.createdAt = builder.createdAt;
+ this.emailTo = builder.emailTo;
+ this.id = builder.id;
+ this.percentage = builder.percentage;
+ this.type = builder.type;
+ this.updatedAt = builder.updatedAt;
+ this.frequency = builder.frequency;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Integer createdAt;
+ private String emailTo;
+ private Integer id;
+ private Integer percentage;
+ private Type1 type;
+ private Integer updatedAt;
+ private String frequency;
+
+ public Builder(
+ Integer createdAt,
+ String emailTo,
+ Integer id,
+ Type1 type
+ ) {
+ this.createdAt = createdAt;
+ this.emailTo = emailTo;
+ this.id = id;
+ this.type = type;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public Builder updatedAt(Integer updatedAt) {
+ this.updatedAt = updatedAt;
+ return this;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public ListAlert200ResponseInner build() {
+ return new ListAlert200ResponseInner(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ListAlert200ResponseInner.class.getSimpleName() + "(",
+ ")"
+ );
+ if (createdAt != null) joiner.add("createdAt=" + createdAt);
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (id != null) joiner.add("id=" + id);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ if (type != null) joiner.add("type=" + type);
+ if (updatedAt != null) joiner.add("updatedAt=" + updatedAt);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type.java
new file mode 100644
index 00000000..a9c38d98
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum Type {
+ STATS_NOTIFICATION("stats_notification"),
+
+ USAGE_LIMIT("usage_limit");
+
+ private final String value;
+
+ private Type(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static Type forValue(final String value) {
+ return Promoter.enumFromString(value, Type.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type1.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type1.java
new file mode 100644
index 00000000..dd1e2891
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type1.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum Type1 {
+ USAGE_LIMIT("usage_limit"),
+
+ STATS_NOTIFICATION("stats_notification");
+
+ private final String value;
+
+ private Type1(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static Type1 forValue(final String value) {
+ return Promoter.enumFromString(value, Type1.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type2.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type2.java
new file mode 100644
index 00000000..c86d51c5
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type2.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum Type2 {
+ USAGE_LIMIT("usage_limit"),
+
+ STATS_NOTIFICATION("stats_notification");
+
+ private final String value;
+
+ private Type2(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static Type2 forValue(final String value) {
+ return Promoter.enumFromString(value, Type2.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type3.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type3.java
new file mode 100644
index 00000000..6ac3fa05
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/Type3.java
@@ -0,0 +1,42 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.sendgrid.converter.Promoter;
+
+public enum Type3 {
+ USAGE_LIMIT("usage_limit"),
+
+ STATS_NOTIFICATION("stats_notification");
+
+ private final String value;
+
+ private Type3(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return value;
+ }
+
+ @JsonCreator
+ public static Type3 forValue(final String value) {
+ return Promoter.enumFromString(value, Type3.values());
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlert200Response.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlert200Response.java
new file mode 100644
index 00000000..399654bf
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlert200Response.java
@@ -0,0 +1,137 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.alerts.models.Type3;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class UpdateAlert200Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("created_at")
+ @Getter
+ @Setter
+ private Integer createdAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private Integer id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("type")
+ @Getter
+ @Setter
+ private Type3 type;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("updated_at")
+ @Getter
+ @Setter
+ private Integer updatedAt;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ public UpdateAlert200Response() {}
+
+ private UpdateAlert200Response(Builder builder) {
+ this.createdAt = builder.createdAt;
+ this.emailTo = builder.emailTo;
+ this.frequency = builder.frequency;
+ this.id = builder.id;
+ this.type = builder.type;
+ this.updatedAt = builder.updatedAt;
+ this.percentage = builder.percentage;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private Integer createdAt;
+ private String emailTo;
+ private String frequency;
+ private Integer id;
+ private Type3 type;
+ private Integer updatedAt;
+ private Integer percentage;
+
+ public Builder(
+ Integer createdAt,
+ String emailTo,
+ Integer id,
+ Type3 type,
+ Integer updatedAt
+ ) {
+ this.createdAt = createdAt;
+ this.emailTo = emailTo;
+ this.id = id;
+ this.type = type;
+ this.updatedAt = updatedAt;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public UpdateAlert200Response build() {
+ return new UpdateAlert200Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ UpdateAlert200Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (createdAt != null) joiner.add("createdAt=" + createdAt);
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ if (id != null) joiner.add("id=" + id);
+ if (type != null) joiner.add("type=" + type);
+ if (updatedAt != null) joiner.add("updatedAt=" + updatedAt);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlertRequest.java b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlertRequest.java
new file mode 100644
index 00000000..dae59fb8
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/alerts/models/UpdateAlertRequest.java
@@ -0,0 +1,93 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Alerts API
+ * The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.alerts.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class UpdateAlertRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("email_to")
+ @Getter
+ @Setter
+ private String emailTo;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("frequency")
+ @Getter
+ @Setter
+ private String frequency;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("percentage")
+ @Getter
+ @Setter
+ private Integer percentage;
+
+ public UpdateAlertRequest() {}
+
+ private UpdateAlertRequest(Builder builder) {
+ this.emailTo = builder.emailTo;
+ this.frequency = builder.frequency;
+ this.percentage = builder.percentage;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String emailTo;
+ private String frequency;
+ private Integer percentage;
+
+ public Builder() {}
+
+ public Builder emailTo(String emailTo) {
+ this.emailTo = emailTo;
+ return this;
+ }
+
+ public Builder frequency(String frequency) {
+ this.frequency = frequency;
+ return this;
+ }
+
+ public Builder percentage(Integer percentage) {
+ this.percentage = percentage;
+ return this;
+ }
+
+ public UpdateAlertRequest build() {
+ return new UpdateAlertRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ UpdateAlertRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (emailTo != null) joiner.add("emailTo=" + emailTo);
+ if (frequency != null) joiner.add("frequency=" + frequency);
+ if (percentage != null) joiner.add("percentage=" + percentage);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/CreateApiKey.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/CreateApiKey.java
new file mode 100644
index 00000000..5b42e738
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/CreateApiKey.java
@@ -0,0 +1,163 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.CreateApiKey201Response;
+import com.sendgrid.rest.api.v3.apikeys.models.CreateApiKeyRequest;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class CreateApiKey extends ApiKeyBase {
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private CreateApiKeyRequest createApiKeyRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/api_keys";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "CreateApiKey creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ CreateApiKey201Response.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (createApiKeyRequest != null) {
+ request.addBody(JsonUtil.toJson(createApiKeyRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/DeleteApiKey.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/DeleteApiKey.java
new file mode 100644
index 00000000..cb18eb06
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/DeleteApiKey.java
@@ -0,0 +1,151 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class DeleteApiKey extends ApiKeyBase {
+
+ private final String apiKeyId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/api_keys/{api_key_id}";
+ Request request = new Request(
+ HttpMethod.DELETE,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "DeleteApiKey creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(statusCode, response.getHeaders());
+ }
+
+ private void addPathParams(Request request) {
+ if (apiKeyId != null) {
+ request.addPathParam("api_key_id", apiKeyId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/GetApiKey.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/GetApiKey.java
new file mode 100644
index 00000000..80085ecd
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/GetApiKey.java
@@ -0,0 +1,158 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.GetApiKey200Response;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class GetApiKey extends ApiKeyBase {
+
+ private final String apiKeyId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/api_keys/{api_key_id}";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "GetApiKey creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), GetApiKey200Response.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (apiKeyId != null) {
+ request.addPathParam("api_key_id", apiKeyId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/ListApiKey.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/ListApiKey.java
new file mode 100644
index 00000000..d89b9a2e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/ListApiKey.java
@@ -0,0 +1,149 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.ListApiKey200Response;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ListApiKey extends ApiKeyBase {
+
+ @Setter
+ private Integer limit;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/api_keys";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addQueryParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListApiKey creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ ListApiKey200Response.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addQueryParams(Request request) {
+ if (limit != null) {
+ request.addQueryParam("limit", limit.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKey.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKey.java
new file mode 100644
index 00000000..71ec51f0
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKey.java
@@ -0,0 +1,167 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.ApiKeyResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.UpdateApiKeyRequest;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateApiKey extends ApiKeyBase {
+
+ private final String apiKeyId;
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private UpdateApiKeyRequest updateApiKeyRequest;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/api_keys/{api_key_id}";
+ Request request = new Request(
+ HttpMethod.PUT,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "UpdateApiKey creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), ApiKeyResponse.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (apiKeyId != null) {
+ request.addPathParam("api_key_id", apiKeyId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (updateApiKeyRequest != null) {
+ request.addBody(JsonUtil.toJson(updateApiKeyRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKeyName.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKeyName.java
new file mode 100644
index 00000000..675b257d
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/UpdateApiKeyName.java
@@ -0,0 +1,167 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.apikeys.models.ApiKeyResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponse;
+import com.sendgrid.rest.api.v3.apikeys.models.UpdateApiKeyNameRequest;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateApiKeyName extends ApiKeyBase {
+
+ private final String apiKeyId;
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private UpdateApiKeyNameRequest updateApiKeyNameRequest;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/api_keys/{api_key_id}";
+ Request request = new Request(
+ HttpMethod.PATCH,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "UpdateApiKeyName creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "400")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "401")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "403")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "404")) {
+ ErrorResponse error = JsonUtil.fromJson(
+ response.getStream(),
+ ErrorResponse.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), ApiKeyResponse.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (apiKeyId != null) {
+ request.addPathParam("api_key_id", apiKeyId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (updateApiKeyNameRequest != null) {
+ request.addBody(JsonUtil.toJson(updateApiKeyNameRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyResponse.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyResponse.java
new file mode 100644
index 00000000..4ed513df
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyResponse.java
@@ -0,0 +1,79 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ApiKeyResponse {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("api_key_id")
+ @Getter
+ @Setter
+ private String apiKeyId;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ public ApiKeyResponse() {}
+
+ private ApiKeyResponse(Builder builder) {
+ this.apiKeyId = builder.apiKeyId;
+ this.name = builder.name;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String apiKeyId;
+ private String name;
+
+ public Builder() {}
+
+ public Builder apiKeyId(String apiKeyId) {
+ this.apiKeyId = apiKeyId;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public ApiKeyResponse build() {
+ return new ApiKeyResponse(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ApiKeyResponse.class.getSimpleName() + "(",
+ ")"
+ );
+ if (apiKeyId != null) joiner.add("apiKeyId=" + apiKeyId);
+ if (name != null) joiner.add("name=" + name);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyScopesResponse.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyScopesResponse.java
new file mode 100644
index 00000000..5110f27c
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ApiKeyScopesResponse.java
@@ -0,0 +1,94 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ApiKeyScopesResponse {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("scopes")
+ @Getter
+ @Setter
+ private List scopes;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("api_key_id")
+ @Getter
+ @Setter
+ private String apiKeyId;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ public ApiKeyScopesResponse() {}
+
+ private ApiKeyScopesResponse(Builder builder) {
+ this.scopes = builder.scopes;
+ this.apiKeyId = builder.apiKeyId;
+ this.name = builder.name;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List scopes;
+ private String apiKeyId;
+ private String name;
+
+ public Builder() {}
+
+ public Builder scopes(List scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
+ public Builder apiKeyId(String apiKeyId) {
+ this.apiKeyId = apiKeyId;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public ApiKeyScopesResponse build() {
+ return new ApiKeyScopesResponse(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ApiKeyScopesResponse.class.getSimpleName() + "(",
+ ")"
+ );
+ if (scopes != null) joiner.add("scopes=" + scopes);
+ if (apiKeyId != null) joiner.add("apiKeyId=" + apiKeyId);
+ if (name != null) joiner.add("name=" + name);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKey201Response.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKey201Response.java
new file mode 100644
index 00000000..72d61bed
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKey201Response.java
@@ -0,0 +1,108 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CreateApiKey201Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("api_key")
+ @Getter
+ @Setter
+ private String apiKey;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("api_key_id")
+ @Getter
+ @Setter
+ private String apiKeyId;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("scopes")
+ @Getter
+ @Setter
+ private List scopes;
+
+ public CreateApiKey201Response() {}
+
+ private CreateApiKey201Response(Builder builder) {
+ this.apiKey = builder.apiKey;
+ this.apiKeyId = builder.apiKeyId;
+ this.name = builder.name;
+ this.scopes = builder.scopes;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String apiKey;
+ private String apiKeyId;
+ private String name;
+ private List scopes;
+
+ public Builder() {}
+
+ public Builder apiKey(String apiKey) {
+ this.apiKey = apiKey;
+ return this;
+ }
+
+ public Builder apiKeyId(String apiKeyId) {
+ this.apiKeyId = apiKeyId;
+ return this;
+ }
+
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder scopes(List scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
+ public CreateApiKey201Response build() {
+ return new CreateApiKey201Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CreateApiKey201Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (apiKey != null) joiner.add("apiKey=" + apiKey);
+ if (apiKeyId != null) joiner.add("apiKeyId=" + apiKeyId);
+ if (name != null) joiner.add("name=" + name);
+ if (scopes != null) joiner.add("scopes=" + scopes);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKeyRequest.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKeyRequest.java
new file mode 100644
index 00000000..5d8af2a2
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/CreateApiKeyRequest.java
@@ -0,0 +1,77 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class CreateApiKeyRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("scopes")
+ @Getter
+ @Setter
+ private List scopes;
+
+ public CreateApiKeyRequest() {}
+
+ private CreateApiKeyRequest(Builder builder) {
+ this.name = builder.name;
+ this.scopes = builder.scopes;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String name;
+ private List scopes;
+
+ public Builder(String name) {
+ this.name = name;
+ }
+
+ public Builder scopes(List scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
+ public CreateApiKeyRequest build() {
+ return new CreateApiKeyRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ CreateApiKeyRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (name != null) joiner.add("name=" + name);
+ if (scopes != null) joiner.add("scopes=" + scopes);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponse.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponse.java
new file mode 100644
index 00000000..4b7cb00b
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponse.java
@@ -0,0 +1,81 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.apikeys.models.ErrorResponseErrorsInner;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ErrorResponse {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("errors")
+ @Getter
+ @Setter
+ private List errors;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private String id;
+
+ public ErrorResponse() {}
+
+ private ErrorResponse(Builder builder) {
+ this.errors = builder.errors;
+ this.id = builder.id;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List errors;
+ private String id;
+
+ public Builder() {}
+
+ public Builder errors(List errors) {
+ this.errors = errors;
+ return this;
+ }
+
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public ErrorResponse build() {
+ return new ErrorResponse(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ErrorResponse.class.getSimpleName() + "(",
+ ")"
+ );
+ if (errors != null) joiner.add("errors=" + errors);
+ if (id != null) joiner.add("id=" + id);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponseErrorsInner.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponseErrorsInner.java
new file mode 100644
index 00000000..b65faa80
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ErrorResponseErrorsInner.java
@@ -0,0 +1,93 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ErrorResponseErrorsInner {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("message")
+ @Getter
+ @Setter
+ private String message;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("field")
+ @Getter
+ @Setter
+ private String field;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("help")
+ @Getter
+ @Setter
+ private Object help;
+
+ public ErrorResponseErrorsInner() {}
+
+ private ErrorResponseErrorsInner(Builder builder) {
+ this.message = builder.message;
+ this.field = builder.field;
+ this.help = builder.help;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String message;
+ private String field;
+ private Object help;
+
+ public Builder() {}
+
+ public Builder message(String message) {
+ this.message = message;
+ return this;
+ }
+
+ public Builder field(String field) {
+ this.field = field;
+ return this;
+ }
+
+ public Builder help(Object help) {
+ this.help = help;
+ return this;
+ }
+
+ public ErrorResponseErrorsInner build() {
+ return new ErrorResponseErrorsInner(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ErrorResponseErrorsInner.class.getSimpleName() + "(",
+ ")"
+ );
+ if (message != null) joiner.add("message=" + message);
+ if (field != null) joiner.add("field=" + field);
+ if (help != null) joiner.add("help=" + help);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/GetApiKey200Response.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/GetApiKey200Response.java
new file mode 100644
index 00000000..fa298f88
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/GetApiKey200Response.java
@@ -0,0 +1,67 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.apikeys.models.ApiKeyScopesResponse;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class GetApiKey200Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("result")
+ @Getter
+ @Setter
+ private List result;
+
+ public GetApiKey200Response() {}
+
+ private GetApiKey200Response(Builder builder) {
+ this.result = builder.result;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List result;
+
+ public Builder() {}
+
+ public Builder result(List result) {
+ this.result = result;
+ return this;
+ }
+
+ public GetApiKey200Response build() {
+ return new GetApiKey200Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ GetApiKey200Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (result != null) joiner.add("result=" + result);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ListApiKey200Response.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ListApiKey200Response.java
new file mode 100644
index 00000000..e7f2d59e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/ListApiKey200Response.java
@@ -0,0 +1,67 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.apikeys.models.ApiKeyResponse;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class ListApiKey200Response {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("result")
+ @Getter
+ @Setter
+ private List result;
+
+ public ListApiKey200Response() {}
+
+ private ListApiKey200Response(Builder builder) {
+ this.result = builder.result;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private List result;
+
+ public Builder() {}
+
+ public Builder result(List result) {
+ this.result = result;
+ return this;
+ }
+
+ public ListApiKey200Response build() {
+ return new ListApiKey200Response(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ ListApiKey200Response.class.getSimpleName() + "(",
+ ")"
+ );
+ if (result != null) joiner.add("result=" + result);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyNameRequest.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyNameRequest.java
new file mode 100644
index 00000000..5ad1c04e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyNameRequest.java
@@ -0,0 +1,62 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class UpdateApiKeyNameRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ public UpdateApiKeyNameRequest() {}
+
+ private UpdateApiKeyNameRequest(Builder builder) {
+ this.name = builder.name;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String name;
+
+ public Builder(String name) {
+ this.name = name;
+ }
+
+ public UpdateApiKeyNameRequest build() {
+ return new UpdateApiKeyNameRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ UpdateApiKeyNameRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (name != null) joiner.add("name=" + name);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyRequest.java b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyRequest.java
new file mode 100644
index 00000000..15807eb5
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/apikeys/models/UpdateApiKeyRequest.java
@@ -0,0 +1,77 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid API Keys API
+ * The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.apikeys.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class UpdateApiKeyRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("name")
+ @Getter
+ @Setter
+ private String name;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("scopes")
+ @Getter
+ @Setter
+ private List scopes;
+
+ public UpdateApiKeyRequest() {}
+
+ private UpdateApiKeyRequest(Builder builder) {
+ this.name = builder.name;
+ this.scopes = builder.scopes;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String name;
+ private List scopes;
+
+ public Builder(String name) {
+ this.name = name;
+ }
+
+ public Builder scopes(List scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
+ public UpdateApiKeyRequest build() {
+ return new UpdateApiKeyRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ UpdateApiKeyRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (name != null) joiner.add("name=" + name);
+ if (scopes != null) joiner.add("scopes=" + scopes);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AddIpToAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AddIpToAuthenticatedDomain.java
new file mode 100644
index 00000000..47150302
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AddIpToAuthenticatedDomain.java
@@ -0,0 +1,105 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Domain Authentication API
+ * The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.domainauthentication;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AddIpToAuthenticatedDomainRequest;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticatedDomainSpf;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class AddIpToAuthenticatedDomain extends ApiKeyBase {
+
+ private final Integer id;
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private AddIpToAuthenticatedDomainRequest addIpToAuthenticatedDomainRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{id}/ips";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "AddIpToAuthenticatedDomain creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AuthenticatedDomainSpf.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (id != null) {
+ request.addPathParam("id", id.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (addIpToAuthenticatedDomainRequest != null) {
+ request.addBody(JsonUtil.toJson(addIpToAuthenticatedDomainRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomain.java
new file mode 100644
index 00000000..54cc2600
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomain.java
@@ -0,0 +1,95 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Domain Authentication API
+ * The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.domainauthentication;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AssociateSubuserWithDomainRequest;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticatedDomainSpf;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class AssociateSubuserWithDomain extends ApiKeyBase {
+
+ private final Integer domainId;
+
+ @Setter
+ private AssociateSubuserWithDomainRequest associateSubuserWithDomainRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{domain_id}/subuser";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "AssociateSubuserWithDomain creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AuthenticatedDomainSpf.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (domainId != null) {
+ request.addPathParam("domain_id", domainId.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (associateSubuserWithDomainRequest != null) {
+ request.addBody(JsonUtil.toJson(associateSubuserWithDomainRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomainMultiple.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomainMultiple.java
new file mode 100644
index 00000000..30f44e14
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AssociateSubuserWithDomainMultiple.java
@@ -0,0 +1,95 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Domain Authentication API
+ * The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.domainauthentication;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AssociateSubuserWithDomainRequest;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticatedDomainSpf;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class AssociateSubuserWithDomainMultiple extends ApiKeyBase {
+
+ private final Integer domainId;
+
+ @Setter
+ private AssociateSubuserWithDomainRequest associateSubuserWithDomainRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{domain_id}/subuser:add";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "AssociateSubuserWithDomainMultiple creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(
+ response.getStream(),
+ AuthenticatedDomainSpf.class
+ ),
+ response.getHeaders()
+ );
+ }
+
+ private void addPathParams(Request request) {
+ if (domainId != null) {
+ request.addPathParam("domain_id", domainId.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (associateSubuserWithDomainRequest != null) {
+ request.addBody(JsonUtil.toJson(associateSubuserWithDomainRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AuthenticateDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AuthenticateDomain.java
new file mode 100644
index 00000000..9bf1d70e
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/AuthenticateDomain.java
@@ -0,0 +1,93 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Domain Authentication API
+ * The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.domainauthentication;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticateDomainRequest;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticatedDomain;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class AuthenticateDomain extends ApiKeyBase {
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private AuthenticateDomainRequest authenticateDomainRequest;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addHeaderParams(request);
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "AuthenticateDomain creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ GenericApiError error = JsonUtil.fromJson(
+ response.getStream(),
+ GenericApiError.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+ int statusCode = response.getStatusCode();
+ return new ApiResponse(
+ statusCode,
+ JsonUtil.fromJson(response.getStream(), AuthenticatedDomain.class),
+ response.getHeaders()
+ );
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (authenticateDomainRequest != null) {
+ request.addBody(JsonUtil.toJson(authenticateDomainRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteAuthenticatedDomain.java
new file mode 100644
index 00000000..9f78abb1
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteAuthenticatedDomain.java
@@ -0,0 +1,88 @@
+/*
+ * This code was generated by
+ *
+ * SENDGRID-OAI-GENERATOR
+ *
+ * Twilio SendGrid Domain Authentication API
+ * The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator.
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.sendgrid.rest.api.v3.domainauthentication;
+
+import com.sendgrid.base.apikey.ApiKeyBase;
+import com.sendgrid.constant.ApplicationConstants;
+import com.sendgrid.constant.Domains;
+import com.sendgrid.exception.ApiConnectionException;
+import com.sendgrid.exception.ApiErrorResponse;
+import com.sendgrid.exception.GenericApiError;
+import com.sendgrid.http.ApiKeyRestClient;
+import com.sendgrid.http.ApiResponse;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class DeleteAuthenticatedDomain extends ApiKeyBase {
+
+ private final String domainId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse