diff --git a/CHANGELOG.md b/CHANGELOG.md index 16618fd6..8c86ee71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## main +- NEW: Added `alias_email` and `destination_email` to `EmailForward` +- CHANGED: Deprecated `from` and `to` fields in `EmailForward` + ## 1.0.0 - BREAKING: Remove the `privateKey` property of `CertificateBundle`. Use `Certificates.getCertificatePrivateKey()` instead. See [dnsimple-java#118](https://github.com/dnsimple/dnsimple-java/issues/118) diff --git a/VERSION b/VERSION index a602fc9e..afaf360d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.4 +1.0.0 \ No newline at end of file diff --git a/src/main/java/com/dnsimple/data/EmailForward.java b/src/main/java/com/dnsimple/data/EmailForward.java index c77bba21..26ade7cc 100644 --- a/src/main/java/com/dnsimple/data/EmailForward.java +++ b/src/main/java/com/dnsimple/data/EmailForward.java @@ -5,16 +5,16 @@ public class EmailForward { private final Long id; private final Long domainId; - private final String from; - private final String to; + private final String aliasEmail; + private final String destinationEmail; private final OffsetDateTime createdAt; private final OffsetDateTime updatedAt; - public EmailForward(Long id, Long domainId, String from, String to, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + public EmailForward(Long id, Long domainId, String aliasEmail, String destinationEmail, OffsetDateTime createdAt, OffsetDateTime updatedAt) { this.id = id; this.domainId = domainId; - this.from = from; - this.to = to; + this.aliasEmail = aliasEmail; + this.destinationEmail = destinationEmail; this.createdAt = createdAt; this.updatedAt = updatedAt; } @@ -27,12 +27,28 @@ public Long getDomainId() { return domainId; } + /** + * @deprecated use {@link #getAliasEmail()} instead + */ + @Deprecated(since = "1.1.0", forRemoval = true) public String getFrom() { - return from; + return aliasEmail; } + /** + * @deprecated use {@link #getDestinationEmail} instead + */ + @Deprecated(since = "1.1.0", forRemoval = true) public String getTo() { - return to; + return destinationEmail; + } + + public String getAliasEmail() { + return aliasEmail; + } + + public String getDestinationEmail() { + return destinationEmail; } public OffsetDateTime getCreatedAt() { diff --git a/src/main/java/com/dnsimple/endpoints/Registrar.java b/src/main/java/com/dnsimple/endpoints/Registrar.java index b23d9b55..275cbf1e 100644 --- a/src/main/java/com/dnsimple/endpoints/Registrar.java +++ b/src/main/java/com/dnsimple/endpoints/Registrar.java @@ -45,9 +45,9 @@ public SimpleResponse checkDomain(Number account, String domainName * @param action The action to get the price of * @return The premium price * @see https://developer.dnsimple.com/v2/registrar/#getDomainPremiumPrice - * @deprecated As of this version 0.9.1, replaced by {@link #getDomainPrices(Number, String)} + * @deprecated use {@link #getDomainPrices(Number, String)} instead */ - @Deprecated + @Deprecated(since="0.9.1", forRemoval = true) public SimpleResponse getDomainPremiumPrice(Number account, String domainName, DomainCheckPremiumPriceAction action) { var options = ListOptions.empty().filter("action", action.name().toLowerCase()); return client.simple(GET, account + "/registrar/domains/" + domainName + "/premium_price", options, action, DomainPremiumPriceCheck.class); diff --git a/src/main/java/com/dnsimple/request/DSRecordOptions.java b/src/main/java/com/dnsimple/request/DSRecordOptions.java index 327c5272..7d8341d8 100644 --- a/src/main/java/com/dnsimple/request/DSRecordOptions.java +++ b/src/main/java/com/dnsimple/request/DSRecordOptions.java @@ -16,11 +16,9 @@ private DSRecordOptions(String algorithm, String digest, String digestType, Stri } /** - * @deprecated - * Replaced with more specific factory methods - *

