All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stripe.model.Capability Maven / Gradle / Ivy

There is a newer version: 28.2.0
Show newest version
// Generated by delombok at Wed Jun 30 19:13:17 EDT 2021
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
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;

public class Capability extends ApiResource implements HasId {
  /**
   * The account for which the capability enables functionality.
   */
  @SerializedName("account")
  ExpandableField account;
  /**
   * The identifier for the capability.
   */
  @SerializedName("id")
  String id;
  /**
   * String representing the object's type. Objects of the same type share the same value.
   *
   * 

Equal to {@code capability}. */ @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 {@code active}, {@code inactive}, {@code pending}, or * {@code unrequested}. */ @SerializedName("status") String status; /** * Get ID of expandable {@code 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 {@code account}. */ public Account getAccountObject() { return (this.account != null) ? this.account.getExpanded() : null; } public void setAccountObject(Account expandableObject) { this.account = new ExpandableField(expandableObject.getId(), expandableObject); } /** * Updates an existing Account Capability. */ public Capability update(Map params) throws StripeException { return update(params, (RequestOptions) null); } /** * Updates an existing Account Capability. */ public Capability update(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/accounts/%s/capabilities/%s", ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); return ApiResource.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 = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/accounts/%s/capabilities/%s", ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Capability.class, options); } public static class Requirements extends StripeObject { /** * Date by which the fields in {@code currently_due} must be collected to keep the capability * enabled for the account. These fields may disable the capability sooner if the next threshold * is reached before they are collected. */ @SerializedName("current_deadline") Long currentDeadline; /** * Fields that need to be collected to keep the capability enabled. If not collected by {@code * current_deadline}, these fields appear in {@code past_due} as well, and the capability is * disabled. */ @SerializedName("currently_due") List currentlyDue; /** * If the capability is disabled, this string describes why. Can be {@code * requirements.past_due}, {@code requirements.pending_verification}, {@code listed}, {@code * platform_paused}, {@code rejected.fraud}, {@code rejected.listed}, {@code * rejected.terms_of_service}, {@code rejected.other}, {@code under_review}, or {@code other}. * *

{@code rejected.unsupported_business} means that the account's business is not supported * by the capability. For example, payment methods may restrict the businesses they support in * their terms of service: * *

- Afterpay * Clearpay's terms of service * *

If you believe that the rejection is in error, please contact [email protected] for * assistance. */ @SerializedName("disabled_reason") String disabledReason; /** * Fields that are {@code currently_due} and need to be collected again because validation or * verification failed. */ @SerializedName("errors") List errors; /** * Fields that need to be collected assuming all volume thresholds are reached. As they become * required, they appear in {@code currently_due} as well, and {@code current_deadline} becomes * set. */ @SerializedName("eventually_due") List eventuallyDue; /** * Fields that weren't collected by {@code current_deadline}. These fields need to be collected * to enable the capability on the account. */ @SerializedName("past_due") List pastDue; /** * Fields that may become required depending on the results of verification or review. Will be * an empty array unless an asynchronous verification is pending. If verification fails, these * fields move to {@code eventually_due}, {@code currently_due}, or {@code past_due}. */ @SerializedName("pending_verification") List pendingVerification; @java.lang.SuppressWarnings("all") @lombok.Generated public Long getCurrentDeadline() { return this.currentDeadline; } @java.lang.SuppressWarnings("all") @lombok.Generated public List getCurrentlyDue() { return this.currentlyDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public String getDisabledReason() { return this.disabledReason; } @java.lang.SuppressWarnings("all") @lombok.Generated public List getErrors() { return this.errors; } @java.lang.SuppressWarnings("all") @lombok.Generated public List getEventuallyDue() { return this.eventuallyDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public List getPastDue() { return this.pastDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public List getPendingVerification() { return this.pendingVerification; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setCurrentDeadline(final Long currentDeadline) { this.currentDeadline = currentDeadline; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setCurrentlyDue(final List currentlyDue) { this.currentlyDue = currentlyDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setDisabledReason(final String disabledReason) { this.disabledReason = disabledReason; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setErrors(final List errors) { this.errors = errors; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setEventuallyDue(final List eventuallyDue) { this.eventuallyDue = eventuallyDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setPastDue(final List pastDue) { this.pastDue = pastDue; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setPendingVerification(final List pendingVerification) { this.pendingVerification = pendingVerification; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Capability.Requirements)) return false; final Capability.Requirements other = (Capability.Requirements) o; if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$currentDeadline = this.getCurrentDeadline(); final java.lang.Object other$currentDeadline = other.getCurrentDeadline(); if (this$currentDeadline == null ? other$currentDeadline != null : !this$currentDeadline.equals(other$currentDeadline)) return false; final java.lang.Object this$currentlyDue = this.getCurrentlyDue(); final java.lang.Object other$currentlyDue = other.getCurrentlyDue(); if (this$currentlyDue == null ? other$currentlyDue != null : !this$currentlyDue.equals(other$currentlyDue)) return false; final java.lang.Object this$disabledReason = this.getDisabledReason(); final java.lang.Object other$disabledReason = other.getDisabledReason(); if (this$disabledReason == null ? other$disabledReason != null : !this$disabledReason.equals(other$disabledReason)) return false; final java.lang.Object this$errors = this.getErrors(); final java.lang.Object other$errors = other.getErrors(); if (this$errors == null ? other$errors != null : !this$errors.equals(other$errors)) return false; final java.lang.Object this$eventuallyDue = this.getEventuallyDue(); final java.lang.Object other$eventuallyDue = other.getEventuallyDue(); if (this$eventuallyDue == null ? other$eventuallyDue != null : !this$eventuallyDue.equals(other$eventuallyDue)) return false; final java.lang.Object this$pastDue = this.getPastDue(); final java.lang.Object other$pastDue = other.getPastDue(); if (this$pastDue == null ? other$pastDue != null : !this$pastDue.equals(other$pastDue)) return false; final java.lang.Object this$pendingVerification = this.getPendingVerification(); final java.lang.Object other$pendingVerification = other.getPendingVerification(); if (this$pendingVerification == null ? other$pendingVerification != null : !this$pendingVerification.equals(other$pendingVerification)) return false; return true; } @java.lang.SuppressWarnings("all") @lombok.Generated protected boolean canEqual(final java.lang.Object other) { return other instanceof Capability.Requirements; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $currentDeadline = this.getCurrentDeadline(); result = result * PRIME + ($currentDeadline == null ? 43 : $currentDeadline.hashCode()); final java.lang.Object $currentlyDue = this.getCurrentlyDue(); result = result * PRIME + ($currentlyDue == null ? 43 : $currentlyDue.hashCode()); final java.lang.Object $disabledReason = this.getDisabledReason(); result = result * PRIME + ($disabledReason == null ? 43 : $disabledReason.hashCode()); final java.lang.Object $errors = this.getErrors(); result = result * PRIME + ($errors == null ? 43 : $errors.hashCode()); final java.lang.Object $eventuallyDue = this.getEventuallyDue(); result = result * PRIME + ($eventuallyDue == null ? 43 : $eventuallyDue.hashCode()); final java.lang.Object $pastDue = this.getPastDue(); result = result * PRIME + ($pastDue == null ? 43 : $pastDue.hashCode()); final java.lang.Object $pendingVerification = this.getPendingVerification(); result = result * PRIME + ($pendingVerification == null ? 43 : $pendingVerification.hashCode()); return result; } } /** * String representing the object's type. Objects of the same type share the same value. * *

Equal to {@code capability}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getObject() { return this.object; } /** * Whether the capability has been requested. */ @java.lang.SuppressWarnings("all") @lombok.Generated public Boolean getRequested() { return this.requested; } /** * Time at which the capability was requested. Measured in seconds since the Unix epoch. */ @java.lang.SuppressWarnings("all") @lombok.Generated public Long getRequestedAt() { return this.requestedAt; } @java.lang.SuppressWarnings("all") @lombok.Generated public Requirements getRequirements() { return this.requirements; } /** * The status of the capability. Can be {@code active}, {@code inactive}, {@code pending}, or * {@code unrequested}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getStatus() { return this.status; } /** * The identifier for the capability. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setId(final String id) { this.id = id; } /** * String representing the object's type. Objects of the same type share the same value. * *

Equal to {@code capability}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setObject(final String object) { this.object = object; } /** * Whether the capability has been requested. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setRequested(final Boolean requested) { this.requested = requested; } /** * Time at which the capability was requested. Measured in seconds since the Unix epoch. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setRequestedAt(final Long requestedAt) { this.requestedAt = requestedAt; } @java.lang.SuppressWarnings("all") @lombok.Generated public void setRequirements(final Requirements requirements) { this.requirements = requirements; } /** * The status of the capability. Can be {@code active}, {@code inactive}, {@code pending}, or * {@code unrequested}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setStatus(final String status) { this.status = status; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Capability)) return false; final Capability other = (Capability) o; if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$requested = this.getRequested(); final java.lang.Object other$requested = other.getRequested(); if (this$requested == null ? other$requested != null : !this$requested.equals(other$requested)) return false; final java.lang.Object this$requestedAt = this.getRequestedAt(); final java.lang.Object other$requestedAt = other.getRequestedAt(); if (this$requestedAt == null ? other$requestedAt != null : !this$requestedAt.equals(other$requestedAt)) return false; final java.lang.Object this$account = this.getAccount(); final java.lang.Object other$account = other.getAccount(); if (this$account == null ? other$account != null : !this$account.equals(other$account)) return false; final java.lang.Object this$id = this.getId(); final java.lang.Object other$id = other.getId(); if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false; final java.lang.Object this$object = this.getObject(); final java.lang.Object other$object = other.getObject(); if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false; final java.lang.Object this$requirements = this.getRequirements(); final java.lang.Object other$requirements = other.getRequirements(); if (this$requirements == null ? other$requirements != null : !this$requirements.equals(other$requirements)) return false; final java.lang.Object this$status = this.getStatus(); final java.lang.Object other$status = other.getStatus(); if (this$status == null ? other$status != null : !this$status.equals(other$status)) return false; return true; } @java.lang.SuppressWarnings("all") @lombok.Generated protected boolean canEqual(final java.lang.Object other) { return other instanceof Capability; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $requested = this.getRequested(); result = result * PRIME + ($requested == null ? 43 : $requested.hashCode()); final java.lang.Object $requestedAt = this.getRequestedAt(); result = result * PRIME + ($requestedAt == null ? 43 : $requestedAt.hashCode()); final java.lang.Object $account = this.getAccount(); result = result * PRIME + ($account == null ? 43 : $account.hashCode()); final java.lang.Object $id = this.getId(); result = result * PRIME + ($id == null ? 43 : $id.hashCode()); final java.lang.Object $object = this.getObject(); result = result * PRIME + ($object == null ? 43 : $object.hashCode()); final java.lang.Object $requirements = this.getRequirements(); result = result * PRIME + ($requirements == null ? 43 : $requirements.hashCode()); final java.lang.Object $status = this.getStatus(); result = result * PRIME + ($status == null ? 43 : $status.hashCode()); return result; } /** * The identifier for the capability. */ @Override @java.lang.SuppressWarnings("all") @lombok.Generated public String getId() { return this.id; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy