Add SDK code samples to email campaigns endpoints - #54
Open
Rabsztok wants to merge 1 commit into
Open
Conversation
All 11 email campaign operations carried only a shell sample. Add javascript, php, python, ruby, csharp and java samples to each, matching the language order and label conventions of the sibling specs. Every sample is written against the campaigns API that each SDK actually ships on origin/main, so all six languages cover all 11 operations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Rabsztok
marked this pull request as ready for review
August 31, 2026 11:25
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.
Motivation
Every one of the 11 operations in
specs/email-campaigns.openapi.ymlcarried only ashellsample, while sibling specs(e.g.
createContactincontacts.openapi.yml) carry the full SDK set. Campaigns werethe only spec with no SDK samples at all.
Changes
javascript,php,python,ruby,csharpandjavasamples to all 11 emailcampaign operations, in the language order and with the
labelconventions the siblingspecs already use. Existing
shellsamples are untouched.origin/main— verified method by method, not inferred from the spec.Coverage is complete: 6 languages x 11 operations, no gaps. All six SDKs already ship
full email-campaigns support, so nothing had to be skipped:
getEmailCampaignscreateEmailCampaigngetEmailCampaignupdateEmailCampaigndeleteEmailCampaignstartEmailCampaignscheduleEmailCampaigncancelEmailCampaignterminateEmailCampaignresetEmailCampaigngetEmailCampaignStatsEntry points used, for reviewer reference:
client.emailCampaigns.{getList,create,get,update,delete,start,schedule,cancel,terminate,reset,getStats}(new MailtrapGeneralClient($config))->emailCampaigns($accountId)->…EmailCampaign…()client.email_campaigns_api.email_campaigns.{get_list,create,get_by_id,update,delete,start,schedule,cancel,terminate,reset,get_stats}Mailtrap::EmailCampaignsAPI.new(client).{list,get,create,update,delete,start,schedule,cancel,terminate,reset,stats}client.EmailCampaigns()(collection) andclient.EmailCampaign(id)(single)client.emailCampaignsApi().emailCampaigns().…EmailCampaign…()The campaigns endpoints are token-scoped, so Node.js, Python, Ruby, .NET and Java need no
account id; PHP's resource still takes one for consistency with the other General API
resources, and the sample passes it.
Diff is purely additive (1038 insertions, 0 deletions) — no base-URL, description, or
operation-ordering changes.
Out of scope, deliberately untouched:
createSuppressionand the threetracking_opt_outsoperations inemail-sending.openapi.ymlalso lackrubysamples.How to test
specs/*.openapi.ymlPHP, Python, Ruby, .NET and Java tabs, in that order
createEmailCampaignandupdateEmailCampaign: the sample bodies use thefields the spec defines (
name,domain_id,from_display_name,from_local_part,reply_to,template_attributes,delivery_mode,delivery_options,contact_list_ids,contact_segment_ids), andscheduleEmailCampaignusesdatetime