Skip to content

Commit

Permalink
Prettier codegen (#827)
Browse files Browse the repository at this point in the history
* Code generated via prettier-poet
  • Loading branch information
richardm-stripe authored Sep 5, 2019
1 parent d2f1d34 commit f773212
Show file tree
Hide file tree
Showing 404 changed files with 1,575 additions and 2,394 deletions.
39 changes: 19 additions & 20 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand All @@ -23,7 +21,7 @@
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Account extends ApiResource implements PaymentSource, MetadataStore<Account> {
public class Account extends ApiResource implements MetadataStore<Account>, PaymentSource {
/** Optional information related to the business. */
@SerializedName("business_profile")
BusinessProfile businessProfile;
Expand Down Expand Up @@ -128,14 +126,14 @@ public static Account retrieve(RequestOptions options) throws StripeException {
public static Account retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
return request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
}

/** Retrieves the details of an account. */
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
return request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
}

/** Retrieves the details of an account. */
Expand All @@ -156,7 +154,7 @@ public static Account retrieve(String account, Map<String, Object> params, Reque
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
return request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
}

/** Retrieves the details of an account. */
Expand All @@ -167,7 +165,7 @@ public static Account retrieve(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
return request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
}

/**
Expand Down Expand Up @@ -206,7 +204,7 @@ public Account update(Map<String, Object> params, RequestOptions options) throws
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand Down Expand Up @@ -243,7 +241,7 @@ public Account update(AccountUpdateParams params, RequestOptions options) throws
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand All @@ -261,7 +259,7 @@ public static AccountCollection list(Map<String, Object> params) throws StripeEx
public static AccountCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
return requestCollection(url, params, AccountCollection.class, options);
return ApiResource.requestCollection(url, params, AccountCollection.class, options);
}

/**
Expand All @@ -279,7 +277,7 @@ public static AccountCollection list(AccountListParams params) throws StripeExce
public static AccountCollection list(AccountListParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
return requestCollection(url, params, AccountCollection.class, options);
return ApiResource.requestCollection(url, params, AccountCollection.class, options);
}

/**
Expand Down Expand Up @@ -307,7 +305,7 @@ public static Account create(Map<String, Object> params) throws StripeException
public static Account create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand Down Expand Up @@ -335,7 +333,7 @@ public static Account create(AccountCreateParams params) throws StripeException
public static Account create(AccountCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand Down Expand Up @@ -392,7 +390,8 @@ public Account delete(Map<String, Object> params, RequestOptions options) throws
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.DELETE, url, params, Account.class, options);
return ApiResource.request(
ApiResource.RequestMethod.DELETE, url, params, Account.class, options);
}

/**
Expand All @@ -417,7 +416,7 @@ public Account reject(Map<String, Object> params, RequestOptions options) throws
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand All @@ -442,7 +441,7 @@ public Account reject(AccountRejectParams params, RequestOptions options) throws
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}

/**
Expand Down Expand Up @@ -472,7 +471,7 @@ public PersonCollection persons(Map<String, Object> params, RequestOptions optio
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/persons", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, PersonCollection.class, options);
return ApiResource.requestCollection(url, params, PersonCollection.class, options);
}

/**
Expand All @@ -494,7 +493,7 @@ public PersonCollection persons(AccountPersonsParams params, RequestOptions opti
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/persons", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, PersonCollection.class, options);
return ApiResource.requestCollection(url, params, PersonCollection.class, options);
}

/**
Expand Down Expand Up @@ -524,7 +523,7 @@ public CapabilityCollection capabilities(Map<String, Object> params, RequestOpti
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, CapabilityCollection.class, options);
return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}

/**
Expand All @@ -547,7 +546,7 @@ public CapabilityCollection capabilities(AccountCapabilitiesParams params, Reque
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, CapabilityCollection.class, options);
return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}

@Getter
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/AccountCollection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

public class AccountCollection extends StripeCollection<Account> {}
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/AccountLink.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -48,7 +46,8 @@ public static AccountLink create(Map<String, Object> params) throws StripeExcept
public static AccountLink create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account_links");
return request(ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
}

/**
Expand All @@ -66,6 +65,7 @@ public static AccountLink create(AccountLinkCreateParams params) throws StripeEx
public static AccountLink create(AccountLinkCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account_links");
return request(ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/Address.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/AlipayAccount.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/com/stripe/model/ApplePayDomain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -55,7 +53,7 @@ public static ApplePayDomainCollection list(Map<String, Object> params) throws S
public static ApplePayDomainCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
return requestCollection(url, params, ApplePayDomainCollection.class, options);
return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
}

/** List apple pay domains. */
Expand All @@ -68,7 +66,7 @@ public static ApplePayDomainCollection list(ApplePayDomainListParams params)
public static ApplePayDomainCollection list(
ApplePayDomainListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
return requestCollection(url, params, ApplePayDomainCollection.class, options);
return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
}

/** Create an apple pay domain. */
Expand All @@ -80,7 +78,8 @@ public static ApplePayDomain create(Map<String, Object> params) throws StripeExc
public static ApplePayDomain create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
return request(ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options);
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options);
}

