diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 05fe582a..0366ce06 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119 management: - docChecksum: 4c7ff24a89748d4c18e2681acf6ddd61 + docChecksum: a7d2cc6eaed695425d169ea6bc55574c docVersion: 1.0.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 2.19.31 - configChecksum: 9bb5b1a2d09dfd99ab7055ead1e118dd + releaseVersion: 2.19.32 + configChecksum: cd6cbef0ef8064c877f855141e0b6d3c repoURL: https://github.com/gr4vy/gr4vy-java.git installationURL: https://github.com/gr4vy/gr4vy-java published: true persistentEdits: - generation_id: 797be6ac-e169-4ea2-b2b8-12f1246ebaf8 - pristine_commit_hash: 065d2cde4db979fc3924187d392b7d933bcd6ddf - pristine_tree_hash: b1740e56ef15b01b60f94fce45e8fc086ed0b84a + generation_id: 4f224a0b-1044-44ce-916f-63b3c0f744a4 + pristine_commit_hash: e71d15028642c693fc12fbe654e937c3c8f21731 + pristine_tree_hash: de7afbade58b9c4091fea613187d97a05ab440b9 features: java: additionalDependencies: 0.1.0 @@ -859,12 +859,16 @@ trackedFiles: pristine_git_object: 0944cd1a9127eec0e29ebaff2173d5ae6b4877ff docs/models/components/PaymentLink.md: id: 14e920f19b2f - last_write_checksum: sha1:7b145a6beec4396855d0a5ca5980a189882e3ce2 - pristine_git_object: fbd46b9d289c7f7394fbbc07953a72f849db2bea + last_write_checksum: sha1:ac79e6c90de147fc5a20701d4b471889e6c30d28 + pristine_git_object: c12f85e90f4bb27ddc80b6228441df12ebf0c281 docs/models/components/PaymentLinkCreate.md: id: abdc9863afe0 - last_write_checksum: sha1:8137d8de02f74098e0f0992da446f0096024cd7d - pristine_git_object: e4e6e2d2e2b6e32d810a9667a9f387bcf48d1e6e + last_write_checksum: sha1:d1fd0ea322a64b67e390549fe50781ed631bd448 + pristine_git_object: cc7d51ae1efcaa83c589cf93733ba6ed45df4ea1 + docs/models/components/PaymentLinkIntent.md: + id: 4795c108f046 + last_write_checksum: sha1:b3c36e21a54833f6e03d01ef9a16c3f3e92c2050 + pristine_git_object: 6204e28ab0af251b4058bfeed0b9452ba80e0ee6 docs/models/components/PaymentLinkStatus.md: id: 025fb96de5be last_write_checksum: sha1:30a7713941cf68d3af6bf2d1f43fda7d8d996586 @@ -2907,8 +2911,8 @@ trackedFiles: pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:fe999e1f3a61499bd524db0a9b7847203709b77a - pristine_git_object: 98d0734ed323a6434d0de2ccb39481f29119399d + last_write_checksum: sha1:6b980d1d65ad6ac895a2505b602b97ba39515ac0 + pristine_git_object: 3ef3c1a73e93954344247d6d8c3c2e0e597d0077 gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -3251,8 +3255,8 @@ trackedFiles: pristine_git_object: b50475cc7f6041d63c4569256e4ff1850b20d30b src/main/java/com/gr4vy/sdk/SDKConfiguration.java: id: 73a7edeaca45 - last_write_checksum: sha1:c0b7acb2c0298d7d8ec40cd8c6322d6199992d4a - pristine_git_object: e023991ec1fe46f013023b7dc0570e4ff546aa2f + last_write_checksum: sha1:07f03de968564740c33b6e033988aec520e311bc + pristine_git_object: 9785a3f39142cb48883538a6a0466776637b93b9 src/main/java/com/gr4vy/sdk/SecuritySource.java: id: 1b6add6b9b50 last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd @@ -4095,12 +4099,16 @@ trackedFiles: pristine_git_object: 139b7ed0c639da00bf5cd42697bc0bf1b45b6e45 src/main/java/com/gr4vy/sdk/models/components/PaymentLink.java: id: 35a81283c9d3 - last_write_checksum: sha1:0836cd90aa2abb75c17428d965cf65147fd1cd57 - pristine_git_object: 361659b75266b490275a0e9664ae6cb2e5d4da3a + last_write_checksum: sha1:49d4e51079563ba7b2acb9864360b9e25e78d3e6 + pristine_git_object: 70e7441a0303a52028838bb8105abe31d3c45e34 src/main/java/com/gr4vy/sdk/models/components/PaymentLinkCreate.java: id: f4795aff8cb9 - last_write_checksum: sha1:32836b657b487b421267efcef890bd3cadc58818 - pristine_git_object: 5859b34fb9405555a4cfd495a1422007707b615b + last_write_checksum: sha1:8381107c4a52bc6ee0ff980d6416df97b6a42f77 + pristine_git_object: d78d38828ccafebb945151895428f8cd0484e965 + src/main/java/com/gr4vy/sdk/models/components/PaymentLinkIntent.java: + id: 3a344b8bf07c + last_write_checksum: sha1:e549e4ffed5b9c1a0b8482d3fdd6c737bd816423 + pristine_git_object: a5e78c7fb3c6367e4c4bb67ad962e0a3119e26d7 src/main/java/com/gr4vy/sdk/models/components/PaymentLinkStatus.java: id: bd297c5e4aa2 last_write_checksum: sha1:2817e8cae2751ecb7a8aea9937433b20dfad689c @@ -12531,6 +12539,7 @@ examples: application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Java SDK Changes:\n* `gr4vy.paymentLinks.create()`: \n * `request.paymentLinkCreate.intent.enum(preferAuthorize)` **Added**\n * `response.intent.enum(preferAuthorize)` **Added**\n* `gr4vy.paymentLinks.list()`: `response.items[].intent.enum(preferAuthorize)` **Added**\n* `gr4vy.paymentLinks.get()`: `response.intent.enum(preferAuthorize)` **Added**\n" generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f9804c66..60346fbd 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 2.19.31 + version: 2.19.32 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter:5.10.0 - implementation:com.auth0:java-jwt:4.6.2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 90977768..2fd9f906 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,8 +9,8 @@ sources: - 1.0.0 openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:57225287c7073cd6dda55932f9c782849a642be57b2aad94ff74107db9ff744a - sourceBlobDigest: sha256:024eec69e215108fc15605d39e5469cdefe0bdbba7b755ee6c5c6ed448513b26 + sourceRevisionDigest: sha256:03844e85e8f2829cdd470af98d21f88ec843303e1c75088615fe625caf1d8f49 + sourceBlobDigest: sha256:d44ee9014a01dae37c219d064fc9dd173540f0f64cc84d33086bbb723145680a tags: - latest - 1.0.0 @@ -25,10 +25,10 @@ targets: java: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:57225287c7073cd6dda55932f9c782849a642be57b2aad94ff74107db9ff744a - sourceBlobDigest: sha256:024eec69e215108fc15605d39e5469cdefe0bdbba7b755ee6c5c6ed448513b26 + sourceRevisionDigest: sha256:03844e85e8f2829cdd470af98d21f88ec843303e1c75088615fe625caf1d8f49 + sourceBlobDigest: sha256:d44ee9014a01dae37c219d064fc9dd173540f0f64cc84d33086bbb723145680a codeSamplesNamespace: openapi-java-code-samples - codeSamplesRevisionDigest: sha256:0eaec266231563c0638e90fb5ef454b5002192b460edbe02d2790251cd4c29be + codeSamplesRevisionDigest: sha256:a13b8b622f4485cc29061264f0d7b2a8787409a59c3a0c43c36febfbdff80b16 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 583ad66d..9655f899 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.gr4vy:sdk:2.19.31' +implementation 'com.gr4vy:sdk:2.19.32' ``` Maven: @@ -67,7 +67,7 @@ Maven: com.gr4vy sdk - 2.19.31 + 2.19.32 ``` diff --git a/RELEASES.md b/RELEASES.md index 4edf2a92..260e9746 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2478,4 +2478,14 @@ Based on: ### Generated - [java v2.19.31] . ### Releases -- [Maven Central v2.19.31] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.19.31 - . \ No newline at end of file +- [Maven Central v2.19.31] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.19.31 - . + +## 2026-11-11 12:09:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.19.32] . +### Releases +- [Maven Central v2.19.32] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.19.32 - . \ No newline at end of file diff --git a/docs/models/components/PaymentLink.md b/docs/models/components/PaymentLink.md index fbd46b9d..c12f85e9 100644 --- a/docs/models/components/PaymentLink.md +++ b/docs/models/components/PaymentLink.md @@ -22,7 +22,7 @@ | `amount` | *long* | :heavy_check_mark: | The amount for the payment link. | 1299 | | `country` | *String* | :heavy_check_mark: | The country code for the payment link. | **Example 1:** DE
**Example 2:** GB
**Example 3:** US | | `currency` | *String* | :heavy_check_mark: | The currency code for the payment link. | **Example 1:** EUR
**Example 2:** GBP
**Example 3:** USD | -| `intent` | [TransactionIntent](../../models/components/TransactionIntent.md) | :heavy_check_mark: | N/A | | +| `intent` | [PaymentLinkIntent](../../models/components/PaymentLinkIntent.md) | :heavy_check_mark: | N/A | | | `returnUrl` | *JsonNullable\* | :heavy_minus_sign: | The return URL after payment completion. | https://merchant.example.com/return | | `cartItems` | List\<[CartItem](../../models/components/CartItem.md)> | :heavy_check_mark: | The cart items for the payment link. | [
{
"amount": {
"currency": "USD",
"value": 500
},
"name": "Widget",
"quantity": 2
}
] | | `airline` | [Optional\](../../models/components/Airline.md) | :heavy_check_mark: | The airline addendum data which describes the airline booking associated with this payment link. | | diff --git a/docs/models/components/PaymentLinkCreate.md b/docs/models/components/PaymentLinkCreate.md index e4e6e2d2..cc7d51ae 100644 --- a/docs/models/components/PaymentLinkCreate.md +++ b/docs/models/components/PaymentLinkCreate.md @@ -21,7 +21,7 @@ | `amount` | *long* | :heavy_check_mark: | The amount for the payment link. | 1299 | | `country` | *String* | :heavy_check_mark: | The country code for the payment link. | **Example 1:** DE
**Example 2:** GB
**Example 3:** US | | `currency` | *String* | :heavy_check_mark: | The currency code for the payment link. | **Example 1:** EUR
**Example 2:** GBP
**Example 3:** USD | -| `intent` | [Optional\](../../models/components/TransactionIntent.md) | :heavy_minus_sign: | N/A | | +| `intent` | [Optional\](../../models/components/PaymentLinkIntent.md) | :heavy_minus_sign: | N/A | | | `returnUrl` | *JsonNullable\* | :heavy_minus_sign: | The return URL after payment completion. | https://merchant.example.com/return | | `cartItems` | List\<[CartItem](../../models/components/CartItem.md)> | :heavy_minus_sign: | The cart items for the payment link. | | | `airline` | [JsonNullable\](../../models/components/Airline.md) | :heavy_minus_sign: | The airline addendum data which describes the airline booking associated with this payment link. | | diff --git a/docs/models/components/PaymentLinkIntent.md b/docs/models/components/PaymentLinkIntent.md new file mode 100644 index 00000000..6204e28a --- /dev/null +++ b/docs/models/components/PaymentLinkIntent.md @@ -0,0 +1,21 @@ +# PaymentLinkIntent + +## Example Usage + +```java +import com.gr4vy.sdk.models.components.PaymentLinkIntent; + +PaymentLinkIntent value = PaymentLinkIntent.AUTHORIZE; + +// Open enum: use .of() to create instances from custom string values +PaymentLinkIntent custom = PaymentLinkIntent.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `AUTHORIZE` | authorize | +| `CAPTURE` | capture | +| `PREFER_AUTHORIZE` | prefer_authorize | \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 98d0734e..3ef3c1a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.gr4vy artifactId=sdk -version=2.19.31 +version=2.19.32 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java index e023991e..9785a3f3 100644 --- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java +++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java @@ -22,7 +22,7 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "1.0.0"; - public static final String SDK_VERSION = "2.19.31"; + public static final String SDK_VERSION = "2.19.32"; public static final String GEN_VERSION = "2.960.8"; private static final String BASE_PACKAGE = "com.gr4vy.sdk"; public static final String USER_AGENT = diff --git a/src/main/java/com/gr4vy/sdk/models/components/PaymentLink.java b/src/main/java/com/gr4vy/sdk/models/components/PaymentLink.java index 361659b7..70e7441a 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/PaymentLink.java +++ b/src/main/java/com/gr4vy/sdk/models/components/PaymentLink.java @@ -141,7 +141,7 @@ public class PaymentLink { @JsonProperty("intent") - private TransactionIntent intent; + private PaymentLinkIntent intent; /** * The return URL after payment completion. @@ -253,7 +253,7 @@ public PaymentLink( @JsonProperty("amount") long amount, @JsonProperty("country") String country, @JsonProperty("currency") String currency, - @JsonProperty("intent") TransactionIntent intent, + @JsonProperty("intent") PaymentLinkIntent intent, @JsonProperty("return_url") JsonNullable returnUrl, @JsonProperty("cart_items") Optional> cartItems, @JsonProperty("airline") Optional airline, @@ -339,7 +339,7 @@ public PaymentLink( long amount, String country, String currency, - TransactionIntent intent, + PaymentLinkIntent intent, TransactionPaymentSource paymentSource, OffsetDateTime createdAt, OffsetDateTime updatedAt, @@ -495,7 +495,7 @@ public String currency() { } @JsonIgnore - public TransactionIntent intent() { + public PaymentLinkIntent intent() { return intent; } @@ -862,7 +862,7 @@ public PaymentLink withCurrency(String currency) { return this; } - public PaymentLink withIntent(TransactionIntent intent) { + public PaymentLink withIntent(PaymentLinkIntent intent) { Utils.checkNotNull(intent, "intent"); this.intent = intent; return this; @@ -1216,7 +1216,7 @@ public final static class Builder { private String currency; - private TransactionIntent intent; + private PaymentLinkIntent intent; private JsonNullable returnUrl = JsonNullable.undefined(); @@ -1510,7 +1510,7 @@ public Builder currency(String currency) { } - public Builder intent(TransactionIntent intent) { + public Builder intent(PaymentLinkIntent intent) { Utils.checkNotNull(intent, "intent"); this.intent = intent; return this; diff --git a/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkCreate.java b/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkCreate.java index 5859b34f..d78d3882 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkCreate.java +++ b/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkCreate.java @@ -137,7 +137,7 @@ public class PaymentLinkCreate { @JsonInclude(Include.NON_ABSENT) @JsonProperty("intent") - private Optional intent; + private Optional intent; /** * The return URL after payment completion. @@ -215,7 +215,7 @@ public PaymentLinkCreate( @JsonProperty("amount") long amount, @JsonProperty("country") String country, @JsonProperty("currency") String currency, - @JsonProperty("intent") Optional intent, + @JsonProperty("intent") Optional intent, @JsonProperty("return_url") JsonNullable returnUrl, @JsonProperty("cart_items") JsonNullable> cartItems, @JsonProperty("airline") JsonNullable airline, @@ -424,8 +424,8 @@ public String currency() { @SuppressWarnings("unchecked") @JsonIgnore - public Optional intent() { - return (Optional) intent; + public Optional intent() { + return (Optional) intent; } /** @@ -764,14 +764,14 @@ public PaymentLinkCreate withCurrency(String currency) { return this; } - public PaymentLinkCreate withIntent(TransactionIntent intent) { + public PaymentLinkCreate withIntent(PaymentLinkIntent intent) { Utils.checkNotNull(intent, "intent"); this.intent = Optional.ofNullable(intent); return this; } - public PaymentLinkCreate withIntent(Optional intent) { + public PaymentLinkCreate withIntent(Optional intent) { Utils.checkNotNull(intent, "intent"); this.intent = intent; return this; @@ -1043,7 +1043,7 @@ public final static class Builder { private String currency; - private Optional intent = Optional.empty(); + private Optional intent = Optional.empty(); private JsonNullable returnUrl = JsonNullable.undefined(); @@ -1343,13 +1343,13 @@ public Builder currency(String currency) { } - public Builder intent(TransactionIntent intent) { + public Builder intent(PaymentLinkIntent intent) { Utils.checkNotNull(intent, "intent"); this.intent = Optional.ofNullable(intent); return this; } - public Builder intent(Optional intent) { + public Builder intent(Optional intent) { Utils.checkNotNull(intent, "intent"); this.intent = intent; return this; diff --git a/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkIntent.java b/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkIntent.java new file mode 100644 index 00000000..a5e78c7f --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/PaymentLinkIntent.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +public class PaymentLinkIntent { + + public static final PaymentLinkIntent AUTHORIZE = new PaymentLinkIntent("authorize"); + public static final PaymentLinkIntent CAPTURE = new PaymentLinkIntent("capture"); + public static final PaymentLinkIntent PREFER_AUTHORIZE = new PaymentLinkIntent("prefer_authorize"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PaymentLinkIntent(String value) { + this.value = value; + } + + /** + * Returns a PaymentLinkIntent with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PaymentLinkIntent + */ + @JsonCreator + public static PaymentLinkIntent of(String value) { + synchronized (PaymentLinkIntent.class) { + return values.computeIfAbsent(value, v -> new PaymentLinkIntent(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PaymentLinkIntent other = (PaymentLinkIntent) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PaymentLinkIntent [value=" + value + "]"; + } + + // return an array just like an enum + public static PaymentLinkIntent[] values() { + synchronized (PaymentLinkIntent.class) { + return values.values().toArray(new PaymentLinkIntent[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("authorize", AUTHORIZE); + map.put("capture", CAPTURE); + map.put("prefer_authorize", PREFER_AUTHORIZE); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("authorize", PaymentLinkIntentEnum.AUTHORIZE); + map.put("capture", PaymentLinkIntentEnum.CAPTURE); + map.put("prefer_authorize", PaymentLinkIntentEnum.PREFER_AUTHORIZE); + return map; + } + + + public enum PaymentLinkIntentEnum { + + AUTHORIZE("authorize"), + CAPTURE("capture"), + PREFER_AUTHORIZE("prefer_authorize"),; + + private final String value; + + private PaymentLinkIntentEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} +