chargebee-java icon indicating copy to clipboard operation
chargebee-java copied to clipboard

Add subscriptions in ResultBase object

Open alisabzevari opened this issue 1 year ago • 1 comments

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

alisabzevari avatar Mar 20 '24 09:03 alisabzevari

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

github-actions[bot] avatar Mar 20 '24 09:03 github-actions[bot]