(
        self,
        plan: Union[StripeModel, str] = None,
        prorate: bool = None,
        **kwargs,
    )
return Subscription.sync_from_stripe_data(stripe_subscription)
See `Customer.subscribe() <#djstripe.models.Customer.subscribe>`__

        :param plan: The plan to which to subscribe the customer.
        :type plan: Plan or string (plan ID)

        .. note:: The default value for ``prorate`` is the DJSTRIPE_PRORATION_POLICY \
            setting.

        .. important:: Updating a subscription by changing the plan or quantity \
            creates a new ``Subscription`` in \
            Stripe (and dj-stripe).
See `Customer.subscribe() <#djstripe.models.Customer.subscribe>`__
See Customer . subscribe () <#djstripe . models . Customer . subscribe > __
def update(
        self,
        plan: Union[StripeModel, str] = None,
        prorate: bool = None,
        **kwargs,
    ):
        """
        See `Customer.subscribe() <#djstripe.models.Customer.subscribe>`__

        :param plan: The plan to which to subscribe the customer.
        :type plan: Plan or string (plan ID)

        .. note:: The default value for ``prorate`` is the DJSTRIPE_PRORATION_POLICY \
            setting.

        .. important:: Updating a subscription by changing the plan or quantity \
            creates a new ``Subscription`` in \
            Stripe (and dj-stripe).
        """

        # Convert Plan to id
        if plan is not None and isinstance(plan, StripeModel):
            plan = plan.id

        if "proration_behavior" not in kwargs:
            if prorate is not None:
                warnings.warn(
                    "The `prorate` parameter to Subscription.update() is deprecated "
                    "by Stripe. Use `proration_behavior` instead.\n"
                    "Read more: "
                    "https://stripe.com/docs/billing/subscriptions/prorations"
                )
            else:
                prorate = djstripe_settings.PRORATION_POLICY

            if prorate:
                kwargs.setdefault("proration_behavior", "create_prorations")
            else:
                kwargs.setdefault("proration_behavior", "none")

        stripe_subscription = self._api_update(plan=plan, **kwargs)

        return Subscription.sync_from_stripe_data(stripe_subscription)
def update ( self , plan : Union [ StripeModel , str ] = None , prorate : bool = None , * * kwargs , ) : # Convert Plan to id if plan is not None and isinstance ( plan , StripeModel ) : plan = plan . id if "proration_behavior" not in kwargs : if prorate is not None : warnings . warn ( "The `prorate` parameter to Subscription.update() is deprecated " "by Stripe. Use `proration_behavior` instead.\n" "Read more: " "https://stripe.com/docs/billing/subscriptions/prorations" ) else : prorate = djstripe_settings . PRORATION_POLICY if prorate : kwargs . setdefault ( "proration_behavior" , "create_prorations" ) else : kwargs . setdefault ( "proration_behavior" , "none" ) stripe_subscription = self . _api_update ( plan = plan , * * kwargs ) return Subscription . sync_from_stripe_data ( stripe_subscription )