Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deprecated items in Chargebee streams #74

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

butkeraites-hotglue
Copy link

  • Introduced 'include_deprecated' configuration option in the main function to control the inclusion of deprecated items.
  • Added 'active_id' field to the subscriptions schema for better tracking of active subscriptions.
  • Updated CustomersStream and SubscriptionsStream to include 'include_deprecated' parameter in API requests when enabled.

- Introduced 'include_deprecated' configuration option in the main function to control the inclusion of deprecated items.
- Added 'active_id' field to the subscriptions schema for better tracking of active subscriptions.
- Updated CustomersStream and SubscriptionsStream to include 'include_deprecated' parameter in API requests when enabled.
@@ -15,3 +15,9 @@ class SubscriptionsStream(BaseChargebeeStream):

def get_url(self):
return 'https://{}/api/v2/subscriptions'.format(self.config.get('full_site'))

def get_params(self, params):
params = super().get_params(params)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code is not entering here because the get_params base function is in ChargebeeClient but the streams inherit from BaseChargebeeStream, at least is not working for me locally

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Thank you!

- Added 'include_deprecated' parameter to BaseChargebeeStream for customers and subscriptions.
- Removed redundant 'get_params' method overrides in CustomersStream and SubscriptionsStream, as the base class now handles the inclusion of deprecated items.

This update improves the flexibility of API requests by allowing the inclusion of deprecated items when specified in the configuration.
@hsyyid hsyyid merged commit 584b9db into master Dec 13, 2024
@hsyyid hsyyid deleted the feature/hgi-6902 branch December 13, 2024 15:18
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.

3 participants