Skip to content

Add example: GetUsageSummary with additionalProperties traversal#3488

Draft
charlie-zhang109 wants to merge 3 commits into
masterfrom
czhang/usage-summary-additional-properties-example
Draft

Add example: GetUsageSummary with additionalProperties traversal#3488
charlie-zhang109 wants to merge 3 commits into
masterfrom
czhang/usage-summary-additional-properties-example

Conversation

@charlie-zhang109

Copy link
Copy Markdown
Contributor

Summary

  • Adds examples/v1/usage-metering/GetUsageSummary_additional_properties.rb showing how to read all fields from additionalProperties at all three response levels of GET /api/v1/usage/summary.
  • Calls get_usage_summary_available_fields (v2) first to enumerate response_fields, date_fields, and date_org_fields.
  • Then calls get_usage_summary (v1) with include_org_details: true and iterates the three additionalProperties layers (response, per-date, per-org), printing every non-nil value.

Test plan

  • Review example logic matches Ruby model additional_properties hash access pattern.
  • Confirm the three-layer iteration (Layer 1 response, Layer 2 date, Layer 3 date-org) is correct.
  • Run against a live org to verify output.

🤖 Generated with Claude Code

charlie-zhang109 and others added 3 commits June 15, 2026 14:21
Demonstrates calling get_usage_summary_available_fields (v2) to enumerate
response_fields / date_fields / date_org_fields, then iterating all three
additionalProperties layers of the get_usage_summary (v1) response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… all layers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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