Skip to content

Commit 85470c5

Browse files
authored
Add active attribute (#210)
1 parent 975e1ed commit 85470c5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/com/dnsimple/data/EmailForward.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ public class EmailForward {
77
private final Long domainId;
88
private final String aliasEmail;
99
private final String destinationEmail;
10+
private final Boolean active;
1011
private final OffsetDateTime createdAt;
1112
private final OffsetDateTime updatedAt;
1213

13-
public EmailForward(Long id, Long domainId, String aliasEmail, String destinationEmail, OffsetDateTime createdAt, OffsetDateTime updatedAt) {
14+
public EmailForward(Long id, Long domainId, String aliasEmail, String destinationEmail, Boolean active, OffsetDateTime createdAt, OffsetDateTime updatedAt) {
1415
this.id = id;
1516
this.domainId = domainId;
1617
this.aliasEmail = aliasEmail;
1718
this.destinationEmail = destinationEmail;
19+
this.active = active;
1820
this.createdAt = createdAt;
1921
this.updatedAt = updatedAt;
2022
}
@@ -51,6 +53,10 @@ public String getDestinationEmail() {
5153
return destinationEmail;
5254
}
5355

56+
public Boolean isActive() {
57+
return active;
58+
}
59+
5460
public OffsetDateTime getCreatedAt() {
5561
return createdAt;
5662
}

src/test/java/com/dnsimple/endpoints/DomainEmailForwardsTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public void testListEmailForwardsProducesDomainList() {
4545
PaginatedResponse<EmailForward> response = client.domains.listEmailForwards(1, "example.com");
4646
assertThat(response.getData(), hasSize(1));
4747
assertThat(response.getData().get(0).getId(), is(24809L));
48+
assertThat(response.getData().get(0).isActive(), is(true));
4849
}
4950

5051
@Test
@@ -64,6 +65,7 @@ public void testGetEmailForward() {
6465
assertThat(emailForward.getFrom(), is("example@dnsimple.xyz"));
6566
assertThat(emailForward.getAliasEmail(), is("example@dnsimple.xyz"));
6667
assertThat(emailForward.getDestinationEmail(), is("example@example.com"));
68+
assertThat(emailForward.isActive(), is(true));
6769
assertThat(emailForward.getCreatedAt(), is(OffsetDateTime.of(2021, 1, 25, 13, 54, 40, 0, UTC)));
6870
assertThat(emailForward.getUpdatedAt(), is(OffsetDateTime.of(2021, 1, 25, 13, 54, 40, 0, UTC)));
6971
}
@@ -91,6 +93,7 @@ public void testCreateEmailForwardProducesEmailForward() {
9193
hasEntry("destination_email", "example@example.com")
9294
));
9395
assertThat(response.getData().getId(), is(41872L));
96+
assertThat(response.getData().isActive(), is(true));
9497
}
9598

9699
@Test

0 commit comments

Comments
 (0)