Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
24 changes: 23 additions & 1 deletion .agents/skills/ep-example-authoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@ When a client library releases a new major version:
2. Update only `current` for latest major syntax/usage changes.
3. Keep endpoint/action coverage and naming consistent between versions unless API/library behavior requires divergence.

## Response Generation (Required For New/Updated Examples)

When authoring or changing docs examples, make sure the matching response JSON is generated and updated.

Quick workflow:

1. `cd tools/build_doc_json_responses`
2. Remove related cassette file(s) in `tests/cassettes` for the response(s) you need to regenerate.
3. Run `just generate` with required API keys (run it twice; first pass records, second pass writes responses):

```bash
# Source `.env` file or variables
just generate
```

4. Copy generated files from `tools/build_doc_json_responses/responses` into `official/docs/responses`.
5. Keep endpoint/action naming aligned between example snippets and response JSON paths.

For complete setup, troubleshooting, and formatting details, see:

- `tools/build_doc_json_responses/README.md`

## Consistency Checklist Before Commit

1. Filename and folder parity against curl `current` action names.
Expand All @@ -118,6 +140,7 @@ When a client library releases a new major version:
4. Placeholder IDs follow expected prefixes.
5. New data is non-PII and fixture-aligned where possible.
6. `current` directories remain present for all language docs.
7. Matching response JSON was regenerated/updated when snippet behavior changed.

## Optional Verification Commands

Expand All @@ -132,7 +155,6 @@ find official/docs/responses -maxdepth 2 -type f | head

## Anti-Patterns

- Endpoint-prefixed response filenames.
- Adding extra helper frameworks or architecture in simple snippets.
- Introducing language-specific style drift not already present in that language's `current` precedent.
- Changing historical version directories when the change should be only in `current`.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions official/docs/csharp/current/trackers/delete.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

await client.Tracker.Delete("trk_...");
}
}
}
15 changes: 15 additions & 0 deletions official/docs/golang/current/trackers/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func delete() {
client := easypost.New("EASYPOST_API_KEY")

err := client.DeleteTracker("trk_...")

fmt.Println(err)
}
12 changes: 12 additions & 0 deletions official/docs/java/current/trackers/delete.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package trackers;

import com.easypost.exception.EasyPostException;
import com.easypost.service.EasyPostClient;

public class Delete {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

client.tracker.delete("trk_...");
}
}
7 changes: 7 additions & 0 deletions official/docs/node/current/trackers/delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
await client.Tracker.delete('trk_...');
})();
5 changes: 5 additions & 0 deletions official/docs/php/current/trackers/delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$client->tracker->delete('trk_...');
5 changes: 5 additions & 0 deletions official/docs/python/current/trackers/delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

client.tracker.delete("trk_...")
5 changes: 5 additions & 0 deletions official/docs/ruby/current/trackers/delete.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

client.tracker.delete('trk_...')
8 changes: 8 additions & 0 deletions tools/build_doc_json_responses/tests/test_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ def test_trackers_batch(test_client, tracker_create):
test_client.tracker.retrieve_batch(tracking_codes=[tracker1.tracking_code])

build_response_snippet(interaction_index=1)


@pytest.mark.vcr()
def test_trackers_delete(test_client, tracker_create):
tracker1 = test_client.tracker.create(**tracker_create)
test_client.tracker.delete(id=tracker1.id)

build_response_snippet(interaction_index=1)
Loading