Use {@link #dsData(String, String, String, String)}, and {@link #keyData(String, String)} instead. + * @deprecated use {@link #dsData(String, String, String, String)}, and {@link #keyData(String, String)} instead. */ - @Deprecated(forRemoval = true) + @Deprecated(since = "0.9.3", forRemoval = true) public static DSRecordOptions of(String algorithm, String digest, String digestType, String keytag) { return new DSRecordOptions(algorithm, digest, digestType, keytag, null); } diff --git a/src/test/java/com/dnsimple/endpoints/DomainEmailForwardsTest.java b/src/test/java/com/dnsimple/endpoints/DomainEmailForwardsTest.java index 51121770..e35f032d 100644 --- a/src/test/java/com/dnsimple/endpoints/DomainEmailForwardsTest.java +++ b/src/test/java/com/dnsimple/endpoints/DomainEmailForwardsTest.java @@ -43,8 +43,8 @@ public void testListEmailForwardsSupportsSorting() { public void testListEmailForwardsProducesDomainList() { server.stubFixtureAt("listEmailForwards/success.http"); PaginatedResponse response = client.domains.listEmailForwards(1, "example.com"); - assertThat(response.getData(), hasSize(2)); - assertThat(response.getData().get(0).getId(), is(17702L)); + assertThat(response.getData(), hasSize(1)); + assertThat(response.getData().get(0).getId(), is(24809L)); } @Test @@ -62,6 +62,8 @@ public void testGetEmailForward() { assertThat(emailForward.getDomainId(), is(235146L)); assertThat(emailForward.getTo(), is("example@example.com")); assertThat(emailForward.getFrom(), is("example@dnsimple.xyz")); + assertThat(emailForward.getAliasEmail(), is("example@dnsimple.xyz")); + assertThat(emailForward.getDestinationEmail(), is("example@example.com")); assertThat(emailForward.getCreatedAt(), is(OffsetDateTime.of(2021, 1, 25, 13, 54, 40, 0, UTC))); assertThat(emailForward.getUpdatedAt(), is(OffsetDateTime.of(2021, 1, 25, 13, 54, 40, 0, UTC))); } diff --git a/src/test/resources/com/dnsimple/createEmailForward/created.http b/src/test/resources/com/dnsimple/createEmailForward/created.http index ebaaa502..7eb52506 100644 --- a/src/test/resources/com/dnsimple/createEmailForward/created.http +++ b/src/test/resources/com/dnsimple/createEmailForward/created.http @@ -2,6 +2,7 @@ HTTP/1.1 201 Created Server: nginx Date: Mon, 25 Jan 2021 13:54:40 GMT Content-Type: application/json; charset=utf-8 +Transfer-Encoding: identity Connection: keep-alive X-RateLimit-Limit: 4800 X-RateLimit-Remaining: 4772 @@ -18,4 +19,4 @@ X-Permitted-Cross-Domain-Policies: none Content-Security-Policy: frame-ancestors 'none' Strict-Transport-Security: max-age=31536000 -{"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} +{"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} diff --git a/src/test/resources/com/dnsimple/getEmailForward/success.http b/src/test/resources/com/dnsimple/getEmailForward/success.http index 1733c354..23097f60 100644 --- a/src/test/resources/com/dnsimple/getEmailForward/success.http +++ b/src/test/resources/com/dnsimple/getEmailForward/success.http @@ -2,6 +2,7 @@ HTTP/1.1 200 OK Server: nginx Date: Mon, 25 Jan 2021 13:56:24 GMT Content-Type: application/json; charset=utf-8 +Transfer-Encoding: identity Connection: keep-alive X-RateLimit-Limit: 4800 X-RateLimit-Remaining: 4766 @@ -18,4 +19,4 @@ X-Permitted-Cross-Domain-Policies: none Content-Security-Policy: frame-ancestors 'none' Strict-Transport-Security: max-age=31536000 -{"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} +{"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} diff --git a/src/test/resources/com/dnsimple/listEmailForwards/success.http b/src/test/resources/com/dnsimple/listEmailForwards/success.http index 4a5a99a3..4dd40749 100644 --- a/src/test/resources/com/dnsimple/listEmailForwards/success.http +++ b/src/test/resources/com/dnsimple/listEmailForwards/success.http @@ -1,16 +1,16 @@ HTTP/1.1 200 OK Server: nginx -Date: Thu, 04 Feb 2016 14:07:19 GMT +Date: Fri, 17 May 2024 09:07:28 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive -Status: 200 OK -X-RateLimit-Limit: 4000 -X-RateLimit-Remaining: 3993 -X-RateLimit-Reset: 1454596043 -ETag: W/"3f10aae0cf0f0b81bdb4f58786ee1750" +X-RateLimit-Limit: 4800 +X-RateLimit-Remaining: 4748 +X-RateLimit-Reset: 1715936948 +X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs +ETag: W/"a5eed9a071f03e10fc67001ccc647a94" Cache-Control: max-age=0, private, must-revalidate -X-Request-Id: 6e3aa9d0-cb95-4186-93b0-630da372de86 -X-Runtime: 0.026287 -Strict-Transport-Security: max-age=31536000 +X-Request-Id: e42df983-a8a5-4123-8c74-fb89ab934aba +X-Runtime: 0.025456 +Strict-Transport-Security: max-age=63072000 -{"data":[{"id":17702,"domain_id":228963,"from":".*@a-domain.com","to":"jane.smith@example.com","created_at":"2016-02-04T13:59:29Z","updated_at":"2016-02-04T13:59:29Z"},{"id":17703,"domain_id":228963,"from":"john@a-domain.com","to":"john@example.com","created_at":"2016-02-04T14:07:13Z","updated_at":"2016-02-04T14:07:13Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} +{"data":[{"id":24809,"domain_id":235146,"alias_email":".*@a-domain.com","destination_email":"jane.smith@example.com","created_at":"2017-05-25T19:23:16Z","updated_at":"2017-05-25T19:23:16Z","from":".*@a-domain.com","to":"jane.smith@example.com"}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}}