Skip to content

Commit

Permalink
Update generated code (#1715)
Browse files Browse the repository at this point in the history
* Update generated code for v753

* Update generated code for v755

* Update generated code for v755

* Update generated code for v755

* Update generated code for v755

* Update generated code for v756

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and pakrym-stripe committed Jan 12, 2024
1 parent f1e0215 commit 8837e05
Show file tree
Hide file tree
Showing 97 changed files with 4,428 additions and 3,585 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v742
v756
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public com.stripe.service.CreditNoteService creditNotes() {
return new com.stripe.service.CreditNoteService(this.getResponseGetter());
}

public com.stripe.service.CustomerSessionService customerSessions() {
return new com.stripe.service.CustomerSessionService(this.getResponseGetter());
}

public com.stripe.service.CustomerService customers() {
return new com.stripe.service.CustomerService(this.getResponseGetter());
}
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -524,29 +524,29 @@ public Account reject(AccountRejectParams params, RequestOptions options) throws
}

/** Retrieves the details of an account. */
public static Account retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
public static Account retrieve(String account) throws StripeException {
return retrieve(account, (Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves the details of an account. */
public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
public static Account retrieve(String account, RequestOptions options) throws StripeException {
return retrieve(account, (Map<String, Object>) null, options);
}

/** Retrieves the details of an account. */
public static Account retrieve(Map<String, Object> params, RequestOptions options)
public static Account retrieve(String account, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}

/** Retrieves the details of an account. */
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
public static Account retrieve(
String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
Expand All @@ -560,29 +560,29 @@ public static Account retrieve(AccountRetrieveParams params, RequestOptions opti
}

/** Retrieves the details of an account. */
public static Account retrieve(String account) throws StripeException {
return retrieve(account, (Map<String, Object>) null, (RequestOptions) null);
public static Account retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves the details of an account. */
public static Account retrieve(String account, RequestOptions options) throws StripeException {
return retrieve(account, (Map<String, Object>) null, options);
public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
}

/** Retrieves the details of an account. */
public static Account retrieve(String account, Map<String, Object> params, RequestOptions options)
public static Account retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
String path = "/v1/account";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}

/** Retrieves the details of an account. */
public static Account retrieve(
String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/com/stripe/model/BalanceTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ public class BalanceTransaction extends ApiResource implements HasId {
* charge}, {@code climate_order_purchase}, {@code climate_order_refund}, {@code
* connect_collection_transfer}, {@code contribution}, {@code issuing_authorization_hold}, {@code
* issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code obligation_payout}, {@code obligation_payout_failure},
* {@code payment}, {@code payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* obligation_outbound}, {@code obligation_reversal_inbound}, {@code payment}, {@code
* payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code
* payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code
* refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code
Expand All @@ -143,15 +142,15 @@ public class BalanceTransaction extends ApiResource implements HasId {
* charge}, {@code climate_order_purchase}, {@code climate_order_refund}, {@code
* connect_collection_transfer}, {@code contribution}, {@code issuing_authorization_hold}, {@code
* issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_payout}, {@code
* obligation_payout_failure}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code payment}, {@code payment_failure_refund}, {@code
* payment_network_reserve_hold}, {@code payment_network_reserve_release}, {@code payment_refund},
* {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel},
* {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction},
* {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code
* topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code
* transfer_failure}, or {@code transfer_refund}.
* obligation_outbound}, {@code obligation_reversal_inbound}, {@code payment}, {@code
* payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code
* payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code
* refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code
* stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal},
* {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, {@code transfer_refund},
* {@code obligation_inbound}, {@code obligation_payout}, {@code obligation_payout_failure}, or
* {@code obligation_reversal_outbound}.
*/
@SerializedName("type")
String type;
Expand Down
177 changes: 177 additions & 0 deletions src/main/java/com/stripe/model/CustomerSession.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiMode;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.CustomerSessionCreateParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
* control over a customer.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class CustomerSession extends ApiResource {
/**
* The client secret of this customer session. Used on the client to set up secure access to the
* given {@code customer}.
*
* <p>The client secret can be used to provide access to {@code customer} from your frontend. It
* should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure
* that you have TLS enabled on any page that includes the client secret.
*/
@SerializedName("client_secret")
String clientSecret;

/** Configuration for the components supported by this customer session. */
@SerializedName("components")
Components components;

/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;

/** The customer the customer session was created for. */
@SerializedName("customer")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Customer> customer;

/** The timestamp at which this customer session will expire. */
@SerializedName("expires_at")
Long expiresAt;

/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;

/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code customer_session}.
*/
@SerializedName("object")
String object;

/** Get ID of expandable {@code customer} object. */
public String getCustomer() {
return (this.customer != null) ? this.customer.getId() : null;
}

public void setCustomer(String id) {
this.customer = ApiResource.setExpandableFieldId(id, this.customer);
}

/** Get expanded {@code customer}. */
public Customer getCustomerObject() {
return (this.customer != null) ? this.customer.getExpanded() : null;
}

public void setCustomerObject(Customer expandableObject) {
this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
}

/**
* Creates a customer session object that includes a single-use client secret that you can use on
* your front-end to grant client-side API access for certain customer resources.
*/
public static CustomerSession create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}

/**
* Creates a customer session object that includes a single-use client secret that you can use on
* your front-end to grant client-side API access for certain customer resources.
*/
public static CustomerSession create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/customer_sessions";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, CustomerSession.class);
}

/**
* Creates a customer session object that includes a single-use client secret that you can use on
* your front-end to grant client-side API access for certain customer resources.
*/
public static CustomerSession create(CustomerSessionCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}

/**
* Creates a customer session object that includes a single-use client secret that you can use on
* your front-end to grant client-side API access for certain customer resources.
*/
public static CustomerSession create(CustomerSessionCreateParams params, RequestOptions options)
throws StripeException {
String path = "/v1/customer_sessions";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, CustomerSession.class);
}

/** Configuration for the components supported by this customer session. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Components extends StripeObject {
/** This hash contains whether the buy button is enabled. */
@SerializedName("buy_button")
BuyButton buyButton;

/** This hash contains whether the pricing table is enabled. */
@SerializedName("pricing_table")
PricingTable pricingTable;

/** This hash contains whether the buy button is enabled. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class BuyButton extends StripeObject {
/** Whether the buy button is enabled. */
@SerializedName("enabled")
Boolean enabled;
}

/** This hash contains whether the pricing table is enabled. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PricingTable extends StripeObject {
/** Whether the pricing table is enabled. */
@SerializedName("enabled")
Boolean enabled;
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(components, responseGetter);
trySetResponseGetter(customer, responseGetter);
}
}
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ final class EventDataClassLookup {
classLookup.put("customer", Customer.class);
classLookup.put("customer_balance_transaction", CustomerBalanceTransaction.class);
classLookup.put("customer_cash_balance_transaction", CustomerCashBalanceTransaction.class);
classLookup.put("customer_session", CustomerSession.class);
classLookup.put("discount", Discount.class);
classLookup.put("dispute", Dispute.class);
classLookup.put("ephemeral_key", EphemeralKey.class);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/ExternalAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import java.util.Map;

public interface ExternalAccount extends StripeObjectInterface, HasId {
ExternalAccount update(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount update(Map<String, Object> params) throws StripeException;

ExternalAccount delete(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount delete() throws StripeException;

ExternalAccount delete(RequestOptions options) throws StripeException;

ExternalAccount delete(Map<String, Object> params) throws StripeException;

ExternalAccount update(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount update(Map<String, Object> params) throws StripeException;
}

0 comments on commit 8837e05

Please sign in to comment.