diff --git a/src/main/java/com/resend/services/domains/model/Tls.java b/src/main/java/com/resend/services/domains/model/Tls.java new file mode 100644 index 0000000..6cde4f4 --- /dev/null +++ b/src/main/java/com/resend/services/domains/model/Tls.java @@ -0,0 +1,48 @@ +package com.resend.services.domains.model; + +/** + * Enum representing the TLS settings for a domain. + */ +public enum Tls { + /** + * Represents an enforced TLS setting. + */ + ENFORCED("enforced"), + /** + * Represents an opportunistic TLS setting. + */ + OPPORTUNISTIC("opportunistic"); + + /** + * Holds the string representation of the enum value. + */ + private final String value; + + /** + * Constructor for the Tls enum. + * + * @param value The string representation of the TLS setting. + */ + Tls(String value) { + this.value = value; + } + + /** + * Retrieves the string representation of the TLS setting. + * + * @return The string representation of the TLS setting. + */ + public String getValue() { + return value; + } + + /** + * Returns the string representation of the TLS setting. + * + * @return The string representation of the TLS setting. + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/resend/services/domains/model/UpdateDomainOptions.java b/src/main/java/com/resend/services/domains/model/UpdateDomainOptions.java index d603c46..2327ea7 100644 --- a/src/main/java/com/resend/services/domains/model/UpdateDomainOptions.java +++ b/src/main/java/com/resend/services/domains/model/UpdateDomainOptions.java @@ -15,6 +15,8 @@ public class UpdateDomainOptions { @JsonProperty("open_tracking") private final boolean openTracking; + @JsonProperty("tls") + private final Tls tls; /** * Constructs a UpdateDomainOptions object using the provided builder. * @@ -24,6 +26,7 @@ public UpdateDomainOptions(Builder builder) { this.id = builder.id; this.clickTracking = builder.clickTracking; this.openTracking = builder.openTracking; + this.tls = builder.tls; } /** @@ -53,6 +56,15 @@ public boolean getOpenTracking() { return openTracking; } + /** + * Get the TLS setting for the domain. + * + * @return The TLS setting for the domain. + */ + public Tls getTls() { + return tls; + } + /** * Create a new builder instance for constructing UpdateDomainOptions objects. * @@ -69,6 +81,7 @@ public static class Builder { private String id; private boolean clickTracking; private boolean openTracking; + private Tls tls; /** * Set the id of the domain. @@ -103,6 +116,17 @@ public Builder openTracking(boolean openTracking) { return this; } + /** + * Set the TLS setting for the domain. + * + * @param tls The TLS setting for the domain. + * @return The builder instance. + */ + public Builder tls(Tls tls) { + this.tls = tls; + return this; + } + /** * Build a new UpdateDomainOptions object. * diff --git a/src/test/java/com/resend/services/util/DomainsUtil.java b/src/test/java/com/resend/services/util/DomainsUtil.java index 21e214a..1923c02 100644 --- a/src/test/java/com/resend/services/util/DomainsUtil.java +++ b/src/test/java/com/resend/services/util/DomainsUtil.java @@ -59,6 +59,7 @@ public static final UpdateDomainOptions updateDomainRequest() { return UpdateDomainOptions.builder() .openTracking(true) .clickTracking(true) + .tls(Tls.OPPORTUNISTIC) .id("2c64b27c-6237-4626-85d2-a0a8b5832070") .build(); }