Skip to content

Commit

Permalink
[generated] source: spec3.sdk.yaml@spec-8935914 in master (stripe#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickjermsurawong-stripe authored May 15, 2019
1 parent 967c646 commit d872635
Show file tree
Hide file tree
Showing 25 changed files with 1,008 additions and 35 deletions.
68 changes: 68 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.AccountCapabilitiesParams;
import com.stripe.param.AccountCreateParams;
import com.stripe.param.AccountListParams;
import com.stripe.param.AccountPersonsParams;
Expand Down Expand Up @@ -496,6 +497,59 @@ public PersonCollection persons(AccountPersonsParams params, RequestOptions opti
return requestCollection(url, params, PersonCollection.class, options);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities() throws StripeException {
return capabilities((Map<String, Object>) null, (RequestOptions) null);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(Map<String, Object> params) throws StripeException {
return capabilities(params, (RequestOptions) null);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, CapabilityCollection.class, options);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(AccountCapabilitiesParams params)
throws StripeException {
return capabilities(params, (RequestOptions) null);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
return requestCollection(url, params, CapabilityCollection.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -848,6 +902,20 @@ public static class SettingsPayments extends StripeObject {
*/
@SerializedName("statement_descriptor")
String statementDescriptor;

/**
* The Kana variation of the default text that appears on credit card statements when a charge
* is made (Japan only).
*/
@SerializedName("statement_descriptor_kana")
String statementDescriptorKana;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge
* is made (Japan only).
*/
@SerializedName("statement_descriptor_kanji")
String statementDescriptorKanji;
}

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

package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.InvalidRequestException;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.CapabilityUpdateParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Capability extends ApiResource implements HasId {
/** The account for which the capability enables functionality. */
@SerializedName("account")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> account;

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

/** String representing the object's type. Objects of the same type share the same value. */
@SerializedName("object")
String object;

/** Whether the capability has been requested. */
@SerializedName("requested")
Boolean requested;

/** Time at which the capability was requested. Measured in seconds since the Unix epoch. */
@SerializedName("requested_at")
Long requestedAt;

@SerializedName("requirements")
Requirements requirements;

/** The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. */
@SerializedName("status")
String status;

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

public void setAccount(String id) {
this.account = ApiResource.setExpandableFieldId(id, this.account);
}

/** Get expanded `account`. */
public Account getAccountObject() {
return (this.account != null) ? this.account.getExpanded() : null;
}

public void setAccountObject(Account expandableObject) {
this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}

/** Updates an existing Account Capability. */
public Capability update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}

/** Updates an existing Account Capability. */
public Capability update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url;
if (this.getAccount() != null) {
url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/accounts/%s/capabilities/%s",
ApiResource.urlEncodeId(this.getAccount()),
ApiResource.urlEncodeId(this.getId())));
} else {
throw new InvalidRequestException(
"Unable to construct url because [account] field(s) are all null",
null,
null,
null,
0,
null);
}
return request(ApiResource.RequestMethod.POST, url, params, Capability.class, options);
}

/** Updates an existing Account Capability. */
public Capability update(CapabilityUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}

/** Updates an existing Account Capability. */
public Capability update(CapabilityUpdateParams params, RequestOptions options)
throws StripeException {
String url;
if (this.getAccount() != null) {
url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/accounts/%s/capabilities/%s",
ApiResource.urlEncodeId(this.getAccount()),
ApiResource.urlEncodeId(this.getId())));
} else {
throw new InvalidRequestException(
"Unable to construct url because [account] field(s) are all null",
null,
null,
null,
0,
null);
}
return request(ApiResource.RequestMethod.POST, url, params, Capability.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Requirements extends StripeObject {
/**
* The date the fields in `currently_due` must be collected by to keep the capability enabled
* for the account.
*/
@SerializedName("current_deadline")
Long currentDeadline;

/**
* The fields that need to be collected to keep the capability enabled. If not collected by the
* `current_deadline`, these fields appear in `past_due` as well, and the capability is
* disabled.
*/
@SerializedName("currently_due")
List<String> currentlyDue;

/**
* If the capability is disabled, this string describes why. Possible values are
* `requirement.fields_needed`, `pending.onboarding`, `pending.review`, `rejected_fraud`, or
* `rejected.other`.
*/
@SerializedName("disabled_reason")
String disabledReason;

/**
* The fields that need to be collected assuming all volume thresholds are reached. As they
* become required, these fields appear in `currently_due` as well, and the `current_deadline`
* is set.
*/
@SerializedName("eventually_due")
List<String> eventuallyDue;

/**
* The fields that weren't collected by the `current_deadline`. These fields need to be
* collected to enable the capability for the account.
*/
@SerializedName("past_due")
List<String> pastDue;
}
}
84 changes: 84 additions & 0 deletions src/main/java/com/stripe/model/CapabilityCollection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model;

import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.CapabilityCollectionListParams;
import com.stripe.param.CapabilityCollectionRetrieveParams;
import java.util.Map;

public class CapabilityCollection extends StripeCollection<Capability> {
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection list(Map<String, Object> params) throws StripeException {
return list(params, (RequestOptions) null);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection list(CapabilityCollectionListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}

/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection list(CapabilityCollectionListParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}

/** Retrieves an existing Account Capability. */
public Capability retrieve(String id) throws StripeException {
return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves an existing Account Capability. */
public Capability retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, (Map<String, Object>) null, options);
}

/** Retrieves an existing Account Capability. */
public Capability retrieve(String id, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, Capability.class, options);
}

/** Retrieves an existing Account Capability. */
public Capability retrieve(
String id, CapabilityCollectionRetrieveParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, Capability.class, options);
}
}
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 @@ -37,6 +37,7 @@ final class EventDataClassLookup {
classLookup.put("bank_account", BankAccount.class);
classLookup.put("bitcoin_receiver", BitcoinReceiver.class);
classLookup.put("bitcoin_transaction", BitcoinTransaction.class);
classLookup.put("capability", Capability.class);
classLookup.put("card", Card.class);
classLookup.put("charge", Charge.class);
classLookup.put("checkout.session", Session.class);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
Long canceledAt;

/**
* User-given reason for cancellation of this PaymentIntent, one of `duplicate`, `fraudulent`,
* `requested_by_customer`, `failed_invoice`, or `void_invoice`.
* Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`,
* `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`,
* `void_invoice`, or `automatic`).
*/
@SerializedName("cancellation_reason")
String cancellationReason;
Expand Down
Loading

0 comments on commit d872635

Please sign in to comment.