/** Create an apple pay domain. */
Expand All @@ -92,7 +91,8 @@ public static ApplePayDomain create(ApplePayDomainCreateParams params) throws St
public static ApplePayDomain create(ApplePayDomainCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
return request(ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options);
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options);
}

/** Retrieve an apple pay domain. */
Expand All @@ -114,7 +114,8 @@ public static ApplePayDomain retrieve(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(domain)));
return request(ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options);
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options);
}

/** Retrieve an apple pay domain. */
Expand All @@ -126,7 +127,8 @@ public static ApplePayDomain retrieve(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(domain)));
return request(ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options);
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options);
}

/** Delete an apple pay domain. */
Expand All @@ -152,6 +154,7 @@ public ApplePayDomain delete(Map<String, Object> params, RequestOptions options)
"%s%s",
Stripe.getApiBase(),
String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(this.getId())));
return request(ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options);
return ApiResource.request(
ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options);
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/ApplePayDomainCollection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

public class ApplePayDomainCollection extends StripeCollection<ApplePayDomain> {}
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/Application.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/stripe/model/ApplicationFee.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -210,7 +208,7 @@ public static ApplicationFeeCollection list(Map<String, Object> params) throws S
public static ApplicationFeeCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/application_fees");
return requestCollection(url, params, ApplicationFeeCollection.class, options);
return ApiResource.requestCollection(url, params, ApplicationFeeCollection.class, options);
}

/**
Expand All @@ -229,7 +227,7 @@ public static ApplicationFeeCollection list(ApplicationFeeListParams params)
public static ApplicationFeeCollection list(
ApplicationFeeListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/application_fees");
return requestCollection(url, params, ApplicationFeeCollection.class, options);
return ApiResource.requestCollection(url, params, ApplicationFeeCollection.class, options);
}

/**
Expand Down Expand Up @@ -259,7 +257,8 @@ public static ApplicationFee retrieve(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/application_fees/%s", ApiResource.urlEncodeId(id)));
return request(ApiResource.RequestMethod.GET, url, params, ApplicationFee.class, options);
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ApplicationFee.class, options);
}

/**
Expand All @@ -274,6 +273,7 @@ public static ApplicationFee retrieve(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/application_fees/%s", ApiResource.urlEncodeId(id)));
return request(ApiResource.RequestMethod.GET, url, params, ApplicationFee.class, options);
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ApplicationFee.class, options);
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/stripe/model/ApplicationFeeCollection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

public class ApplicationFeeCollection extends StripeCollection<ApplicationFee> {}
12 changes: 5 additions & 7 deletions src/main/java/com/stripe/model/Balance.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
Expand All @@ -24,14 +22,14 @@ public class Balance extends ApiResource {
* balance for each currency and payment type can be found in the `source_types` property.
*/
@SerializedName("available")
List<Money> available;
List<Balance.Money> available;

/**
* Funds held due to negative balances on connected Custom accounts. The connect reserve balance
* for each currency and payment type can be found in the `source_types` property.
*/
@SerializedName("connect_reserved")
List<Money> connectReserved;
List<Balance.Money> connectReserved;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object
Expand All @@ -50,7 +48,7 @@ public class Balance extends ApiResource {
* `source_types` property.
*/
@SerializedName("pending")
List<Money> pending;
List<Balance.Money> pending;

/**
* Retrieves the current account balance, based on the authentication that was used to make the
Expand Down Expand Up @@ -81,7 +79,7 @@ public static Balance retrieve(RequestOptions options) throws StripeException {
public static Balance retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/balance");
return request(ApiResource.RequestMethod.GET, url, params, Balance.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Balance.class, options);
}

/**
Expand All @@ -93,7 +91,7 @@ public static Balance retrieve(Map<String, Object> params, RequestOptions option
public static Balance retrieve(BalanceRetrieveParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/balance");
return request(ApiResource.RequestMethod.GET, url, params, Balance.class, options);
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Balance.class, options);
}

@Getter
Expand Down
Loading

0 comments on commit f773212

Please sign in to comment.