From 85638d8ce587af6abc708dfb805ca136fc26e594 Mon Sep 17 00:00:00 2001 From: Guillermo Gutierrez Almazor Date: Fri, 17 May 2024 11:31:39 +0200 Subject: [PATCH 1/5] Change: update test fixtures --- test/fixtures.http/createEmailForward/created.http | 3 ++- test/fixtures.http/getEmailForward/success.http | 3 ++- test/fixtures.http/listEmailForwards/success.http | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/fixtures.http/createEmailForward/created.http b/test/fixtures.http/createEmailForward/created.http index ebaaa50..7eb5250 100644 --- a/test/fixtures.http/createEmailForward/created.http +++ b/test/fixtures.http/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/test/fixtures.http/getEmailForward/success.http b/test/fixtures.http/getEmailForward/success.http index 1733c35..23097f6 100644 --- a/test/fixtures.http/getEmailForward/success.http +++ b/test/fixtures.http/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/test/fixtures.http/listEmailForwards/success.http b/test/fixtures.http/listEmailForwards/success.http index 4a5a99a..fe1ae4a 100644 --- a/test/fixtures.http/listEmailForwards/success.http +++ b/test/fixtures.http/listEmailForwards/success.http @@ -2,6 +2,7 @@ HTTP/1.1 200 OK Server: nginx Date: Thu, 04 Feb 2016 14:07:19 GMT Content-Type: application/json; charset=utf-8 +Transfer-Encoding: identity Connection: keep-alive Status: 200 OK X-RateLimit-Limit: 4000 From 337d3e28b6bac984818735cbe7c8ff9773eff81c Mon Sep 17 00:00:00 2001 From: Guillermo Gutierrez Almazor Date: Fri, 17 May 2024 11:31:43 +0200 Subject: [PATCH 2/5] Change: add `alias_email` and `destination_email` to `Dnsimple.EmailForward` --- lib/dnsimple/email_forward.ex | 4 +++- test/dnsimple/domains_test.exs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/dnsimple/email_forward.ex b/lib/dnsimple/email_forward.ex index d5f3315..020c4df 100644 --- a/lib/dnsimple/email_forward.ex +++ b/lib/dnsimple/email_forward.ex @@ -12,10 +12,12 @@ defmodule Dnsimple.EmailForward do domain_id: integer, from: String.t, to: String.t, + alias_email: String.t, + destination_email: String.t, created_at: String.t, updated_at: String.t, } - defstruct ~w(id domain_id from to created_at updated_at)a + defstruct ~w(id domain_id from to alias_email destination_email created_at updated_at)a end diff --git a/test/dnsimple/domains_test.exs b/test/dnsimple/domains_test.exs index 359bcb4..71e4531 100644 --- a/test/dnsimple/domains_test.exs +++ b/test/dnsimple/domains_test.exs @@ -343,6 +343,8 @@ defmodule Dnsimple.DomainsTest do assert data.domain_id == 235146 assert data.from == "example@dnsimple.xyz" assert data.to == "example@example.com" + assert data.alias_email == "example@dnsimple.xyz" + assert data.destination_email == "example@example.com" assert data.created_at == "2021-01-25T13:54:40Z" assert data.updated_at == "2021-01-25T13:54:40Z" end From 2525df20d2c528017c55b8d558223e526697e946 Mon Sep 17 00:00:00 2001 From: Guillermo Gutierrez Almazor Date: Fri, 17 May 2024 11:32:14 +0200 Subject: [PATCH 3/5] Change: add CHANGELOG entries --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd9bb3..72ecc09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## main +- NEW: Added `alias_email` and `destination_email` to `Dnsimple.EmailForward` + ## 4.0.0 - CHANGED: Requires Elixir >= 2.12 and OTP >= 22 From ded73f4c412d8f1c0eabba081913ec71623468d7 Mon Sep 17 00:00:00 2001 From: Guillermo Gutierrez Almazor Date: Fri, 17 May 2024 11:43:46 +0200 Subject: [PATCH 4/5] Change: update test fixture for `list` and adjust tests --- test/dnsimple/domains_test.exs | 2 +- .../listEmailForwards/success.http | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/test/dnsimple/domains_test.exs b/test/dnsimple/domains_test.exs index 71e4531..2fafeb5 100644 --- a/test/dnsimple/domains_test.exs +++ b/test/dnsimple/domains_test.exs @@ -285,7 +285,7 @@ defmodule Dnsimple.DomainsTest do data = response.data assert is_list(data) - assert length(data) == 2 + assert length(data) == 1 assert Enum.all?(data, fn(single) -> single.__struct__ == Dnsimple.EmailForward end) end end diff --git a/test/fixtures.http/listEmailForwards/success.http b/test/fixtures.http/listEmailForwards/success.http index fe1ae4a..610737e 100644 --- a/test/fixtures.http/listEmailForwards/success.http +++ b/test/fixtures.http/listEmailForwards/success.http @@ -1,17 +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 -Transfer-Encoding: identity 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}} \ No newline at end of file From 1aa2e545dda33183d1a7ad862abeb97d52fce99c Mon Sep 17 00:00:00 2001 From: Guillermo Gutierrez Almazor Date: Mon, 27 May 2024 10:30:35 +0200 Subject: [PATCH 5/5] Change: restore empty line at the end of the file --- test/fixtures.http/listEmailForwards/success.http | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures.http/listEmailForwards/success.http b/test/fixtures.http/listEmailForwards/success.http index 610737e..4dd4074 100644 --- a/test/fixtures.http/listEmailForwards/success.http +++ b/test/fixtures.http/listEmailForwards/success.http @@ -13,4 +13,4 @@ X-Request-Id: e42df983-a8a5-4123-8c74-fb89ab934aba X-Runtime: 0.025456 Strict-Transport-Security: max-age=63072000 -{"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}} \ No newline at end of file +{"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}}