refactor(ses): split resolve_action by collection and factor action parsers#342
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
…parsers - resolve_action now dispatches on the top-level collection (segs[2]) to per-collection helpers, each of which owns its own (method, len) match. Groups: account, identities, configuration-sets, templates, contact-lists, suppression, custom-verification-email-templates, dedicated-ip-pools, dedicated-ips, multi-region-endpoints, import-jobs, export-jobs, tenants, resources, reputation. Simple leaf endpoints (outbound-emails, outbound-bulk-emails, tags, metrics/batch, etc.) stay inline at the top level. - Extract decode_segment helper and ResolvedAction type alias. - Split parse_action into one parser per ReceiptAction variant (S3, SNS, Lambda, Bounce, AddHeader, Stop), chained via Option::or_else. - Extract send_bulk_destination from send_bulk_templated_email so the per-destination body construction is a named function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Summary by cubic
Split SES v2 routing and v1 receipt action parsing into small, focused helpers to improve readability and make future changes easier. No behavior changes.
resolve_actionto dispatch by top-level collection and delegate to per-collection helpers; simple leaf endpoints (e.g.outbound-emails,outbound-bulk-emails,tags,metrics/batch) stay inline.decode_segmentand aResolvedActiontype alias for clearer signatures.v1::parse_actioninto per-variant parsers (parse_s3_action,parse_sns_action,parse_lambda_action,parse_bounce_action,parse_add_header_action,parse_stop_action) chained viaor_else.send_bulk_destinationfromsend_bulk_templated_emailto isolate per-destination record creation andSentEmailconstruction.Written for commit 2bbe09a. Summary will update on new commits.