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 subscriptions in ResultBase object #42

Open
alisabzevari opened this issue Mar 20, 2024 · 1 comment · May be fixed by #43
Open

Add subscriptions in ResultBase object #42

alisabzevari opened this issue Mar 20, 2024 · 1 comment · May be fixed by #43

Comments

@alisabzevari
Copy link

alisabzevari commented Mar 20, 2024

What problem does your feature request address?

We realized that some events (for example "Customer deleted") contains subscriptions field (collection of customer subscriptions).
However, the type com.chargebee.models.Event.content() which is the representation of event content does not provide a method to access this field.

Describe the desired solution

The desired solution would be to make subscriptions method available in ResultBase this possible:

Event event = // the instance of event
var subscriptions = event.content().subscriptions(); // This is not available 
var subscription = event.content().subscription(); // This is availabale

it would be great if we could add this method.

Alternatives considered

Currently, we access the list of subscriptions via parsing the JSONObject:

var subscriptions = this.optJSONObject("content").optJSONArray("subscriptions");

Additional context

The subscriptions field is mentioned in the documentation for customer_deleted event here

Copy link

Hello @alisabzevari, thank you for raising the issue. Your contribution is greatly appreciated and we look forward to addressing it.

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 a pull request may close this issue.

1 participant