Skip to content

Add settings preference client - #133

Closed
cb-hareeshv wants to merge 1 commit into
masterfrom
feat/SSM-1125-settings-preference
Closed

cb-hareeshv wants to merge 1 commit into
masterfrom
feat/SSM-1125-settings-preference

Conversation

@cb-hareeshv

@cb-hareeshv cb-hareeshv commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

  • Adds the Python v3 client for the settings preference API (Preference.list / Preference.upsert and PreferenceDefinition.list_definitions).
  • Includes the billing_rules setting group from feat/SSM-1125.
  • Leaves unrelated model files unchanged.

Test plan

  • cb.Preference.list({"setting_group": {"is": "billing_rules"}}) calls GET /preferences
  • cb.Preference.upsert(...) calls POST /preferences
  • cb.PreferenceDefinition.list_definitions(...) calls GET /preferences/definitions
  • SettingGroup.BILLING_RULES is "billing_rules"

Made with Cursor

Adds Python v3 clients for Preference and PreferenceDefinition. The clients support listing and upserting preferences and listing definitions. Adds response models and the AccessMode, Operand, and SettingGroup enums, including BILLING_RULES.

Expose list and upsert for /preferences, plus preference definitions, including the billing_rules setting group.

Co-authored-by: Cursor <cursoragent@cursor.com>
@snyk-io

snyk-io Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues
✅ Secrets 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5571ede7-fee5-4a5d-8717-31a094b7efe5

📥 Commits

Reviewing files that changed from the base of the PR and between f1fbfde and 739408e.

📒 Files selected for processing (9)
  • chargebee/main.py
  • chargebee/models/__init__.py
  • chargebee/models/enums.py
  • chargebee/models/preference/__init__.py
  • chargebee/models/preference/operations.py
  • chargebee/models/preference/responses.py
  • chargebee/models/preference_definition/__init__.py
  • chargebee/models/preference_definition/operations.py
  • chargebee/models/preference_definition/responses.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The SDK adds Preference and PreferenceDefinition resource clients. It provides preference listing and upsert operations, preference-definition listing, response models, enums, and public exports.

Changes

Preference resources

Layer / File(s) Summary
Preference listing and upsert
chargebee/models/preference/operations.py, chargebee/models/preference/responses.py, chargebee/models/preference/__init__.py
Adds list and upsert requests for preferences, typed parameters, and preference response models. The upsert request configures JSON handling for variants and is marked idempotent.
Preference definition listing
chargebee/models/enums.py, chargebee/models/preference_definition/...
Adds preference-definition enums, response models for definition metadata and value schemas, and a list_definitions request to preferences/definitions that requires a setting group.
Client and model exports
chargebee/main.py, chargebee/models/__init__.py
Adds both resource clients to the Chargebee initializer and exposes the resources and enums through chargebee.models.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 73940

The new preference clients have no established merge-blocking defect. Their endpoint response shapes and variant encoding remain unconfirmed.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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