(cls, target_cls, data, subscription)
return subscriptionitems
Retrieves SubscriptionItems for a subscription.

        If the subscription item doesn't exist already then it is created.

        :param target_cls: The target class to instantiate per invoice item.
        :type target_cls: Type[djstripe.models.SubscriptionItem]
        :param data: The data dictionary received from the Stripe API.
        :type data: dict
        :param subscription: The subscription object that should hold the items.
        :type subscription: djstripe.models.Subscription
Retrieves SubscriptionItems for a subscription.
Retrieves SubscriptionItems for a subscription .
def _stripe_object_to_subscription_items(cls, target_cls, data, subscription):
        """
        Retrieves SubscriptionItems for a subscription.

        If the subscription item doesn't exist already then it is created.

        :param target_cls: The target class to instantiate per invoice item.
        :type target_cls: Type[djstripe.models.SubscriptionItem]
        :param data: The data dictionary received from the Stripe API.
        :type data: dict
        :param subscription: The subscription object that should hold the items.
        :type subscription: djstripe.models.Subscription
        """

        items = data.get("items")
        if not items:
            subscription.items.delete()
            return []

        pks = []
        subscriptionitems = []
        for item_data in items.auto_paging_iter():
            item, _ = target_cls._get_or_create_from_stripe_object(
                item_data, refetch=False
            )

            # sync the SubscriptionItem
            target_cls.sync_from_stripe_data(item_data)

            pks.append(item.pk)
            subscriptionitems.append(item)
        subscription.items.exclude(pk__in=pks).delete()

        return subscriptionitems
def _stripe_object_to_subscription_items ( cls , target_cls , data , subscription ) : items = data . get ( "items" ) if not items : subscription . items . delete ( ) return [ ] pks = [ ] subscriptionitems = [ ] for item_data in items . auto_paging_iter ( ) : item , _ = target_cls . _get_or_create_from_stripe_object ( item_data , refetch = False ) # sync the SubscriptionItem target_cls . sync_from_stripe_data ( item_data ) pks . append ( item . pk ) subscriptionitems . append ( item ) subscription . items . exclude ( pk__in = pks ) . delete ( ) return subscriptionitems