Skip to content

Commit

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

* Update generated code for v935

* Update generated code for v936

* Update generated code for v937

* Update generated code for v938

* Revert "Update generated code for v937"

This reverts commit 8bb57df.

* Revert "Update generated code for v935"

This reverts commit fff3068.

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <ramya@stripe.com>
  • Loading branch information
stripe-openapi[bot] and ramya-stripe authored Apr 9, 2024
1 parent 79c6452 commit 7c9d343
Show file tree
Hide file tree
Showing 28 changed files with 2,809 additions and 13 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v932
v938
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 @@ -161,6 +161,10 @@ public com.stripe.service.DisputeService disputes() {
return new com.stripe.service.DisputeService(this.getResponseGetter());
}

public com.stripe.service.EntitlementsService entitlements() {
return new com.stripe.service.EntitlementsService(this.getResponseGetter());
}

public com.stripe.service.EphemeralKeyService ephemeralKeys() {
return new com.stripe.service.EphemeralKeyService(this.getResponseGetter());
}
Expand Down
61 changes: 61 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,9 @@ public void setFrontObject(File expandableObject) {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Controller extends StripeObject {
@SerializedName("fees")
Fees fees;

/**
* {@code true} if the Connect application retrieving the resource controls the account and can
* therefore exercise <a
Expand All @@ -1464,12 +1467,70 @@ public static class Controller extends StripeObject {
@SerializedName("is_controller")
Boolean isController;

@SerializedName("losses")
Losses losses;

/**
* A value indicating responsibility for collecting requirements on this account. Only returned
* when the Connect application retrieving the resource controls the account.
*
* <p>One of {@code application}, or {@code stripe}.
*/
@SerializedName("requirement_collection")
String requirementCollection;

@SerializedName("stripe_dashboard")
StripeDashboard stripeDashboard;

/**
* The controller type. Can be {@code application}, if a Connect application controls the
* account, or {@code account}, if the account controls itself.
*/
@SerializedName("type")
String type;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Fees extends StripeObject {
/**
* A value indicating the responsible payer of a bundle of Stripe fees for pricing-control
* eligible products on this account.
*
* <p>One of {@code account}, {@code application}, {@code application_custom}, or {@code
* application_express}.
*/
@SerializedName("payer")
String payer;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Losses extends StripeObject {
/**
* A value indicating who is liable when this account can't pay back negative balances from
* payments.
*
* <p>One of {@code application}, or {@code stripe}.
*/
@SerializedName("payments")
String payments;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class StripeDashboard extends StripeObject {
/**
* A value indicating the Stripe dashboard this account has access to independent of the
* Connect application.
*
* <p>One of {@code express}, {@code full}, or {@code none}.
*/
@SerializedName("type")
String type;
}
}

@Getter
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ final class EventDataClassLookup {
classLookup.put("platform_tax_fee", PlatformTaxFee.class);
classLookup.put("price", Price.class);
classLookup.put("product", Product.class);
classLookup.put("product_feature", ProductFeature.class);
classLookup.put("promotion_code", PromotionCode.class);
classLookup.put("quote", Quote.class);
classLookup.put("refund", Refund.class);
Expand Down Expand Up @@ -106,6 +107,10 @@ final class EventDataClassLookup {
classLookup.put("climate.product", com.stripe.model.climate.Product.class);
classLookup.put("climate.supplier", com.stripe.model.climate.Supplier.class);

classLookup.put(
"entitlements.active_entitlement", com.stripe.model.entitlements.ActiveEntitlement.class);
classLookup.put("entitlements.feature", com.stripe.model.entitlements.Feature.class);

classLookup.put(
"financial_connections.account", com.stripe.model.financialconnections.Account.class);
classLookup.put(
Expand Down
219 changes: 219 additions & 0 deletions src/main/java/com/stripe/model/ProductFeature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.entitlements.Feature;
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.ProductFeatureCreateParams;
import com.stripe.param.ProductFeatureListParams;
import com.stripe.param.ProductFeatureRetrieveParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* A product_feature represents an attachment between a feature and a product. When a product is
* purchased that has a feature attached, Stripe will create an entitlement to the feature for the
* purchasing customer.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class ProductFeature extends ApiResource implements HasId {
/** Always true for a deleted object. */
@SerializedName("deleted")
Boolean deleted;

/**
* A feature represents a monetizable ability or functionality in your system. Features can be
* assigned to products, and when those products are purchased, Stripe will create an entitlement
* to the feature for the purchasing customer.
*/
@SerializedName("entitlement_feature")
Feature entitlementFeature;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/**
* 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 product_feature}.
*/
@SerializedName("object")
String object;

/** Creates a product_feature, which represents a feature attachment to a product. */
public static ProductFeature create(String product, Map<String, Object> params)
throws StripeException {
return create(product, params, (RequestOptions) null);
}

/** Creates a product_feature, which represents a feature attachment to a product. */
public static ProductFeature create(
String product, Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/products/%s/features", ApiResource.urlEncodeId(product));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeature.class);
}

/** Creates a product_feature, which represents a feature attachment to a product. */
public static ProductFeature create(String product, ProductFeatureCreateParams params)
throws StripeException {
return create(product, params, (RequestOptions) null);
}

/** Creates a product_feature, which represents a feature attachment to a product. */
public static ProductFeature create(
String product, ProductFeatureCreateParams params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/products/%s/features", ApiResource.urlEncodeId(product));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeature.class);
}

/** Deletes the feature attachment to a product. */
public ProductFeature delete(String product) throws StripeException {
return delete(product, (Map<String, Object>) null, (RequestOptions) null);
}

/** Deletes the feature attachment to a product. */
public ProductFeature delete(String product, RequestOptions options) throws StripeException {
return delete(product, (Map<String, Object>) null, options);
}

/** Deletes the feature attachment to a product. */
public ProductFeature delete(String product, Map<String, Object> params) throws StripeException {
return delete(product, params, (RequestOptions) null);
}

/** Deletes the feature attachment to a product. */
public ProductFeature delete(String product, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/products/%s/features/%s",
ApiResource.urlEncodeId(product), ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, ProductFeature.class);
}

/** Retrieve a list of features for a product. */
public static ProductFeatureCollection list(String product, Map<String, Object> params)
throws StripeException {
return list(product, params, (RequestOptions) null);
}

/** Retrieve a list of features for a product. */
public static ProductFeatureCollection list(
String product, Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/products/%s/features", ApiResource.urlEncodeId(product));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeatureCollection.class);
}

/** Retrieve a list of features for a product. */
public static ProductFeatureCollection list(String product, ProductFeatureListParams params)
throws StripeException {
return list(product, params, (RequestOptions) null);
}

/** Retrieve a list of features for a product. */
public static ProductFeatureCollection list(
String product, ProductFeatureListParams params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/products/%s/features", ApiResource.urlEncodeId(product));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeatureCollection.class);
}

/** Retrieves a product_feature, which represents a feature attachment to a product. */
public static ProductFeature retrieve(String product, String id) throws StripeException {
return retrieve(product, id, (Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves a product_feature, which represents a feature attachment to a product. */
public static ProductFeature retrieve(String product, String id, RequestOptions options)
throws StripeException {
return retrieve(product, id, (Map<String, Object>) null, options);
}

/** Retrieves a product_feature, which represents a feature attachment to a product. */
public static ProductFeature retrieve(
String product, String id, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/products/%s/features/%s",
ApiResource.urlEncodeId(product), ApiResource.urlEncodeId(id));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeature.class);
}

/** Retrieves a product_feature, which represents a feature attachment to a product. */
public static ProductFeature retrieve(
String product, String id, ProductFeatureRetrieveParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/products/%s/features/%s",
ApiResource.urlEncodeId(product), ApiResource.urlEncodeId(id));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, ProductFeature.class);
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(entitlementFeature, responseGetter);
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/ProductFeatureCollection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec
package com.stripe.model;

public class ProductFeatureCollection extends StripeCollection<ProductFeature> {}
Loading

0 comments on commit 7c9d343

Please sign in to comment.