userAgentExtensions;
+
+ @Getter
+ private String url;
+ public Request(HttpMethod method, String endPoint, String domain) {
+ this.method = method;
+ this.endPoint = endPoint;
+ this.domain = domain;
+ }
+
+ public void addPathParam(String key, String value) {
+ pathParams.put(key, value);
+ }
+
+ public void addHeaderParam(String key, String value) {
+ headers.put(key, value);
+ }
+
+ public void addQueryParam(String key, String value) {
+ queryParams.put(key, value);
+ }
+
+ public void addBody(String body) {
+ this.body = body;
+ }
+
+ public void buildUrl() {
+ String baseUrl = Utility.buildBaseUrl(domain, region, endPoint);
+ baseUrl = Utility.buildWithPathParams(baseUrl, pathParams);
+ baseUrl = Utility.buildWithQueryParams(baseUrl, queryParams);
+ this.url = baseUrl;
+ }
+
+ public void buildUrl(final String url) {
+ this.url = url;
+ }
+
+}
diff --git a/src/main/java/com/sendgrid/http/Response.java b/src/main/java/com/sendgrid/http/Response.java
new file mode 100644
index 00000000..289d9198
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/Response.java
@@ -0,0 +1,120 @@
+package com.sendgrid.http;
+
+import com.sendgrid.exception.ApiException;
+import org.apache.http.Header;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Scanner;
+
+public class Response {
+
+ private final InputStream stream;
+ private String content;
+ private final int statusCode;
+ private final Header[] headers;
+
+ /**
+ * Create a Response from content string and status code.
+ *
+ * @param content content string
+ * @param statusCode status code
+ */
+ public Response(final String content, final int statusCode) {
+ this(content, statusCode, null);
+ }
+
+ /**
+ * Create a Response from content string, status code, and headers.
+ *
+ * @param content content string
+ * @param statusCode status code
+ * @param headers headers
+ */
+ public Response(final String content, final int statusCode, final Header[] headers) {
+ this.stream = null;
+ this.content = content;
+ this.statusCode = statusCode;
+ this.headers = headers;
+ }
+
+ /**
+ * Create a Response from input stream and status code.
+ *
+ * @param stream input stream
+ * @param statusCode status code
+ */
+ public Response(final InputStream stream, final int statusCode) {
+ this(stream, statusCode, null);
+ }
+
+ /**
+ * Create a Response from input stream, status code, and headers.
+ *
+ * @param stream input stream
+ * @param statusCode status code
+ * @param headers headers
+ */
+ public Response(final InputStream stream, final int statusCode, final Header[] headers) {
+ this.stream = stream;
+ this.content = null;
+ this.statusCode = statusCode;
+ this.headers = headers;
+ }
+
+ /**
+ * Get the the content of the response.
+ *
+ *
+ * If there is a content string, that will be returned.
+ * Otherwise, will get content from input stream
+ *
+ *
+ * @return the content string
+ */
+ public String getContent() {
+ if (content != null) {
+ return content;
+ }
+
+ if (stream != null) {
+ Scanner scanner = new Scanner(stream, "UTF-8").useDelimiter("\\A");
+
+ if (!scanner.hasNext()) {
+ return "";
+ }
+
+ content = scanner.next();
+ scanner.close();
+
+ return content;
+ }
+
+ return "";
+ }
+
+ /**
+ * Get response data as stream.
+ *
+ * @return the response data as a stream
+ */
+ public InputStream getStream() {
+ if (stream != null) {
+ return stream;
+ }
+ try {
+ return new ByteArrayInputStream(content.getBytes("utf-8"));
+ } catch (final UnsupportedEncodingException e) {
+ throw new ApiException("UTF-8 encoding not supported", e);
+ }
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Header[] getHeaders() {
+ return headers;
+ }
+}
diff --git a/src/main/java/com/sendgrid/http/auth/AuthStrategy.java b/src/main/java/com/sendgrid/http/auth/AuthStrategy.java
new file mode 100644
index 00000000..800f3740
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/auth/AuthStrategy.java
@@ -0,0 +1,7 @@
+package com.sendgrid.http.auth;
+
+import com.sendgrid.http.Request;
+
+public interface AuthStrategy {
+ void applyAuth(Request request);
+}
diff --git a/src/main/java/com/sendgrid/http/auth/BasicAuthStrategy.java b/src/main/java/com/sendgrid/http/auth/BasicAuthStrategy.java
new file mode 100644
index 00000000..32ea0ccb
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/auth/BasicAuthStrategy.java
@@ -0,0 +1,18 @@
+package com.sendgrid.http.auth;
+
+import com.sendgrid.http.Request;
+import lombok.RequiredArgsConstructor;
+
+import java.util.Base64;
+
+@RequiredArgsConstructor
+public class BasicAuthStrategy implements AuthStrategy {
+ private final String username;
+ private final String password;
+
+ @Override
+ public void applyAuth(Request request) {
+ String basicAuthValue = Base64.getEncoder().encodeToString((username + ":" + password).getBytes());
+ //requestBuilder.addHeader("Authorization", "Basic " + basicAuthValue);
+ }
+}
diff --git a/src/main/java/com/sendgrid/http/auth/TokenStrategy.java b/src/main/java/com/sendgrid/http/auth/TokenStrategy.java
new file mode 100644
index 00000000..91ba9f9a
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/auth/TokenStrategy.java
@@ -0,0 +1,13 @@
+package com.sendgrid.http.auth;
+
+import com.sendgrid.http.Request;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class TokenStrategy implements AuthStrategy {
+ private final String token;
+ @Override
+ public void applyAuth(Request request) {
+ request.addHeaderParam("Authorization", "Bearer " + token);
+ }
+}
diff --git a/src/main/java/com/sendgrid/http/httpclient/ApiKeyHttpClient.java b/src/main/java/com/sendgrid/http/httpclient/ApiKeyHttpClient.java
new file mode 100644
index 00000000..e7e406a8
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/httpclient/ApiKeyHttpClient.java
@@ -0,0 +1,158 @@
+package com.sendgrid.http.httpclient;
+
+import com.sendgrid.constant.Config;
+import com.sendgrid.constant.EnumConstants;
+import com.sendgrid.http.HttpMethod;
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpVersion;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.RequestBuilder;
+import org.apache.http.client.utils.HttpClientUtils;
+import org.apache.http.config.SocketConfig;
+import org.apache.http.entity.BufferedHttpEntity;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicHeader;
+
+public class ApiKeyHttpClient extends HttpClient {
+
+ protected final org.apache.http.client.HttpClient client;
+
+ private boolean isCustomClient;
+
+ /**
+ * Create a new HTTP Client.
+ */
+ public ApiKeyHttpClient() {
+ this(DEFAULT_REQUEST_CONFIG);
+ }
+
+ /**
+ * Create a new HTTP Client with a custom request config.
+ *
+ * @param requestConfig a RequestConfig.
+ */
+ public ApiKeyHttpClient(final RequestConfig requestConfig) {
+ this(requestConfig, DEFAULT_SOCKET_CONFIG);
+ }
+
+ /**
+ * Create a new HTTP Client with a custom request and socket config.
+ *
+ * @param requestConfig a RequestConfig.
+ * @param socketConfig a SocketConfig.
+ */
+ public ApiKeyHttpClient(final RequestConfig requestConfig, final SocketConfig socketConfig) {
+ Collection headers = Arrays.asList(
+ new BasicHeader("X-Sendgrid-Client", "java-" + Config.VERSION),
+ new BasicHeader(HttpHeaders.ACCEPT, "application/json"),
+ new BasicHeader(HttpHeaders.ACCEPT_ENCODING, "utf-8")
+ );
+
+ String googleAppEngineVersion = System.getProperty("com.google.appengine.runtime.version");
+ boolean isGoogleAppEngine = googleAppEngineVersion != null && !googleAppEngineVersion.isEmpty();
+
+ org.apache.http.impl.client.HttpClientBuilder clientBuilder = HttpClientBuilder.create();
+
+ if (!isGoogleAppEngine) {
+ clientBuilder.useSystemProperties();
+ }
+
+ PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
+ connectionManager.setDefaultSocketConfig(socketConfig);
+ /*
+ * Example: Lets say client has one server.
+ * There are 4 servers on edge handling client request.
+ * Each request takes on an average 500ms (2 request per second)
+ * Total number request can be server in a second from a route: 20 * 4 * 2 (DefaultMaxPerRoute * edge servers * request per second)
+ */
+ connectionManager.setDefaultMaxPerRoute(20);
+ connectionManager.setMaxTotal(100);
+
+ client = clientBuilder
+ .setConnectionManager(connectionManager)
+ .setDefaultRequestConfig(requestConfig)
+ .setDefaultHeaders(headers)
+ .setRedirectStrategy(this.getRedirectStrategy())
+ .build();
+ }
+
+ /**
+ * Create a new HTTP Client using custom configuration.
+ * @param clientBuilder an HttpClientBuilder.
+ */
+ public ApiKeyHttpClient(HttpClientBuilder clientBuilder) {
+ Collection headers = Arrays.asList(
+ new BasicHeader("X-Sendgrid-Client", "java-" + Config.VERSION),
+ new BasicHeader(HttpHeaders.ACCEPT, "application/json"),
+ new BasicHeader(HttpHeaders.ACCEPT_ENCODING, "utf-8")
+ );
+ isCustomClient = true;
+
+ client = clientBuilder
+ .setDefaultHeaders(headers)
+ .setRedirectStrategy(this.getRedirectStrategy())
+ .build();
+ }
+
+ /**
+ * Make a request.
+ *
+ * @param request request to make
+ * @return Response of the HTTP request
+ */
+ public Response makeRequest(final Request request) {
+
+ HttpMethod method = request.getMethod();
+ RequestBuilder builder = RequestBuilder.create(method.toString())
+ .setUri(request.getUrl())
+ .setVersion(HttpVersion.HTTP_1_1)
+ .setCharset(StandardCharsets.UTF_8);
+
+ for (Map.Entry entry : request.getHeaders().entrySet()) {
+ builder.addHeader(entry.getKey(), entry.getValue());
+ }
+
+ if (request.getBody() != null) {
+ HttpEntity entity = new StringEntity(request.getBody(), ContentType.APPLICATION_JSON);
+ builder.setEntity(entity);
+ builder.addHeader(
+ HttpHeaders.CONTENT_TYPE, EnumConstants.ContentType.JSON.getValue());
+
+ }
+ builder.addHeader(HttpHeaders.USER_AGENT, HttpUtility.getUserAgentString(request.getUserAgentExtensions(), isCustomClient));
+
+ HttpResponse response = null;
+
+ try {
+ response = client.execute(builder.build());
+ HttpEntity entity = response.getEntity();
+ return new Response(
+ // Consume the entire HTTP response before returning the stream
+ entity == null ? null : new BufferedHttpEntity(entity).getContent(),
+ response.getStatusLine().getStatusCode(),
+ response.getAllHeaders()
+ );
+ } catch (IOException e) {
+ System.out.println("Exception occurred");
+ } finally {
+ // Ensure this response is properly closed
+ HttpClientUtils.closeQuietly(response);
+
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/com/sendgrid/http/httpclient/HttpClient.java b/src/main/java/com/sendgrid/http/httpclient/HttpClient.java
new file mode 100644
index 00000000..2df808f8
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/httpclient/HttpClient.java
@@ -0,0 +1,138 @@
+package com.sendgrid.http.httpclient;
+
+import com.sendgrid.http.Request;
+import com.sendgrid.http.Response;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.http.client.RedirectStrategy;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.config.SocketConfig;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+
+// Retry Logic
+public abstract class HttpClient {
+
+ public static final int CONNECTION_TIMEOUT = 10000;
+ public static final int SOCKET_TIMEOUT = 30500;
+ public static final RequestConfig DEFAULT_REQUEST_CONFIG = RequestConfig
+ .custom()
+ .setConnectTimeout(CONNECTION_TIMEOUT)
+ .setSocketTimeout(SOCKET_TIMEOUT)
+ .build();
+ public static final SocketConfig DEFAULT_SOCKET_CONFIG = SocketConfig
+ .custom()
+ .setSoTimeout(SOCKET_TIMEOUT)
+ .build();
+
+ public static final int ANY_500 = -500;
+ public static final int ANY_400 = -400;
+ public static final int ANY_300 = -300;
+ public static final int ANY_200 = -200;
+ public static final int ANY_100 = -100;
+
+ public static final int[] RETRY_CODES = new int[] {ANY_500};
+ public static final int RETRIES = 3;
+ public static final long DELAY_MILLIS = 100L;
+
+ // Default redirect strategy to not auto-redirect for any methods (empty string array).
+ @Getter
+ @Setter
+ private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy(new String[0]);
+
+ @Getter
+ private Response lastResponse;
+ @Getter
+ private Request lastRequest;
+
+ /**
+ * Make a request.
+ *
+ * @param request request to make
+ * @return Response of the HTTP request
+ */
+ public Response reliableRequest(final Request request) {
+ return reliableRequest(request, RETRY_CODES, RETRIES, DELAY_MILLIS);
+ }
+
+ /**
+ * Make a request.
+ *
+ * @param request request to make
+ * @param retryCodes codes used for retries
+ * @param retries max number of retries
+ * @param delayMillis delays between retries
+ * @return Response of the HTTP request
+ */
+ public Response reliableRequest(final Request request, final int[] retryCodes, int retries,
+ final long delayMillis) {
+ lastRequest = request;
+ Response response = null;
+ while (retries > 0) {
+ response = makeRequest(request);
+
+ if (!shouldRetry(response, retryCodes)) {
+ break;
+ }
+
+ try {
+ Thread.sleep(delayMillis);
+ } catch (final InterruptedException e) {
+ // Delay failed, continue
+ }
+
+ // Decrement retries
+ retries--;
+ }
+
+ lastResponse = response;
+
+ return response;
+ }
+
+ public boolean shouldRetry(final Response response, final int[] retryCodes) {
+ if (response == null) {
+ return true;
+ }
+
+ int statusCode = response.getStatusCode();
+ int category = (int) Math.floor(statusCode / 100.0);
+
+ for (final int retryCode : retryCodes) {
+ switch (retryCode) {
+ case ANY_100:
+ if (category == 1) {
+ return true;
+ }
+ break;
+ case ANY_200:
+ if (category == 2) {
+ return true;
+ }
+ break;
+ case ANY_300:
+ if (category == 3) {
+ return true;
+ }
+ break;
+ case ANY_400:
+ if (category == 4) {
+ return true;
+ }
+ break;
+ case ANY_500:
+ if (category == 5) {
+ return true;
+ }
+ break;
+ default:
+ if (statusCode == retryCode) {
+ return true;
+ }
+ break;
+ }
+ }
+ return false;
+ }
+
+ public abstract Response makeRequest(final Request request);
+}
diff --git a/src/main/java/com/sendgrid/http/httpclient/HttpUtility.java b/src/main/java/com/sendgrid/http/httpclient/HttpUtility.java
new file mode 100644
index 00000000..17ccdfec
--- /dev/null
+++ b/src/main/java/com/sendgrid/http/httpclient/HttpUtility.java
@@ -0,0 +1,36 @@
+package com.sendgrid.http.httpclient;
+
+import com.sendgrid.constant.Config;
+import lombok.experimental.UtilityClass;
+
+import java.util.List;
+
+@UtilityClass
+class HttpUtility {
+ public String getUserAgentString(final List userAgentExtensions) {
+ StringBuilder userAgentString = new StringBuilder();
+ userAgentString.append("sendgrid-java/")
+ .append(Config.VERSION)
+ .append(" (")
+ .append(Config.OS_NAME)
+ .append(" ")
+ .append(Config.OS_ARCH)
+ .append(") ")
+ .append("java/")
+ .append(Config.JAVA_VERSION);
+
+ if (userAgentExtensions != null && !userAgentExtensions.isEmpty()) {
+ userAgentExtensions.stream().forEach(userAgentExtension -> {
+ userAgentString.append(" ");
+ userAgentString.append(userAgentExtension);
+ });
+ }
+
+ return userAgentString.toString();
+ }
+
+ public String getUserAgentString(final List userAgentExtensions, final boolean isCustomClient) {
+ return isCustomClient ? getUserAgentString(userAgentExtensions) + " custom"
+ : getUserAgentString(userAgentExtensions);
+ }
+}
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..724a398b
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/AuthenticateAccount.java
@@ -0,0 +1,165 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..dbe49c17
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/CreateAccount.java
@@ -0,0 +1,188 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..b41c6e58
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/DeleteAccount.java
@@ -0,0 +1,178 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..1efe9fb1
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/GetAccountState.java
@@ -0,0 +1,188 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..9991ad15
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccount.java
@@ -0,0 +1,191 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..d86ba204
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListAccountOffering.java
@@ -0,0 +1,188 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..290deb28
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/ListOffering.java
@@ -0,0 +1,179 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..224cbc0f
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountOffering.java
@@ -0,0 +1,187 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..caa967f7
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/UpdateAccountState.java
@@ -0,0 +1,177 @@
+/*
+ * 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()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "502")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "503")) {
+ Object error = JsonUtil.fromJson(
+ response.getStream(),
+ Object.class
+ );
+ throw new ApiErrorResponse(
+ statusCode,
+ null,
+ error,
+ response.getHeaders()
+ );
+ }
+
+ if (Matcher.matches(Integer.toString(statusCode), "504")) {
+ 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..44a66184
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/accountprovisioning/models/AccountProvisioningPagination.java
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+ public AccountProvisioningPagination() {}
+
+ private AccountProvisioningPagination(Builder builder) {
+ this.last = builder.last;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String last;
+
+ public Builder() {}
+
+ public Builder last(String last) {
+ this.last = last;
+ 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);
+ 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..86447d12
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteAuthenticatedDomain.java
@@ -0,0 +1,84 @@
+/*
+ * 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 send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/{domain_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(
+ "DeleteAuthenticatedDomain 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 (domainId != null) {
+ request.addPathParam("domain_id", domainId.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/domainauthentication/DeleteIpFromAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteIpFromAuthenticatedDomain.java
new file mode 100644
index 00000000..3d7f73ce
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DeleteIpFromAuthenticatedDomain.java
@@ -0,0 +1,98 @@
+/*
+ * 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.AuthenticatedDomainSpf;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class DeleteIpFromAuthenticatedDomain extends ApiKeyBase {
+
+ private final Integer id;
+ private final String ip;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{id}/ips/{ip}";
+ 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(
+ "DeleteIpFromAuthenticatedDomain 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());
+ }
+ if (ip != null) {
+ request.addPathParam("ip", ip.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/domainauthentication/DisassociateAuthenticatedDomainFromUser.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DisassociateAuthenticatedDomainFromUser.java
new file mode 100644
index 00000000..522a25fd
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DisassociateAuthenticatedDomainFromUser.java
@@ -0,0 +1,75 @@
+/*
+ * 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 DisassociateAuthenticatedDomainFromUser extends ApiKeyBase {
+
+ @Setter
+ private String username;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/subuser";
+ Request request = new Request(
+ HttpMethod.DELETE,
+ path,
+ Domains.API.toString()
+ );
+ addQueryParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "DisassociateAuthenticatedDomainFromUser 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 addQueryParams(Request request) {
+ if (username != null) {
+ request.addQueryParam("username", username.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DisassociateSubuserFromDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DisassociateSubuserFromDomain.java
new file mode 100644
index 00000000..58deabea
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/DisassociateSubuserFromDomain.java
@@ -0,0 +1,84 @@
+/*
+ * 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 DisassociateSubuserFromDomain extends ApiKeyBase {
+
+ private final Integer domainId;
+
+ @Setter
+ private String username;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/{domain_id}/subuser";
+ Request request = new Request(
+ HttpMethod.DELETE,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addQueryParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "DisassociateSubuserFromDomain 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 (domainId != null) {
+ request.addPathParam("domain_id", domainId.toString());
+ }
+ }
+
+ private void addQueryParams(Request request) {
+ if (username != null) {
+ request.addQueryParam("username", username.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/EmailDnsRecord.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/EmailDnsRecord.java
new file mode 100644
index 00000000..804eac8c
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/EmailDnsRecord.java
@@ -0,0 +1,91 @@
+/*
+ * 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.EmailDnsRecord400Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.EmailDnsRecordRequest;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class EmailDnsRecord extends ApiKeyBase {
+
+ @Setter
+ private EmailDnsRecordRequest emailDnsRecordRequest;
+
+ public ApiResponse send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/dns/email";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addBody(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "EmailDnsRecord 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")) {
+ EmailDnsRecord400Response error = JsonUtil.fromJson(
+ response.getStream(),
+ EmailDnsRecord400Response.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 addBody(final Request request) {
+ if (emailDnsRecordRequest != null) {
+ request.addBody(JsonUtil.toJson(emailDnsRecordRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/GetAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/GetAuthenticatedDomain.java
new file mode 100644
index 00000000..be1d04f7
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/GetAuthenticatedDomain.java
@@ -0,0 +1,91 @@
+/*
+ * 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.AuthenticatedDomain;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class GetAuthenticatedDomain extends ApiKeyBase {
+
+ private final String domainId;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{domain_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(
+ "GetAuthenticatedDomain 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 addPathParams(Request request) {
+ if (domainId != null) {
+ request.addPathParam("domain_id", domainId.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/domainauthentication/ListAllAuthenticatedDomainWithUser.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAllAuthenticatedDomainWithUser.java
new file mode 100644
index 00000000..3e624d3f
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAllAuthenticatedDomainWithUser.java
@@ -0,0 +1,81 @@
+/*
+ * 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.ListAllAuthenticatedDomainWithUser200ResponseInner;
+import com.sendgrid.util.JsonUtil;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class ListAllAuthenticatedDomainWithUser extends ApiKeyBase {
+
+ private final String username;
+
+ public ApiResponse<
+ List
+ > send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/subuser/all";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addQueryParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListAllAuthenticatedDomainWithUser 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 addQueryParams(Request request) {
+ if (username != null) {
+ request.addQueryParam("username", username.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomain.java
new file mode 100644
index 00000000..dc2e1e96
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomain.java
@@ -0,0 +1,117 @@
+/*
+ * 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 java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ListAuthenticatedDomain extends ApiKeyBase {
+
+ @Setter
+ private Integer limit;
+
+ @Setter
+ private Integer offset;
+
+ @Setter
+ private Boolean excludeSubusers;
+
+ @Setter
+ private String username;
+
+ @Setter
+ private String domain;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse> send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains";
+ 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(
+ "ListAuthenticatedDomain 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());
+ }
+ }
+
+ private void addQueryParams(Request request) {
+ if (limit != null) {
+ request.addQueryParam("limit", limit.toString());
+ }
+ if (offset != null) {
+ request.addQueryParam("offset", offset.toString());
+ }
+ if (excludeSubusers != null) {
+ request.addQueryParam(
+ "exclude_subusers",
+ excludeSubusers.toString()
+ );
+ }
+ if (username != null) {
+ request.addQueryParam("username", username.toString());
+ }
+ if (domain != null) {
+ request.addQueryParam("domain", domain.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomainWithUser.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomainWithUser.java
new file mode 100644
index 00000000..a0c91a81
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListAuthenticatedDomainWithUser.java
@@ -0,0 +1,83 @@
+/*
+ * 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.AuthenticatedDomainSpf;
+import com.sendgrid.util.JsonUtil;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+public class ListAuthenticatedDomainWithUser extends ApiKeyBase {
+
+ private final String username;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/subuser";
+ Request request = new Request(
+ HttpMethod.GET,
+ path,
+ Domains.API.toString()
+ );
+ addQueryParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ListAuthenticatedDomainWithUser 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 addQueryParams(Request request) {
+ if (username != null) {
+ request.addQueryParam("username", username.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListDefaultAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListDefaultAuthenticatedDomain.java
new file mode 100644
index 00000000..fd98c3f7
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ListDefaultAuthenticatedDomain.java
@@ -0,0 +1,90 @@
+/*
+ * 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 java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ListDefaultAuthenticatedDomain extends ApiKeyBase {
+
+ @Setter
+ private String domain;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse> send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/default";
+ 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(
+ "ListDefaultAuthenticatedDomain 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());
+ }
+ }
+
+ private void addQueryParams(Request request) {
+ if (domain != null) {
+ request.addQueryParam("domain", domain.toString());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/UpdateAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/UpdateAuthenticatedDomain.java
new file mode 100644
index 00000000..764544c6
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/UpdateAuthenticatedDomain.java
@@ -0,0 +1,100 @@
+/*
+ * 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.UpdateAuthenticatedDomainRequest;
+import com.sendgrid.util.JsonUtil;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class UpdateAuthenticatedDomain extends ApiKeyBase {
+
+ private final String domainId;
+
+ @Setter
+ private String onBehalfOf;
+
+ @Setter
+ private UpdateAuthenticatedDomainRequest updateAuthenticatedDomainRequest;
+
+ public ApiResponse> send(final ApiKeyRestClient client) {
+ String path = "/v3/whitelabel/domains/{domain_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(
+ "UpdateAuthenticatedDomain 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 addPathParams(Request request) {
+ if (domainId != null) {
+ request.addPathParam("domain_id", domainId.toString());
+ }
+ }
+
+ private void addHeaderParams(Request request) {
+ if (onBehalfOf != null) {
+ request.addHeaderParam("on-behalf-of", onBehalfOf.toString());
+ }
+ }
+
+ private void addBody(final Request request) {
+ if (updateAuthenticatedDomainRequest != null) {
+ request.addBody(JsonUtil.toJson(updateAuthenticatedDomainRequest));
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ValidateAuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ValidateAuthenticatedDomain.java
new file mode 100644
index 00000000..cc0db049
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/ValidateAuthenticatedDomain.java
@@ -0,0 +1,110 @@
+/*
+ * 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.ValidateAuthenticatedDomain200Response;
+import com.sendgrid.rest.api.v3.domainauthentication.models.ValidateAuthenticatedDomain500Response;
+import com.sendgrid.util.JsonUtil;
+import com.sendgrid.util.Matcher;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+
+@RequiredArgsConstructor
+public class ValidateAuthenticatedDomain extends ApiKeyBase {
+
+ private final Integer id;
+
+ @Setter
+ private String onBehalfOf;
+
+ public ApiResponse send(
+ final ApiKeyRestClient client
+ ) {
+ String path = "/v3/whitelabel/domains/{id}/validate";
+ Request request = new Request(
+ HttpMethod.POST,
+ path,
+ Domains.API.toString()
+ );
+ addPathParams(request);
+ addHeaderParams(request);
+ Response response = client.request(request);
+
+ if (response == null) {
+ throw new ApiConnectionException(
+ "ValidateAuthenticatedDomain creation failed: Unable to connect to server"
+ );
+ } else if (
+ !ApplicationConstants.SUCCESS.test(response.getStatusCode())
+ ) {
+ int statusCode = response.getStatusCode();
+ if (Matcher.matches(Integer.toString(statusCode), "500")) {
+ ValidateAuthenticatedDomain500Response error =
+ JsonUtil.fromJson(
+ response.getStream(),
+ ValidateAuthenticatedDomain500Response.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(),
+ ValidateAuthenticatedDomain200Response.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());
+ }
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AddIpToAuthenticatedDomainRequest.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AddIpToAuthenticatedDomainRequest.java
new file mode 100644
index 00000000..17225ffa
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AddIpToAuthenticatedDomainRequest.java
@@ -0,0 +1,62 @@
+/*
+ * 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.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 AddIpToAuthenticatedDomainRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("ip")
+ @Getter
+ @Setter
+ private String ip;
+
+ public AddIpToAuthenticatedDomainRequest() {}
+
+ private AddIpToAuthenticatedDomainRequest(Builder builder) {
+ this.ip = builder.ip;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String ip;
+
+ public Builder(String ip) {
+ this.ip = ip;
+ }
+
+ public AddIpToAuthenticatedDomainRequest build() {
+ return new AddIpToAuthenticatedDomainRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AddIpToAuthenticatedDomainRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (ip != null) joiner.add("ip=" + ip);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AssociateSubuserWithDomainRequest.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AssociateSubuserWithDomainRequest.java
new file mode 100644
index 00000000..24594332
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AssociateSubuserWithDomainRequest.java
@@ -0,0 +1,62 @@
+/*
+ * 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.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 AssociateSubuserWithDomainRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("username")
+ @Getter
+ @Setter
+ private String username;
+
+ public AssociateSubuserWithDomainRequest() {}
+
+ private AssociateSubuserWithDomainRequest(Builder builder) {
+ this.username = builder.username;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String username;
+
+ public Builder(String username) {
+ this.username = username;
+ }
+
+ public AssociateSubuserWithDomainRequest build() {
+ return new AssociateSubuserWithDomainRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AssociateSubuserWithDomainRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (username != null) joiner.add("username=" + username);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticateDomainRequest.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticateDomainRequest.java
new file mode 100644
index 00000000..0419e5d4
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticateDomainRequest.java
@@ -0,0 +1,179 @@
+/*
+ * 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.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 AuthenticateDomainRequest {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("domain")
+ @Getter
+ @Setter
+ private String domain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("subdomain")
+ @Getter
+ @Setter
+ private String subdomain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("username")
+ @Getter
+ @Setter
+ private String username;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("ips")
+ @Getter
+ @Setter
+ private List ips;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("custom_spf")
+ @Getter
+ @Setter
+ private Boolean customSpf;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("default")
+ @Getter
+ @Setter
+ private Boolean _default;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("automatic_security")
+ @Getter
+ @Setter
+ private Boolean automaticSecurity;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("custom_dkim_selector")
+ @Getter
+ @Setter
+ private String customDkimSelector;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("region")
+ @Getter
+ @Setter
+ private String region;
+
+ public AuthenticateDomainRequest() {}
+
+ private AuthenticateDomainRequest(Builder builder) {
+ this.domain = builder.domain;
+ this.subdomain = builder.subdomain;
+ this.username = builder.username;
+ this.ips = builder.ips;
+ this.customSpf = builder.customSpf;
+ this._default = builder._default;
+ this.automaticSecurity = builder.automaticSecurity;
+ this.customDkimSelector = builder.customDkimSelector;
+ this.region = builder.region;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private String domain;
+ private String subdomain;
+ private String username;
+ private List ips;
+ private Boolean customSpf;
+ private Boolean _default;
+ private Boolean automaticSecurity;
+ private String customDkimSelector;
+ private String region;
+
+ public Builder(String domain) {
+ this.domain = domain;
+ }
+
+ public Builder subdomain(String subdomain) {
+ this.subdomain = subdomain;
+ return this;
+ }
+
+ public Builder username(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public Builder ips(List ips) {
+ this.ips = ips;
+ return this;
+ }
+
+ public Builder customSpf(Boolean customSpf) {
+ this.customSpf = customSpf;
+ return this;
+ }
+
+ public Builder _default(Boolean _default) {
+ this._default = _default;
+ return this;
+ }
+
+ public Builder automaticSecurity(Boolean automaticSecurity) {
+ this.automaticSecurity = automaticSecurity;
+ return this;
+ }
+
+ public Builder customDkimSelector(String customDkimSelector) {
+ this.customDkimSelector = customDkimSelector;
+ return this;
+ }
+
+ public Builder region(String region) {
+ this.region = region;
+ return this;
+ }
+
+ public AuthenticateDomainRequest build() {
+ return new AuthenticateDomainRequest(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AuthenticateDomainRequest.class.getSimpleName() + "(",
+ ")"
+ );
+ if (domain != null) joiner.add("domain=" + domain);
+ if (subdomain != null) joiner.add("subdomain=" + subdomain);
+ if (username != null) joiner.add("username=" + username);
+ if (ips != null) joiner.add("ips=" + ips);
+ if (customSpf != null) joiner.add("customSpf=" + customSpf);
+ if (_default != null) joiner.add("_default=" + _default);
+ if (automaticSecurity != null) joiner.add(
+ "automaticSecurity=" + automaticSecurity
+ );
+ if (customDkimSelector != null) joiner.add(
+ "customDkimSelector=" + customDkimSelector
+ );
+ if (region != null) joiner.add("region=" + region);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomain.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomain.java
new file mode 100644
index 00000000..85b6dae6
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomain.java
@@ -0,0 +1,190 @@
+/*
+ * 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.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.domainauthentication.models.ListAllAuthenticatedDomainWithUser200ResponseInnerDns;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AuthenticatedDomain {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private BigDecimal id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("user_id")
+ @Getter
+ @Setter
+ private BigDecimal userId;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("subdomain")
+ @Getter
+ @Setter
+ private String subdomain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("domain")
+ @Getter
+ @Setter
+ private String domain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("username")
+ @Getter
+ @Setter
+ private String username;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("ips")
+ @Getter
+ @Setter
+ private List ips;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("custom_spf")
+ @Getter
+ @Setter
+ private Boolean customSpf;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("default")
+ @Getter
+ @Setter
+ private Boolean _default;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("legacy")
+ @Getter
+ @Setter
+ private Boolean legacy;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("automatic_security")
+ @Getter
+ @Setter
+ private Boolean automaticSecurity;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("valid")
+ @Getter
+ @Setter
+ private Boolean valid;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("dns")
+ @Getter
+ @Setter
+ private ListAllAuthenticatedDomainWithUser200ResponseInnerDns dns;
+
+ public AuthenticatedDomain() {}
+
+ private AuthenticatedDomain(Builder builder) {
+ this.id = builder.id;
+ this.userId = builder.userId;
+ this.subdomain = builder.subdomain;
+ this.domain = builder.domain;
+ this.username = builder.username;
+ this.ips = builder.ips;
+ this.customSpf = builder.customSpf;
+ this._default = builder._default;
+ this.legacy = builder.legacy;
+ this.automaticSecurity = builder.automaticSecurity;
+ this.valid = builder.valid;
+ this.dns = builder.dns;
+ }
+
+ // Builder class for constructing object
+ public static class Builder {
+
+ private BigDecimal id;
+ private BigDecimal userId;
+ private String subdomain;
+ private String domain;
+ private String username;
+ private List ips;
+ private Boolean customSpf;
+ private Boolean _default;
+ private Boolean legacy;
+ private Boolean automaticSecurity;
+ private Boolean valid;
+ private ListAllAuthenticatedDomainWithUser200ResponseInnerDns dns;
+
+ public Builder(
+ BigDecimal id,
+ BigDecimal userId,
+ String subdomain,
+ String domain,
+ String username,
+ List ips,
+ Boolean customSpf,
+ Boolean _default,
+ Boolean legacy,
+ Boolean automaticSecurity,
+ Boolean valid,
+ ListAllAuthenticatedDomainWithUser200ResponseInnerDns dns
+ ) {
+ this.id = id;
+ this.userId = userId;
+ this.subdomain = subdomain;
+ this.domain = domain;
+ this.username = username;
+ this.ips = ips;
+ this.customSpf = customSpf;
+ this._default = _default;
+ this.legacy = legacy;
+ this.automaticSecurity = automaticSecurity;
+ this.valid = valid;
+ this.dns = dns;
+ }
+
+ public AuthenticatedDomain build() {
+ return new AuthenticatedDomain(this);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringJoiner joiner = new StringJoiner(
+ ", ",
+ AuthenticatedDomain.class.getSimpleName() + "(",
+ ")"
+ );
+ if (id != null) joiner.add("id=" + id);
+ if (userId != null) joiner.add("userId=" + userId);
+ if (subdomain != null) joiner.add("subdomain=" + subdomain);
+ if (domain != null) joiner.add("domain=" + domain);
+ if (username != null) joiner.add("username=" + username);
+ if (ips != null) joiner.add("ips=" + ips);
+ if (customSpf != null) joiner.add("customSpf=" + customSpf);
+ if (_default != null) joiner.add("_default=" + _default);
+ if (legacy != null) joiner.add("legacy=" + legacy);
+ if (automaticSecurity != null) joiner.add(
+ "automaticSecurity=" + automaticSecurity
+ );
+ if (valid != null) joiner.add("valid=" + valid);
+ if (dns != null) joiner.add("dns=" + dns);
+ return joiner.toString();
+ }
+}
diff --git a/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomainSpf.java b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomainSpf.java
new file mode 100644
index 00000000..62b11430
--- /dev/null
+++ b/src/main/java/com/sendgrid/rest/api/v3/domainauthentication/models/AuthenticatedDomainSpf.java
@@ -0,0 +1,192 @@
+/*
+ * 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.models;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sendgrid.rest.api.v3.domainauthentication.models.AuthenticatedDomainSpfDns;
+import java.util.List;
+import java.util.StringJoiner;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@ToString
+public class AuthenticatedDomainSpf {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("id")
+ @Getter
+ @Setter
+ private Integer id;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("domain")
+ @Getter
+ @Setter
+ private String domain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("subdomain")
+ @Getter
+ @Setter
+ private String subdomain;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("username")
+ @Getter
+ @Setter
+ private String username;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("user_id")
+ @Getter
+ @Setter
+ private Integer userId;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("ips")
+ @Getter
+ @Setter
+ private List