Skip to content

[generated] source: spec3.sdk.yaml@spec-eee72d4 in master #828

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

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ public static class Company extends StripeObject {
@SerializedName("name")
String name;

/** The Kana variation of the company's legal name Japan only). */
/** The Kana variation of the company's legal name (Japan only). */
@SerializedName("name_kana")
String nameKana;

Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/stripe/model/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su
@SerializedName("quantity")
Long quantity;

/** The schedule attached to the subscription. */
@SerializedName("schedule")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<SubscriptionSchedule> schedule;

/**
* Date of the last substantial change to this subscription. For example, a change to the items
* array, or a change of status, will reset this timestamp.
Expand Down Expand Up @@ -366,6 +372,25 @@ public void setPendingSetupIntentObject(SetupIntent expandableObject) {
new ExpandableField<SetupIntent>(expandableObject.getId(), expandableObject);
}

/** Get id of expandable `schedule` object. */
public String getSchedule() {
return (this.schedule != null) ? this.schedule.getId() : null;
}

public void setSchedule(String id) {
this.schedule = ApiResource.setExpandableFieldId(id, this.schedule);
}

/** Get expanded `schedule`. */
public SubscriptionSchedule getScheduleObject() {
return (this.schedule != null) ? this.schedule.getExpanded() : null;
}

public void setScheduleObject(SubscriptionSchedule expandableObject) {
this.schedule =
new ExpandableField<SubscriptionSchedule>(expandableObject.getId(), expandableObject);
}

/**
* By default, returns a list of subscriptions that have not been canceled. In order to list
* canceled subscriptions, specify <code>status=canceled</code>.
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/com/stripe/model/SubscriptionSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,19 +561,49 @@ public static class Phase extends StripeObject {
@SerializedName("application_fee_percent")
BigDecimal applicationFeePercent;

/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period.
*/
@SerializedName("billing_thresholds")
Subscription.BillingThresholds billingThresholds;

/**
* Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will
* attempt to pay the underlying subscription at the end of each billing cycle using the default
* source attached to the customer. When sending an invoice, Stripe will email your customer an
* invoice with payment instructions.
*/
@SerializedName("collection_method")
String collectionMethod;

/** ID of the coupon to use during this phase of the subscription schedule. */
@SerializedName("coupon")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Coupon> coupon;

/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the default
* payment method in the customer's invoice settings.
*/
@SerializedName("default_payment_method")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<PaymentMethod> defaultPaymentMethod;

@SerializedName("default_tax_rates")
List<TaxRate> defaultTaxRates;

/** The end of this phase of the subscription schedule. */
@SerializedName("end_date")
Long endDate;

/** The subscription schedule's default invoice settings. */
@SerializedName("invoice_settings")
InvoiceSettings invoiceSettings;

/** Plans to subscribe during this phase of the subscription schedule. */
@SerializedName("plans")
List<PhaseItem> plans;
Expand Down Expand Up @@ -610,6 +640,25 @@ public Coupon getCouponObject() {
public void setCouponObject(Coupon expandableObject) {
this.coupon = new ExpandableField<Coupon>(expandableObject.getId(), expandableObject);
}

/** Get id of expandable `defaultPaymentMethod` object. */
public String getDefaultPaymentMethod() {
return (this.defaultPaymentMethod != null) ? this.defaultPaymentMethod.getId() : null;
}

public void setDefaultPaymentMethod(String id) {
this.defaultPaymentMethod = ApiResource.setExpandableFieldId(id, this.defaultPaymentMethod);
}

/** Get expanded `defaultPaymentMethod`. */
public PaymentMethod getDefaultPaymentMethodObject() {
return (this.defaultPaymentMethod != null) ? this.defaultPaymentMethod.getExpanded() : null;
}

public void setDefaultPaymentMethodObject(PaymentMethod expandableObject) {
this.defaultPaymentMethod =
new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
}
}

@Getter
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.stripe.model.HasId;
import com.stripe.model.PaymentIntent;
import com.stripe.model.Plan;
import com.stripe.model.SetupIntent;
import com.stripe.model.Sku;
import com.stripe.model.StripeObject;
import com.stripe.model.Subscription;
Expand Down Expand Up @@ -88,6 +89,10 @@ public class Session extends ApiResource implements HasId {
@SerializedName("locale")
String locale;

/** The mode of the Checkout Session. */
@SerializedName("mode")
String mode;

/** String representing the object's type. Objects of the same type share the same value. */
@SerializedName("object")
String object;
Expand All @@ -104,6 +109,12 @@ public class Session extends ApiResource implements HasId {
@SerializedName("payment_method_types")
List<String> paymentMethodTypes;

/** The ID of the SetupIntent if mode was set to `setup`. */
@SerializedName("setup_intent")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<SetupIntent> setupIntent;

/**
* Describes the type of transaction being performed by Checkout in order to customize relevant
* text on the page, such as the submit button. `submit_type` can only be specified on Checkout
Expand Down Expand Up @@ -163,6 +174,24 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) {
new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
}

/** Get id of expandable `setupIntent` object. */
public String getSetupIntent() {
return (this.setupIntent != null) ? this.setupIntent.getId() : null;
}

public void setSetupIntent(String id) {
this.setupIntent = ApiResource.setExpandableFieldId(id, this.setupIntent);
}

/** Get expanded `setupIntent`. */
public SetupIntent getSetupIntentObject() {
return (this.setupIntent != null) ? this.setupIntent.getExpanded() : null;
}

public void setSetupIntentObject(SetupIntent expandableObject) {
this.setupIntent = new ExpandableField<SetupIntent>(expandableObject.getId(), expandableObject);
}

/** Get id of expandable `subscription` object. */
public String getSubscription() {
return (this.subscription != null) ? this.subscription.getId() : null;
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/com/stripe/param/InvoiceUpcomingParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ public class InvoiceUpcomingParams extends ApiRequestParams {
@SerializedName("invoice_items")
List<InvoiceItem> invoiceItems;

/**
* The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot
* be used with subscription or subscription fields.
*/
@SerializedName("schedule")
String schedule;

/**
* The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If
* not provided, but a `subscription_items` is provided, you will preview creating a subscription
Expand All @@ -63,6 +70,13 @@ public class InvoiceUpcomingParams extends ApiRequestParams {
@SerializedName("subscription_billing_cycle_anchor")
Object subscriptionBillingCycleAnchor;

/**
* Boolean indicating when the subscription should be scheduled to cancel. Will prorate if within
* the current period if `prorate=true`
*/
@SerializedName("subscription_cancel_at")
Object subscriptionCancelAt;

/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
*/
Expand Down Expand Up @@ -137,8 +151,10 @@ private InvoiceUpcomingParams(
List<String> expand,
Map<String, Object> extraParams,
List<InvoiceItem> invoiceItems,
String schedule,
String subscription,
Object subscriptionBillingCycleAnchor,
Object subscriptionCancelAt,
Boolean subscriptionCancelAtPeriodEnd,
Boolean subscriptionCancelNow,
Object subscriptionDefaultTaxRates,
Expand All @@ -154,8 +170,10 @@ private InvoiceUpcomingParams(
this.expand = expand;
this.extraParams = extraParams;
this.invoiceItems = invoiceItems;
this.schedule = schedule;
this.subscription = subscription;
this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor;
this.subscriptionCancelAt = subscriptionCancelAt;
this.subscriptionCancelAtPeriodEnd = subscriptionCancelAtPeriodEnd;
this.subscriptionCancelNow = subscriptionCancelNow;
this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates;
Expand Down Expand Up @@ -183,10 +201,14 @@ public static class Builder {

private List<InvoiceItem> invoiceItems;

private String schedule;

private String subscription;

private Object subscriptionBillingCycleAnchor;

private Object subscriptionCancelAt;

private Boolean subscriptionCancelAtPeriodEnd;

private Boolean subscriptionCancelNow;
Expand Down Expand Up @@ -215,8 +237,10 @@ public InvoiceUpcomingParams build() {
this.expand,
this.extraParams,
this.invoiceItems,
this.schedule,
this.subscription,
this.subscriptionBillingCycleAnchor,
this.subscriptionCancelAt,
this.subscriptionCancelAtPeriodEnd,
this.subscriptionCancelNow,
this.subscriptionDefaultTaxRates,
Expand Down Expand Up @@ -325,6 +349,15 @@ public Builder addAllInvoiceItem(List<InvoiceItem> elements) {
return this;
}

/**
* The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.
* Cannot be used with subscription or subscription fields.
*/
public Builder setSchedule(String schedule) {
this.schedule = schedule;
return this;
}

/**
* The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If
* not provided, but a `subscription_items` is provided, you will preview creating a
Expand Down Expand Up @@ -362,6 +395,24 @@ public Builder setSubscriptionBillingCycleAnchor(Long subscriptionBillingCycleAn
return this;
}

/**
* Boolean indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period if `prorate=true`
*/
public Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt) {
this.subscriptionCancelAt = subscriptionCancelAt;
return this;
}

/**
* Boolean indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period if `prorate=true`
*/
public Builder setSubscriptionCancelAt(Long subscriptionCancelAt) {
this.subscriptionCancelAt = subscriptionCancelAt;
return this;
}

/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
*/
Expand Down
Loading