feat: add update_opportunity_roles + list_custom_fields (v0.3.0) - #10
Merged
Merged
Conversation
Two endpoints that were previously only reachable via raw curl in day-to-day use are now first-class client methods: - update_opportunity_roles(opportunity_id, roles) -> POST /opportunities/update_roles Sets the contact roles on a deal (replaces the full set; read current roles from get_deal(...).opportunity_contact_roles and modify). Returns the Deal. - list_custom_fields() -> GET /typed_custom_fields Returns account/contact/opportunity custom-field definitions as a new CustomField model. CustomField is exported from the package root. Tests added for both. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| page=1, | ||
| ) | ||
|
|
||
| async def update_opportunity_roles(self, opportunity_id: str, roles: list[dict]) -> Deal: |
There was a problem hiding this comment.
Improvement: roles: list[dict] is very loose (and hurts pyright/autocomplete). Since the payload shape is well-defined (contact_id, optional opportunity_contact_role_type_id, is_primary), consider introducing a small TypedDict/Pydantic model for the update payload (or at least list[dict[str, Any]]) so callers get type safety and earlier validation.
jschfflr
added a commit
that referenced
this pull request
Jul 8, 2026
…t] (v0.3.1) (#11) Addresses the review on #10: `roles: list[dict]` was loose and gave callers no type checking/autocomplete. Introduce a `RoleAssignment` TypedDict (required contact_id; optional opportunity_contact_role_type_id, is_primary) and use it in the signature. Exported from the package root. Non-breaking — plain dicts still satisfy it structurally. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds two Apollo endpoints that were previously only reachable via raw curl in day-to-day use:
update_opportunity_roles(opportunity_id, roles)→POST /opportunities/update_roles. Sets the contact roles on a deal. Replaces the full set, so callers pass the complete desired list (read current roles fromget_deal(...).opportunity_contact_roles, modify, resend). Returns the updatedDeal.list_custom_fields()→GET /typed_custom_fields. Returns account/contact/opportunity custom-field definitions as a newCustomFieldmodel (id,modality,name,type,picklist_options,mapped_crm_field).CustomFieldis exported from the package root.Why
Usage analysis of recent sessions showed
opportunities/update_roles(23×) andtyped_custom_fields(16×) hit directly via curl because there was no client method. This closes both gaps. Unblocks the correspondingapollo-clicommands.Verification
ruff check✓ ·ruff format --check✓ ·pyright src/0 errors ✓ ·pytest179 passed (2 new) ✓🤖 Generated with Claude Code