Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EmailForward fields #389

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).

## main

- NEW: Added `alias_email` and `destination_email` to `EmailForward`
- CHANGED: Deprecated `from` and `to` fields in `EmailForward`

## 9.0.0

- CHANGED: Minimum Ruby version is now 3.1
Expand Down
10 changes: 9 additions & 1 deletion lib/dnsimple/struct/email_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ class EmailForward < Base
attr_accessor :domain_id

# @return [String] The "local part" of the originating email address. Anything to the left of the @ symbol.
# DEPRECATED: use `alias_email` instead
Copy link
Contributor

@jacegu jacegu May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually use YARD in this codebase? I couldn't find it in the gemfile...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 we may not be linting, or generating docs from it, but I'd say that's the format we are using for all ruby repos... The @param and @return are all YARD...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s.add_development_dependency 'yard'

attr_accessor :from

# @return [String] The full email address to forward to.
# DEPRECATED: use `destination_email` instead
attr_accessor :to

# @return [String] The receiving email recipient.
attr_accessor :alias_email

# @return [String] The email recipient the messages are delivered to.
attr_accessor :destination_email
# @return [String] Then the email forward was last updated in DNSimple.

# @return [String] When the email forward was created in DNSimple.
attr_accessor :created_at

# @return [String] Then the email forward was last updated in DNSimple.
attr_accessor :updated_at

end
Expand Down
2 changes: 2 additions & 0 deletions spec/dnsimple/client/domains_email_forwards_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
expect(result.domain_id).to eq(235146)
expect(result.from).to eq("[email protected]")
expect(result.to).to eq("[email protected]")
expect(result.alias_email).to eq("[email protected]")
expect(result.destination_email).to eq("[email protected]")
expect(result.created_at).to eq("2021-01-25T13:54:40Z")
expect(result.updated_at).to eq("2021-01-25T13:54:40Z")
end
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures.http/createEmailForward/created.http
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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":"[email protected]","destination_email":"[email protected]","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"[email protected]","to":"[email protected]"}}
{"data":{"id":41872,"domain_id":235146,"alias_email":"[email protected]","destination_email":"[email protected]","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"[email protected]","to":"[email protected]"}}
1 change: 0 additions & 1 deletion spec/fixtures.http/deleteEmailForward/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Security-Policy: frame-ancestors 'none'
Strict-Transport-Security: max-age=31536000

3 changes: 2 additions & 1 deletion spec/fixtures.http/getEmailForward/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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":"[email protected]","destination_email":"[email protected]","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"[email protected]","to":"[email protected]"}}
{"data":{"id":41872,"domain_id":235146,"alias_email":"[email protected]","destination_email":"[email protected]","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"[email protected]","to":"[email protected]"}}