Skip to content

Routes - Add Mailgun::Routes wrapper - #402

Merged
alex-leb merged 1 commit into
masterfrom
feature/routes
Oct 14, 2026
Merged

alex-leb merged 1 commit into
masterfrom
feature/routes

Conversation

@alex-leb

Copy link
Copy Markdown
Contributor

Adds a Mailgun::Routes wrapper for the v3 Routes API, the rules that handle incoming email. Until now routes could only be managed through the raw client.

Methods

Method Endpoint
list GET /v3/routes
create POST /v3/routes
get GET /v3/routes/{id}
update PUT /v3/routes/{id}
remove DELETE /v3/routes/{id}
match GET /v3/routes/match
  • Same conventions as the other wrappers: list returns items, create/update return the response hash, remove returns a boolean, no aliases.
  • Several actions can be passed as an Array; they are sent as repeated action fields.
  • All methods require a v3 client and raise ParameterError when a route ID or match address is missing.
  • Usage is documented in docs/Routes.md, linked from the README.

Testing

  • The routes integration spec now goes through the wrapper and replays the existing routes cassette (create, list, get, update, delete), still matching on request body.
  • A new routes_match spec, recorded against the live API, creates a route, matches an address to it and deletes it. It also holds the argument and API version checks.
  • The new cassette is scrubbed like the existing ones (API key, auth header, test domain), and its X-Mailgun-Key-Id value is replaced with a placeholder.
  • Full suite, run without credentials: 419 examples, 0 failures; line coverage 96.38%; RuboCop clean.

- Add Mailgun::Routes covering the 6 v3 routes endpoints: list, create,
  get, update, remove and match
- Methods require a v3 client and raise ParameterError on a missing
  route ID or match address
- Switch the routes integration spec to the wrapper, replaying the
  existing routes cassette (create, list, get, update, delete)
- Add a routes match spec recorded against the live API (cassette
  routes_match); it also holds the argument and API version checks
- The new cassette is scrubbed like the existing ones (key, auth
  header, test domain); the X-Mailgun-Key-Id header value is replaced too
- Add docs/Routes.md and link it from the README
@alex-leb
alex-leb merged commit f108056 into master Oct 14, 2026
8 checks passed
@alex-leb
alex-leb deleted the feature/routes branch October 14, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant