From 32ae289d46a9d7c666686411d962863489b89b2b Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 20:42:29 +0000 Subject: [PATCH] SDK regeneration --- README.md | 10 +- build.gradle | 4 +- reference.md | 28 +- .../square/AsyncSquareClientBuilder.java | 2 +- .../squareup/square/SquareClientBuilder.java | 2 +- .../squareup/square/core/ClientOptions.java | 4 +- .../square/types/CardPaymentDetails.java | 289 +----------------- .../types/CreateSubscriptionRequest.java | 8 +- .../square/types/DeviceAttributes.java | 12 +- .../types/DeviceAttributesDeviceType.java | 86 ++++++ ...DeviceComponentDetailsEthernetDetails.java | 61 +++- .../DeviceComponentDetailsMeasurement.java | 6 + .../DeviceComponentDetailsWiFiDetails.java | 57 +++- .../squareup/square/types/DeviceStatus.java | 6 +- .../squareup/square/types/LoyaltyAccount.java | 35 ++- .../com/squareup/square/types/Payment.java | 6 +- .../squareup/square/types/Subscription.java | 56 +++- .../square/types/SubscriptionActionType.java | 10 + .../square/types/SubscriptionStatus.java | 10 + 19 files changed, 353 insertions(+), 339 deletions(-) create mode 100644 src/main/java/com/squareup/square/types/DeviceAttributesDeviceType.java diff --git a/README.md b/README.md index 7b1cd403..9ff27443 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Add the dependency in your `pom.xml` file: com.squareup square - 45.0.3.20250820 + 45.0.0.20250924 ``` @@ -336,8 +336,8 @@ Gradle: ```groovy dependencies { - implementation 'com.squareup:square:45.0.3.20250820' - implementation 'com.squareup:square-legacy:45.0.3.20250820' + implementation 'com.squareup:square:45.0.0.20250924' + implementation 'com.squareup:square-legacy:45.0.0.20250924' } ``` @@ -347,12 +347,12 @@ Maven: com.squareup square - 45.0.3.20250820 + 45.0.0.20250924 com.squareup square-legacy - 45.0.3.20250820 + 45.0.0.20250924 ``` diff --git a/build.gradle b/build.gradle index 0e3cf76b..b5f723c1 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.squareup' -version = '45.0.3.20250820' +version = '45.0.0.20250924' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.squareup' artifactId = 'square' - version = '45.0.3.20250820' + version = '45.0.0.20250924' from components.java pom { name = 'square' diff --git a/reference.md b/reference.md index 8df79be6..4d998d2e 100644 --- a/reference.md +++ b/reference.md @@ -10822,7 +10822,7 @@ client.payments().list( **beginTime:** `Optional` -Indicates the start of the time range to retrieve payments for, in RFC 3339 format. +Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Inclusive. Default: The current time minus one year. @@ -10834,7 +10834,7 @@ Inclusive. Default: The current time minus one year. **endTime:** `Optional` -Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The +Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Default: The current time. @@ -11074,7 +11074,7 @@ This could be a payment token generated by the Web Payments SDK for any of its [supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods), including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment that the seller received outside of Square, specify either "CASH" or "EXTERNAL". -For more information, see +For more information, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). @@ -11162,10 +11162,10 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym **delayDuration:** `Optional` -The duration of time after the payment's creation when Square automatically -either completes or cancels the payment depending on the `delay_action` field value. -For more information, see -[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). +The duration of time after the payment's creation when Square automatically +either completes or cancels the payment depending on the `delay_action` field value. +For more information, see +[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). This parameter should be specified as a time duration, in RFC 3339 format. @@ -11186,8 +11186,8 @@ Default: **delayAction:** `Optional` The action to be applied to the payment when the `delay_duration` has elapsed. The action must be -CANCEL or COMPLETE. For more information, see -[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). +CANCEL or COMPLETE. For more information, see +[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). Default: CANCEL @@ -11245,7 +11245,7 @@ used. **teamMemberId:** `Optional` -An optional [TeamMember](entity:TeamMember) ID to associate with +An optional [TeamMember](entity:TeamMember) ID to associate with this payment. @@ -11258,7 +11258,7 @@ this payment. A user-defined ID to associate with the payment. -You can use this field to associate the payment to an entity in an external system +You can use this field to associate the payment to an entity in an external system (for example, you might specify an order ID that is generated by a third-party shopping cart). @@ -11752,8 +11752,8 @@ client.payments().complete( **versionToken:** `Optional` -Used for optimistic concurrency. This opaque token identifies the current `Payment` -version that the caller expects. If the server has a different version of the Payment, +Used for optimistic concurrency. This opaque token identifies the current `Payment` +version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION_MISMATCH error is returned. @@ -12930,7 +12930,7 @@ If the cancellation date is earlier than the end date of a subscription cycle, t at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` -occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription +occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. diff --git a/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java b/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java index 93eb4c8f..42e0a880 100644 --- a/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java +++ b/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java @@ -19,7 +19,7 @@ public class AsyncSquareClientBuilder { private String token = System.getenv("SQUARE_TOKEN"); - private String version = "2025-08-20"; + private String version = "2025-09-24"; private Environment environment = Environment.PRODUCTION; diff --git a/src/main/java/com/squareup/square/SquareClientBuilder.java b/src/main/java/com/squareup/square/SquareClientBuilder.java index f0948100..26026398 100644 --- a/src/main/java/com/squareup/square/SquareClientBuilder.java +++ b/src/main/java/com/squareup/square/SquareClientBuilder.java @@ -19,7 +19,7 @@ public class SquareClientBuilder { private String token = System.getenv("SQUARE_TOKEN"); - private String version = "2025-08-20"; + private String version = "2025-09-24"; private Environment environment = Environment.PRODUCTION; diff --git a/src/main/java/com/squareup/square/core/ClientOptions.java b/src/main/java/com/squareup/square/core/ClientOptions.java index a6da5b30..3ff46663 100644 --- a/src/main/java/com/squareup/square/core/ClientOptions.java +++ b/src/main/java/com/squareup/square/core/ClientOptions.java @@ -32,10 +32,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.squareup:square/45.0.3.20250820"); + put("User-Agent", "com.squareup:square/45.0.0.20250924"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.square.fern:api-sdk"); - put("X-Fern-SDK-Version", "45.0.3.20250820"); + put("X-Fern-SDK-Version", "45.0.0.20250924"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/squareup/square/types/CardPaymentDetails.java b/src/main/java/com/squareup/square/types/CardPaymentDetails.java index 86a58efd..83862888 100644 --- a/src/main/java/com/squareup/square/types/CardPaymentDetails.java +++ b/src/main/java/com/squareup/square/types/CardPaymentDetails.java @@ -5,15 +5,12 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.squareup.square.core.Nullable; -import com.squareup.square.core.NullableNonemptyFilter; import com.squareup.square.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -99,11 +96,8 @@ private CardPaymentDetails( * @return The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or * FAILED. */ - @JsonIgnore + @JsonProperty("status") public Optional getStatus() { - if (status == null) { - return Optional.empty(); - } return status; } @@ -119,11 +113,8 @@ public Optional getCard() { * @return The method used to enter the card's details for the payment. The method can be * KEYED, SWIPED, EMV, ON_FILE, or CONTACTLESS. */ - @JsonIgnore + @JsonProperty("entry_method") public Optional getEntryMethod() { - if (entryMethod == null) { - return Optional.empty(); - } return entryMethod; } @@ -131,11 +122,8 @@ public Optional getEntryMethod() { * @return The status code returned from the Card Verification Value (CVV) check. The code can be * CVV_ACCEPTED, CVV_REJECTED, or CVV_NOT_CHECKED. */ - @JsonIgnore + @JsonProperty("cvv_status") public Optional getCvvStatus() { - if (cvvStatus == null) { - return Optional.empty(); - } return cvvStatus; } @@ -143,11 +131,8 @@ public Optional getCvvStatus() { * @return The status code returned from the Address Verification System (AVS) check. The code can be * AVS_ACCEPTED, AVS_REJECTED, or AVS_NOT_CHECKED. */ - @JsonIgnore + @JsonProperty("avs_status") public Optional getAvsStatus() { - if (avsStatus == null) { - return Optional.empty(); - } return avsStatus; } @@ -155,44 +140,32 @@ public Optional getAvsStatus() { * @return The status code returned by the card issuer that describes the payment's * authorization status. */ - @JsonIgnore + @JsonProperty("auth_result_code") public Optional getAuthResultCode() { - if (authResultCode == null) { - return Optional.empty(); - } return authResultCode; } /** * @return For EMV payments, the application ID identifies the EMV application used for the payment. */ - @JsonIgnore + @JsonProperty("application_identifier") public Optional getApplicationIdentifier() { - if (applicationIdentifier == null) { - return Optional.empty(); - } return applicationIdentifier; } /** * @return For EMV payments, the human-readable name of the EMV application used for the payment. */ - @JsonIgnore + @JsonProperty("application_name") public Optional getApplicationName() { - if (applicationName == null) { - return Optional.empty(); - } return applicationName; } /** * @return For EMV payments, the cryptogram generated for the payment. */ - @JsonIgnore + @JsonProperty("application_cryptogram") public Optional getApplicationCryptogram() { - if (applicationCryptogram == null) { - return Optional.empty(); - } return applicationCryptogram; } @@ -200,11 +173,8 @@ public Optional getApplicationCryptogram() { * @return For EMV payments, the method used to verify the cardholder's identity. The method can be * PIN, SIGNATURE, PIN_AND_SIGNATURE, ON_DEVICE, or NONE. */ - @JsonIgnore + @JsonProperty("verification_method") public Optional getVerificationMethod() { - if (verificationMethod == null) { - return Optional.empty(); - } return verificationMethod; } @@ -212,11 +182,8 @@ public Optional getVerificationMethod() { * @return For EMV payments, the results of the cardholder verification. The result can be * SUCCESS, FAILURE, or UNKNOWN. */ - @JsonIgnore + @JsonProperty("verification_results") public Optional getVerificationResults() { - if (verificationResults == null) { - return Optional.empty(); - } return verificationResults; } @@ -225,11 +192,8 @@ public Optional getVerificationResults() { *

Note: The actual statement description varies and is likely to be truncated and appended with * additional information on a per issuer basis.

*/ - @JsonIgnore + @JsonProperty("statement_description") public Optional getStatementDescription() { - if (statementDescription == null) { - return Optional.empty(); - } return statementDescription; } @@ -254,100 +218,16 @@ public Optional getCardPaymentTimeline() { * @return Whether the card must be physically present for the payment to * be refunded. If set to true, the card must be present. */ - @JsonIgnore + @JsonProperty("refund_requires_card_presence") public Optional getRefundRequiresCardPresence() { - if (refundRequiresCardPresence == null) { - return Optional.empty(); - } return refundRequiresCardPresence; } /** * @return Information about errors encountered during the request. */ - @JsonIgnore - public Optional> getErrors() { - if (errors == null) { - return Optional.empty(); - } - return errors; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("status") - private Optional _getStatus() { - return status; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("entry_method") - private Optional _getEntryMethod() { - return entryMethod; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("cvv_status") - private Optional _getCvvStatus() { - return cvvStatus; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("avs_status") - private Optional _getAvsStatus() { - return avsStatus; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("auth_result_code") - private Optional _getAuthResultCode() { - return authResultCode; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("application_identifier") - private Optional _getApplicationIdentifier() { - return applicationIdentifier; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("application_name") - private Optional _getApplicationName() { - return applicationName; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("application_cryptogram") - private Optional _getApplicationCryptogram() { - return applicationCryptogram; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("verification_method") - private Optional _getVerificationMethod() { - return verificationMethod; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("verification_results") - private Optional _getVerificationResults() { - return verificationResults; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("statement_description") - private Optional _getStatementDescription() { - return statementDescription; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("refund_requires_card_presence") - private Optional _getRefundRequiresCardPresence() { - return refundRequiresCardPresence; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("errors") - private Optional> _getErrors() { + public Optional> getErrors() { return errors; } @@ -485,17 +365,6 @@ public Builder status(String status) { return this; } - public Builder status(Nullable status) { - if (status.isNull()) { - this.status = null; - } else if (status.isEmpty()) { - this.status = Optional.empty(); - } else { - this.status = Optional.of(status.get()); - } - return this; - } - /** *

The credit card's non-confidential details.

*/ @@ -525,17 +394,6 @@ public Builder entryMethod(String entryMethod) { return this; } - public Builder entryMethod(Nullable entryMethod) { - if (entryMethod.isNull()) { - this.entryMethod = null; - } else if (entryMethod.isEmpty()) { - this.entryMethod = Optional.empty(); - } else { - this.entryMethod = Optional.of(entryMethod.get()); - } - return this; - } - /** *

The status code returned from the Card Verification Value (CVV) check. The code can be * CVV_ACCEPTED, CVV_REJECTED, or CVV_NOT_CHECKED.

@@ -551,17 +409,6 @@ public Builder cvvStatus(String cvvStatus) { return this; } - public Builder cvvStatus(Nullable cvvStatus) { - if (cvvStatus.isNull()) { - this.cvvStatus = null; - } else if (cvvStatus.isEmpty()) { - this.cvvStatus = Optional.empty(); - } else { - this.cvvStatus = Optional.of(cvvStatus.get()); - } - return this; - } - /** *

The status code returned from the Address Verification System (AVS) check. The code can be * AVS_ACCEPTED, AVS_REJECTED, or AVS_NOT_CHECKED.

@@ -577,17 +424,6 @@ public Builder avsStatus(String avsStatus) { return this; } - public Builder avsStatus(Nullable avsStatus) { - if (avsStatus.isNull()) { - this.avsStatus = null; - } else if (avsStatus.isEmpty()) { - this.avsStatus = Optional.empty(); - } else { - this.avsStatus = Optional.of(avsStatus.get()); - } - return this; - } - /** *

The status code returned by the card issuer that describes the payment's * authorization status.

@@ -603,17 +439,6 @@ public Builder authResultCode(String authResultCode) { return this; } - public Builder authResultCode(Nullable authResultCode) { - if (authResultCode.isNull()) { - this.authResultCode = null; - } else if (authResultCode.isEmpty()) { - this.authResultCode = Optional.empty(); - } else { - this.authResultCode = Optional.of(authResultCode.get()); - } - return this; - } - /** *

For EMV payments, the application ID identifies the EMV application used for the payment.

*/ @@ -628,17 +453,6 @@ public Builder applicationIdentifier(String applicationIdentifier) { return this; } - public Builder applicationIdentifier(Nullable applicationIdentifier) { - if (applicationIdentifier.isNull()) { - this.applicationIdentifier = null; - } else if (applicationIdentifier.isEmpty()) { - this.applicationIdentifier = Optional.empty(); - } else { - this.applicationIdentifier = Optional.of(applicationIdentifier.get()); - } - return this; - } - /** *

For EMV payments, the human-readable name of the EMV application used for the payment.

*/ @@ -653,17 +467,6 @@ public Builder applicationName(String applicationName) { return this; } - public Builder applicationName(Nullable applicationName) { - if (applicationName.isNull()) { - this.applicationName = null; - } else if (applicationName.isEmpty()) { - this.applicationName = Optional.empty(); - } else { - this.applicationName = Optional.of(applicationName.get()); - } - return this; - } - /** *

For EMV payments, the cryptogram generated for the payment.

*/ @@ -678,17 +481,6 @@ public Builder applicationCryptogram(String applicationCryptogram) { return this; } - public Builder applicationCryptogram(Nullable applicationCryptogram) { - if (applicationCryptogram.isNull()) { - this.applicationCryptogram = null; - } else if (applicationCryptogram.isEmpty()) { - this.applicationCryptogram = Optional.empty(); - } else { - this.applicationCryptogram = Optional.of(applicationCryptogram.get()); - } - return this; - } - /** *

For EMV payments, the method used to verify the cardholder's identity. The method can be * PIN, SIGNATURE, PIN_AND_SIGNATURE, ON_DEVICE, or NONE.

@@ -704,17 +496,6 @@ public Builder verificationMethod(String verificationMethod) { return this; } - public Builder verificationMethod(Nullable verificationMethod) { - if (verificationMethod.isNull()) { - this.verificationMethod = null; - } else if (verificationMethod.isEmpty()) { - this.verificationMethod = Optional.empty(); - } else { - this.verificationMethod = Optional.of(verificationMethod.get()); - } - return this; - } - /** *

For EMV payments, the results of the cardholder verification. The result can be * SUCCESS, FAILURE, or UNKNOWN.

@@ -730,17 +511,6 @@ public Builder verificationResults(String verificationResults) { return this; } - public Builder verificationResults(Nullable verificationResults) { - if (verificationResults.isNull()) { - this.verificationResults = null; - } else if (verificationResults.isEmpty()) { - this.verificationResults = Optional.empty(); - } else { - this.verificationResults = Optional.of(verificationResults.get()); - } - return this; - } - /** *

The statement description sent to the card networks.

*

Note: The actual statement description varies and is likely to be truncated and appended with @@ -757,17 +527,6 @@ public Builder statementDescription(String statementDescription) { return this; } - public Builder statementDescription(Nullable statementDescription) { - if (statementDescription.isNull()) { - this.statementDescription = null; - } else if (statementDescription.isEmpty()) { - this.statementDescription = Optional.empty(); - } else { - this.statementDescription = Optional.of(statementDescription.get()); - } - return this; - } - /** *

Deprecated: Use Payment.device_details instead.

*

Details about the device that took the payment.

@@ -812,17 +571,6 @@ public Builder refundRequiresCardPresence(Boolean refundRequiresCardPresence) { return this; } - public Builder refundRequiresCardPresence(Nullable refundRequiresCardPresence) { - if (refundRequiresCardPresence.isNull()) { - this.refundRequiresCardPresence = null; - } else if (refundRequiresCardPresence.isEmpty()) { - this.refundRequiresCardPresence = Optional.empty(); - } else { - this.refundRequiresCardPresence = Optional.of(refundRequiresCardPresence.get()); - } - return this; - } - /** *

Information about errors encountered during the request.

*/ @@ -837,17 +585,6 @@ public Builder errors(List errors) { return this; } - public Builder errors(Nullable> errors) { - if (errors.isNull()) { - this.errors = null; - } else if (errors.isEmpty()) { - this.errors = Optional.empty(); - } else { - this.errors = Optional.of(errors.get()); - } - return this; - } - public CardPaymentDetails build() { return new CardPaymentDetails( status, diff --git a/src/main/java/com/squareup/square/types/CreateSubscriptionRequest.java b/src/main/java/com/squareup/square/types/CreateSubscriptionRequest.java index 10e5e634..edadeb36 100644 --- a/src/main/java/com/squareup/square/types/CreateSubscriptionRequest.java +++ b/src/main/java/com/squareup/square/types/CreateSubscriptionRequest.java @@ -131,7 +131,7 @@ public Optional getStartDate() { * If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

*

When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date - * occurs before the subscription plan expires, the specified canceled_date sets the date when the subscription + * occurs before the subscription plan completes, the specified canceled_date sets the date when the subscription * stops through the end of the last cycle.

*/ @JsonProperty("canceled_date") @@ -308,7 +308,7 @@ public interface _FinalStage { * If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

*

When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date - * occurs before the subscription plan expires, the specified canceled_date sets the date when the subscription + * occurs before the subscription plan completes, the specified canceled_date sets the date when the subscription * stops through the end of the last cycle.

*/ _FinalStage canceledDate(Optional canceledDate); @@ -613,7 +613,7 @@ public _FinalStage taxPercentage(Optional taxPercentage) { * If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

*

When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date - * occurs before the subscription plan expires, the specified canceled_date sets the date when the subscription + * occurs before the subscription plan completes, the specified canceled_date sets the date when the subscription * stops through the end of the last cycle.

* @return Reference to {@code this} so that method calls can be chained together. */ @@ -629,7 +629,7 @@ public _FinalStage canceledDate(String canceledDate) { * If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

*

When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date - * occurs before the subscription plan expires, the specified canceled_date sets the date when the subscription + * occurs before the subscription plan completes, the specified canceled_date sets the date when the subscription * stops through the end of the last cycle.

*/ @java.lang.Override diff --git a/src/main/java/com/squareup/square/types/DeviceAttributes.java b/src/main/java/com/squareup/square/types/DeviceAttributes.java index e50f836d..5f4e116d 100644 --- a/src/main/java/com/squareup/square/types/DeviceAttributes.java +++ b/src/main/java/com/squareup/square/types/DeviceAttributes.java @@ -24,7 +24,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DeviceAttributes.Builder.class) public final class DeviceAttributes { - private final String type; + private final DeviceAttributesDeviceType type; private final String manufacturer; @@ -43,7 +43,7 @@ public final class DeviceAttributes { private final Map additionalProperties; private DeviceAttributes( - String type, + DeviceAttributesDeviceType type, String manufacturer, Optional model, Optional name, @@ -68,7 +68,7 @@ private DeviceAttributes( * See DeviceType for possible values */ @JsonProperty("type") - public String getType() { + public DeviceAttributesDeviceType getType() { return type; } @@ -215,7 +215,7 @@ public interface TypeStage { *

The device type. * See DeviceType for possible values

*/ - ManufacturerStage type(@NotNull String type); + ManufacturerStage type(@NotNull DeviceAttributesDeviceType type); Builder from(DeviceAttributes other); } @@ -285,7 +285,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements TypeStage, ManufacturerStage, _FinalStage { - private String type; + private DeviceAttributesDeviceType type; private String manufacturer; @@ -328,7 +328,7 @@ public Builder from(DeviceAttributes other) { */ @java.lang.Override @JsonSetter("type") - public ManufacturerStage type(@NotNull String type) { + public ManufacturerStage type(@NotNull DeviceAttributesDeviceType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } diff --git a/src/main/java/com/squareup/square/types/DeviceAttributesDeviceType.java b/src/main/java/com/squareup/square/types/DeviceAttributesDeviceType.java new file mode 100644 index 00000000..24ccfdba --- /dev/null +++ b/src/main/java/com/squareup/square/types/DeviceAttributesDeviceType.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.squareup.square.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DeviceAttributesDeviceType { + public static final DeviceAttributesDeviceType TERMINAL = + new DeviceAttributesDeviceType(Value.TERMINAL, "TERMINAL"); + + public static final DeviceAttributesDeviceType HANDHELD = + new DeviceAttributesDeviceType(Value.HANDHELD, "HANDHELD"); + + private final Value value; + + private final String string; + + DeviceAttributesDeviceType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DeviceAttributesDeviceType + && this.string.equals(((DeviceAttributesDeviceType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TERMINAL: + return visitor.visitTerminal(); + case HANDHELD: + return visitor.visitHandheld(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DeviceAttributesDeviceType valueOf(String value) { + switch (value) { + case "TERMINAL": + return TERMINAL; + case "HANDHELD": + return HANDHELD; + default: + return new DeviceAttributesDeviceType(Value.UNKNOWN, value); + } + } + + public enum Value { + TERMINAL, + + HANDHELD, + + UNKNOWN + } + + public interface Visitor { + T visitTerminal(); + + T visitHandheld(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/squareup/square/types/DeviceComponentDetailsEthernetDetails.java b/src/main/java/com/squareup/square/types/DeviceComponentDetailsEthernetDetails.java index 0739cc90..2077f3b3 100644 --- a/src/main/java/com/squareup/square/types/DeviceComponentDetailsEthernetDetails.java +++ b/src/main/java/com/squareup/square/types/DeviceComponentDetailsEthernetDetails.java @@ -27,12 +27,18 @@ public final class DeviceComponentDetailsEthernetDetails { private final Optional ipAddressV4; + private final Optional macAddress; + private final Map additionalProperties; private DeviceComponentDetailsEthernetDetails( - Optional active, Optional ipAddressV4, Map additionalProperties) { + Optional active, + Optional ipAddressV4, + Optional macAddress, + Map additionalProperties) { this.active = active; this.ipAddressV4 = ipAddressV4; + this.macAddress = macAddress; this.additionalProperties = additionalProperties; } @@ -58,6 +64,17 @@ public Optional getIpAddressV4() { return ipAddressV4; } + /** + * @return The mac address of the device in this network. + */ + @JsonIgnore + public Optional getMacAddress() { + if (macAddress == null) { + return Optional.empty(); + } + return macAddress; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("active") private Optional _getActive() { @@ -70,6 +87,12 @@ private Optional _getIpAddressV4() { return ipAddressV4; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mac_address") + private Optional _getMacAddress() { + return macAddress; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -83,12 +106,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(DeviceComponentDetailsEthernetDetails other) { - return active.equals(other.active) && ipAddressV4.equals(other.ipAddressV4); + return active.equals(other.active) + && ipAddressV4.equals(other.ipAddressV4) + && macAddress.equals(other.macAddress); } @java.lang.Override public int hashCode() { - return Objects.hash(this.active, this.ipAddressV4); + return Objects.hash(this.active, this.ipAddressV4, this.macAddress); } @java.lang.Override @@ -106,6 +131,8 @@ public static final class Builder { private Optional ipAddressV4 = Optional.empty(); + private Optional macAddress = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -114,6 +141,7 @@ private Builder() {} public Builder from(DeviceComponentDetailsEthernetDetails other) { active(other.getActive()); ipAddressV4(other.getIpAddressV4()); + macAddress(other.getMacAddress()); return this; } @@ -167,8 +195,33 @@ public Builder ipAddressV4(Nullable ipAddressV4) { return this; } + /** + *

The mac address of the device in this network.

+ */ + @JsonSetter(value = "mac_address", nulls = Nulls.SKIP) + public Builder macAddress(Optional macAddress) { + this.macAddress = macAddress; + return this; + } + + public Builder macAddress(String macAddress) { + this.macAddress = Optional.ofNullable(macAddress); + return this; + } + + public Builder macAddress(Nullable macAddress) { + if (macAddress.isNull()) { + this.macAddress = null; + } else if (macAddress.isEmpty()) { + this.macAddress = Optional.empty(); + } else { + this.macAddress = Optional.of(macAddress.get()); + } + return this; + } + public DeviceComponentDetailsEthernetDetails build() { - return new DeviceComponentDetailsEthernetDetails(active, ipAddressV4, additionalProperties); + return new DeviceComponentDetailsEthernetDetails(active, ipAddressV4, macAddress, additionalProperties); } } } diff --git a/src/main/java/com/squareup/square/types/DeviceComponentDetailsMeasurement.java b/src/main/java/com/squareup/square/types/DeviceComponentDetailsMeasurement.java index e924053d..fdc3595d 100644 --- a/src/main/java/com/squareup/square/types/DeviceComponentDetailsMeasurement.java +++ b/src/main/java/com/squareup/square/types/DeviceComponentDetailsMeasurement.java @@ -32,6 +32,9 @@ private DeviceComponentDetailsMeasurement(Optional value, Map getValue() { if (value == null) { @@ -89,6 +92,9 @@ public Builder from(DeviceComponentDetailsMeasurement other) { return this; } + /** + *

Value of measure.

+ */ @JsonSetter(value = "value", nulls = Nulls.SKIP) public Builder value(Optional value) { this.value = value; diff --git a/src/main/java/com/squareup/square/types/DeviceComponentDetailsWiFiDetails.java b/src/main/java/com/squareup/square/types/DeviceComponentDetailsWiFiDetails.java index 536dc575..f3a19aa0 100644 --- a/src/main/java/com/squareup/square/types/DeviceComponentDetailsWiFiDetails.java +++ b/src/main/java/com/squareup/square/types/DeviceComponentDetailsWiFiDetails.java @@ -33,6 +33,8 @@ public final class DeviceComponentDetailsWiFiDetails { private final Optional signalStrength; + private final Optional macAddress; + private final Map additionalProperties; private DeviceComponentDetailsWiFiDetails( @@ -41,12 +43,14 @@ private DeviceComponentDetailsWiFiDetails( Optional ipAddressV4, Optional secureConnection, Optional signalStrength, + Optional macAddress, Map additionalProperties) { this.active = active; this.ssid = ssid; this.ipAddressV4 = ipAddressV4; this.secureConnection = secureConnection; this.signalStrength = signalStrength; + this.macAddress = macAddress; this.additionalProperties = additionalProperties; } @@ -103,6 +107,17 @@ public Optional getSignalStrength() { return signalStrength; } + /** + * @return The mac address of the device in this network. + */ + @JsonIgnore + public Optional getMacAddress() { + if (macAddress == null) { + return Optional.empty(); + } + return macAddress; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("active") private Optional _getActive() { @@ -127,6 +142,12 @@ private Optional _getSecureConnection() { return secureConnection; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mac_address") + private Optional _getMacAddress() { + return macAddress; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -143,12 +164,14 @@ private boolean equalTo(DeviceComponentDetailsWiFiDetails other) { && ssid.equals(other.ssid) && ipAddressV4.equals(other.ipAddressV4) && secureConnection.equals(other.secureConnection) - && signalStrength.equals(other.signalStrength); + && signalStrength.equals(other.signalStrength) + && macAddress.equals(other.macAddress); } @java.lang.Override public int hashCode() { - return Objects.hash(this.active, this.ssid, this.ipAddressV4, this.secureConnection, this.signalStrength); + return Objects.hash( + this.active, this.ssid, this.ipAddressV4, this.secureConnection, this.signalStrength, this.macAddress); } @java.lang.Override @@ -172,6 +195,8 @@ public static final class Builder { private Optional signalStrength = Optional.empty(); + private Optional macAddress = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -183,6 +208,7 @@ public Builder from(DeviceComponentDetailsWiFiDetails other) { ipAddressV4(other.getIpAddressV4()); secureConnection(other.getSecureConnection()); signalStrength(other.getSignalStrength()); + macAddress(other.getMacAddress()); return this; } @@ -301,9 +327,34 @@ public Builder signalStrength(DeviceComponentDetailsMeasurement signalStrength) return this; } + /** + *

The mac address of the device in this network.

+ */ + @JsonSetter(value = "mac_address", nulls = Nulls.SKIP) + public Builder macAddress(Optional macAddress) { + this.macAddress = macAddress; + return this; + } + + public Builder macAddress(String macAddress) { + this.macAddress = Optional.ofNullable(macAddress); + return this; + } + + public Builder macAddress(Nullable macAddress) { + if (macAddress.isNull()) { + this.macAddress = null; + } else if (macAddress.isEmpty()) { + this.macAddress = Optional.empty(); + } else { + this.macAddress = Optional.of(macAddress.get()); + } + return this; + } + public DeviceComponentDetailsWiFiDetails build() { return new DeviceComponentDetailsWiFiDetails( - active, ssid, ipAddressV4, secureConnection, signalStrength, additionalProperties); + active, ssid, ipAddressV4, secureConnection, signalStrength, macAddress, additionalProperties); } } } diff --git a/src/main/java/com/squareup/square/types/DeviceStatus.java b/src/main/java/com/squareup/square/types/DeviceStatus.java index 887daaed..8447ad2f 100644 --- a/src/main/java/com/squareup/square/types/DeviceStatus.java +++ b/src/main/java/com/squareup/square/types/DeviceStatus.java @@ -30,7 +30,8 @@ private DeviceStatus(Optional category, MapCategory for possible values + * @return Category of the device status. + * See Category for possible values */ @JsonProperty("category") public Optional getCategory() { @@ -81,7 +82,8 @@ public Builder from(DeviceStatus other) { } /** - *

See Category for possible values

+ *

Category of the device status. + * See Category for possible values

*/ @JsonSetter(value = "category", nulls = Nulls.SKIP) public Builder category(Optional category) { diff --git a/src/main/java/com/squareup/square/types/LoyaltyAccount.java b/src/main/java/com/squareup/square/types/LoyaltyAccount.java index c76297d9..68d6382f 100644 --- a/src/main/java/com/squareup/square/types/LoyaltyAccount.java +++ b/src/main/java/com/squareup/square/types/LoyaltyAccount.java @@ -119,9 +119,10 @@ public Optional getCustomerId() { /** * @return The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the Enrolled On or Member Since date in first-party Square products. *

If this field is not set in a CreateLoyaltyAccount request, Square populates it after the buyer's first action on their account - * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

- *

This field is typically specified in a CreateLoyaltyAccount request when creating a loyalty account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future.

+ * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale.

+ *

If this field is set in a CreateLoyaltyAccount request, it is meant to be used when there is a loyalty migration from another system and into Square. + * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. + * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.

*/ @JsonIgnore public Optional getEnrolledAt() { @@ -282,9 +283,10 @@ public interface _FinalStage { /** *

The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the Enrolled On or Member Since date in first-party Square products.

*

If this field is not set in a CreateLoyaltyAccount request, Square populates it after the buyer's first action on their account - * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

- *

This field is typically specified in a CreateLoyaltyAccount request when creating a loyalty account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future.

+ * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale.

+ *

If this field is set in a CreateLoyaltyAccount request, it is meant to be used when there is a loyalty migration from another system and into Square. + * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. + * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.

*/ _FinalStage enrolledAt(Optional enrolledAt); @@ -491,9 +493,10 @@ public _FinalStage createdAt(Optional createdAt) { /** *

The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the Enrolled On or Member Since date in first-party Square products.

*

If this field is not set in a CreateLoyaltyAccount request, Square populates it after the buyer's first action on their account - * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

- *

This field is typically specified in a CreateLoyaltyAccount request when creating a loyalty account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future.

+ * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale.

+ *

If this field is set in a CreateLoyaltyAccount request, it is meant to be used when there is a loyalty migration from another system and into Square. + * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. + * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -511,9 +514,10 @@ public _FinalStage enrolledAt(Nullable enrolledAt) { /** *

The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the Enrolled On or Member Since date in first-party Square products.

*

If this field is not set in a CreateLoyaltyAccount request, Square populates it after the buyer's first action on their account - * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

- *

This field is typically specified in a CreateLoyaltyAccount request when creating a loyalty account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future.

+ * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale.

+ *

If this field is set in a CreateLoyaltyAccount request, it is meant to be used when there is a loyalty migration from another system and into Square. + * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. + * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -525,9 +529,10 @@ public _FinalStage enrolledAt(String enrolledAt) { /** *

The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the Enrolled On or Member Since date in first-party Square products.

*

If this field is not set in a CreateLoyaltyAccount request, Square populates it after the buyer's first action on their account - * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale.

- *

This field is typically specified in a CreateLoyaltyAccount request when creating a loyalty account for a buyer who already interacted with their account. - * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future.

+ * (when AccumulateLoyaltyPoints or CreateLoyaltyReward is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale.

+ *

If this field is set in a CreateLoyaltyAccount request, it is meant to be used when there is a loyalty migration from another system and into Square. + * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. + * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.

*/ @java.lang.Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) diff --git a/src/main/java/com/squareup/square/types/Payment.java b/src/main/java/com/squareup/square/types/Payment.java index 54c8ae21..23dc2e35 100644 --- a/src/main/java/com/squareup/square/types/Payment.java +++ b/src/main/java/com/squareup/square/types/Payment.java @@ -243,7 +243,8 @@ public Optional getAmountMoney() { } /** - * @return The amount designated as a tip. + * @return The amount designated as a tip for the seller's staff. + *

Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges.

*

This amount is specified in the smallest denomination of the applicable currency (for example, * US dollar amounts are specified in cents). For more information, see * Working with Monetary Amounts.

@@ -977,7 +978,8 @@ public Builder amountMoney(Money amountMoney) { } /** - *

The amount designated as a tip.

+ *

The amount designated as a tip for the seller's staff.

+ *

Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges.

*

This amount is specified in the smallest denomination of the applicable currency (for example, * US dollar amounts are specified in cents). For more information, see * Working with Monetary Amounts.

diff --git a/src/main/java/com/squareup/square/types/Subscription.java b/src/main/java/com/squareup/square/types/Subscription.java index 9a9ad2e4..a7068d72 100644 --- a/src/main/java/com/squareup/square/types/Subscription.java +++ b/src/main/java/com/squareup/square/types/Subscription.java @@ -62,6 +62,8 @@ public final class Subscription { private final Optional> phases; + private final Optional completedDate; + private final Map additionalProperties; private Subscription( @@ -84,6 +86,7 @@ private Subscription( Optional> actions, Optional monthlyBillingAnchorDate, Optional> phases, + Optional completedDate, Map additionalProperties) { this.id = id; this.locationId = locationId; @@ -104,6 +107,7 @@ private Subscription( this.actions = actions; this.monthlyBillingAnchorDate = monthlyBillingAnchorDate; this.phases = phases; + this.completedDate = completedDate; this.additionalProperties = additionalProperties; } @@ -298,6 +302,17 @@ public Optional> getPhases() { return phases; } + /** + * @return The YYYY-MM-DD-formatted date when the subscription enters a terminal state. + */ + @JsonIgnore + public Optional getCompletedDate() { + if (completedDate == null) { + return Optional.empty(); + } + return completedDate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("canceled_date") private Optional _getCanceledDate() { @@ -322,6 +337,12 @@ private Optional> _getActions() { return actions; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_date") + private Optional _getCompletedDate() { + return completedDate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -352,7 +373,8 @@ private boolean equalTo(Subscription other) { && source.equals(other.source) && actions.equals(other.actions) && monthlyBillingAnchorDate.equals(other.monthlyBillingAnchorDate) - && phases.equals(other.phases); + && phases.equals(other.phases) + && completedDate.equals(other.completedDate); } @java.lang.Override @@ -376,7 +398,8 @@ public int hashCode() { this.source, this.actions, this.monthlyBillingAnchorDate, - this.phases); + this.phases, + this.completedDate); } @java.lang.Override @@ -428,6 +451,8 @@ public static final class Builder { private Optional> phases = Optional.empty(); + private Optional completedDate = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -453,6 +478,7 @@ public Builder from(Subscription other) { actions(other.getActions()); monthlyBillingAnchorDate(other.getMonthlyBillingAnchorDate()); phases(other.getPhases()); + completedDate(other.getCompletedDate()); return this; } @@ -793,6 +819,31 @@ public Builder phases(List phases) { return this; } + /** + *

The YYYY-MM-DD-formatted date when the subscription enters a terminal state.

+ */ + @JsonSetter(value = "completed_date", nulls = Nulls.SKIP) + public Builder completedDate(Optional completedDate) { + this.completedDate = completedDate; + return this; + } + + public Builder completedDate(String completedDate) { + this.completedDate = Optional.ofNullable(completedDate); + return this; + } + + public Builder completedDate(Nullable completedDate) { + if (completedDate.isNull()) { + this.completedDate = null; + } else if (completedDate.isEmpty()) { + this.completedDate = Optional.empty(); + } else { + this.completedDate = Optional.of(completedDate.get()); + } + return this; + } + public Subscription build() { return new Subscription( id, @@ -814,6 +865,7 @@ public Subscription build() { actions, monthlyBillingAnchorDate, phases, + completedDate, additionalProperties); } } diff --git a/src/main/java/com/squareup/square/types/SubscriptionActionType.java b/src/main/java/com/squareup/square/types/SubscriptionActionType.java index bff1d428..3718d08b 100644 --- a/src/main/java/com/squareup/square/types/SubscriptionActionType.java +++ b/src/main/java/com/squareup/square/types/SubscriptionActionType.java @@ -18,6 +18,8 @@ public final class SubscriptionActionType { public static final SubscriptionActionType PAUSE = new SubscriptionActionType(Value.PAUSE, "PAUSE"); + public static final SubscriptionActionType COMPLETE = new SubscriptionActionType(Value.COMPLETE, "COMPLETE"); + private final Value value; private final String string; @@ -61,6 +63,8 @@ public T visit(Visitor visitor) { return visitor.visitSwapPlan(); case PAUSE: return visitor.visitPause(); + case COMPLETE: + return visitor.visitComplete(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -80,6 +84,8 @@ public static SubscriptionActionType valueOf(String value) { return SWAP_PLAN; case "PAUSE": return PAUSE; + case "COMPLETE": + return COMPLETE; default: return new SubscriptionActionType(Value.UNKNOWN, value); } @@ -96,6 +102,8 @@ public enum Value { CHANGE_BILLING_ANCHOR_DATE, + COMPLETE, + UNKNOWN } @@ -110,6 +118,8 @@ public interface Visitor { T visitChangeBillingAnchorDate(); + T visitComplete(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/squareup/square/types/SubscriptionStatus.java b/src/main/java/com/squareup/square/types/SubscriptionStatus.java index 3716895b..37d0d168 100644 --- a/src/main/java/com/squareup/square/types/SubscriptionStatus.java +++ b/src/main/java/com/squareup/square/types/SubscriptionStatus.java @@ -15,6 +15,8 @@ public final class SubscriptionStatus { public static final SubscriptionStatus ACTIVE = new SubscriptionStatus(Value.ACTIVE, "ACTIVE"); + public static final SubscriptionStatus COMPLETED = new SubscriptionStatus(Value.COMPLETED, "COMPLETED"); + public static final SubscriptionStatus PENDING = new SubscriptionStatus(Value.PENDING, "PENDING"); private final Value value; @@ -57,6 +59,8 @@ public T visit(Visitor visitor) { return visitor.visitPaused(); case ACTIVE: return visitor.visitActive(); + case COMPLETED: + return visitor.visitCompleted(); case PENDING: return visitor.visitPending(); case UNKNOWN: @@ -76,6 +80,8 @@ public static SubscriptionStatus valueOf(String value) { return PAUSED; case "ACTIVE": return ACTIVE; + case "COMPLETED": + return COMPLETED; case "PENDING": return PENDING; default: @@ -94,6 +100,8 @@ public enum Value { PAUSED, + COMPLETED, + UNKNOWN } @@ -108,6 +116,8 @@ public interface Visitor { T visitPaused(); + T visitCompleted(); + T visitUnknown(String unknownType); } }