From 8dd098a5c97c856ac21f3a1c3543fd1924e99814 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:49:39 +0000 Subject: [PATCH 1/3] SDK regeneration --- README.md | 2 +- reference.md | 5449 +++++++++++++++++ .../resources/applepay/ApplePayClient.java | 8 + .../applepay/AsyncApplePayClient.java | 8 + .../merchant/AsyncMerchantClient.java | 58 + .../merchant/AsyncRawMerchantClient.java | 262 + .../applepay/merchant/MerchantClient.java | 56 + .../applepay/merchant/RawMerchantClient.java | 206 + .../ApplePayMerchantRegisterRequest.java | 96 + .../requests/CreateReactorRequest.java | 62 +- .../requests/PatchReactorRequest.java | 56 +- .../requests/UpdateReactorRequest.java | 62 +- .../tokens/AsyncRawTokensClient.java | 219 +- .../resources/tokens/AsyncTokensClient.java | 37 +- .../resources/tokens/RawTokensClient.java | 186 +- .../resources/tokens/TokensClient.java | 37 +- .../tokens/requests/TokensListRequest.java | 200 - .../basistheory/types/AccountUpdaterJob.java | 104 +- .../types/ApplePayCreateResponse.java | 13 +- ...kenResponse.java => ApplePayMerchant.java} | 129 +- .../com/basistheory/types/ApplePayToken.java | 30 +- .../ClientEncryptionKeyMetadataResponse.java | 36 +- .../types/ClientEncryptionKeyResponse.java | 42 +- .../java/com/basistheory/types/GetTokens.java | 194 - .../types/GooglePayCreateResponse.java | 12 +- .../types/GooglePayCreateTokenResponse.java | 275 - .../com/basistheory/types/GooglePayToken.java | 30 +- .../java/com/basistheory/types/Proxy.java | 26 + .../types/ProxyTransformOptions.java | 55 +- .../java/com/basistheory/types/Reactor.java | 80 +- .../com/basistheory/types/RuntimeOptions.java | 96 + .../types/ThreeDsAuthentication.java | 26 + .../basistheory/types/TokenPaginatedList.java | 119 - 33 files changed, 6874 insertions(+), 1397 deletions(-) create mode 100644 reference.md create mode 100644 src/main/java/com/basistheory/resources/applepay/merchant/AsyncMerchantClient.java create mode 100644 src/main/java/com/basistheory/resources/applepay/merchant/AsyncRawMerchantClient.java create mode 100644 src/main/java/com/basistheory/resources/applepay/merchant/MerchantClient.java create mode 100644 src/main/java/com/basistheory/resources/applepay/merchant/RawMerchantClient.java create mode 100644 src/main/java/com/basistheory/resources/applepay/merchant/requests/ApplePayMerchantRegisterRequest.java delete mode 100644 src/main/java/com/basistheory/resources/tokens/requests/TokensListRequest.java rename src/main/java/com/basistheory/types/{ApplePayCreateTokenResponse.java => ApplePayMerchant.java} (55%) delete mode 100644 src/main/java/com/basistheory/types/GetTokens.java delete mode 100644 src/main/java/com/basistheory/types/GooglePayCreateTokenResponse.java create mode 100644 src/main/java/com/basistheory/types/RuntimeOptions.java delete mode 100644 src/main/java/com/basistheory/types/TokenPaginatedList.java diff --git a/README.md b/README.md index 6d66187..2b95013 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FBasis-Theory%2Fjava-sdk) [![Maven Central](https://img.shields.io/maven-central/v/dev.basis-theory/basis-theory-java-sdk)](https://central.sonatype.com/artifact/dev.basis-theory/basis-theory-java-sdk) -The BasisTheory Java library provides convenient access to the BasisTheory API from Java. +The BasisTheory Java library provides convenient access to the BasisTheory APIs from Java. ## Documentation diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..3fa92df --- /dev/null +++ b/reference.md @@ -0,0 +1,5449 @@ +# Reference +## Applications +
client.applications.list() -> ApplicationPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().list( + ApplicationsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `Optional` + +
+
+ +
+
+ +**type:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.applications.create(request) -> Application +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().create( + CreateApplicationRequest + .builder() + .name("name") + .type("type") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**type:** `String` + +
+
+ +
+
+ +**permissions:** `Optional>` + +
+
+ +
+
+ +**rules:** `Optional>` + +
+
+ +
+
+ +**createKey:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.applications.get(id) -> Application +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applications.update(id, request) -> Application +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().update( + "id", + UpdateApplicationRequest + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**permissions:** `Optional>` + +
+
+ +
+
+ +**rules:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.applications.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applications.getByKey() -> Application +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applications().getByKey(); +``` +
+
+
+
+ + +
+
+
+ +## ApplicationKeys +
client.applicationKeys.list(id) -> List<ApplicationKey> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationKeys().list( + "id", + ApplicationKeysListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**id:** `Optional` + +
+
+ +
+
+ +**type:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.applicationKeys.create(id) -> ApplicationKey +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationKeys().create("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applicationKeys.get(id, keyId) -> ApplicationKey +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationKeys().get("id", "keyId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**keyId:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applicationKeys.delete(id, keyId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationKeys().delete("id", "keyId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**keyId:** `String` + +
+
+
+
+ + +
+
+
+ +## ApplicationTemplates +
client.applicationTemplates.list() -> List<ApplicationTemplate> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationTemplates().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.applicationTemplates.get(id) -> ApplicationTemplate +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applicationTemplates().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## ApplePay +
client.applePay.create(request) -> ApplePayCreateResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().create( + ApplePayCreateRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**expiresAt:** `Optional` + +
+
+ +
+
+ +**applePaymentData:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.applePay.get(id) -> ApplePayToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applePay.delete(id) -> String +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## GooglePay +
client.googlePay.create(request) -> GooglePayCreateResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.googlePay().create( + GooglePayCreateRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**expiresAt:** `Optional` + +
+
+ +
+
+ +**googlePaymentData:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.googlePay.get(id) -> GooglePayToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.googlePay().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.googlePay.delete(id) -> String +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.googlePay().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## Documents +
client.documents.upload(request) -> Document +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().upload( + DocumentsUploadRequest + .builder() + .build() +); +``` +
+
+
+
+ + +
+
+
+ +
client.documents.get(id) -> Document +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## Tokens +
client.tokens.detokenize(request) -> Object +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().detokenize(new +HashMap() {{put("key", "value"); +}}); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Object` + +
+
+
+
+ + +
+
+
+ +
client.tokens.tokenize(request) -> Object +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().tokenize(new +HashMap() {{put("key", "value"); +}}); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Object` + +
+
+
+
+ + +
+
+
+ +
client.tokens.get(id) -> Token +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tokens.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tokens.update(id, request) -> Token +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().update( + "id", + UpdateTokenRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**data:** `Optional` + + + + +
+
+ +**privacy:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>>` + +
+
+ +
+
+ +**searchIndexes:** `Optional>` + +
+
+ +
+
+ +**fingerprintExpression:** `Optional` + +
+
+ +
+
+ +**mask:** `Optional` + + + + +
+
+ +**expiresAt:** `Optional` + +
+
+ +
+
+ +**deduplicateToken:** `Optional` + +
+
+ +
+
+ +**containers:** `Optional>` + +
+
+ + + + + + + + +
client.tokens.create(request) -> Token +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().create( + CreateTokenRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateTokenRequest` + +
+
+
+
+ + +
+
+
+ +
client.tokens.listV2() -> TokenCursorPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().listV2( + TokensListV2Request + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**type:** `Optional` + +
+
+ +
+
+ +**container:** `Optional` + +
+
+ +
+
+ +**fingerprint:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>>` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.tokens.searchV2(request) -> TokenCursorPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokens().searchV2( + SearchTokensRequestV2 + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**query:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Enrichments +
client.enrichments.bankAccountVerify(request) -> BankVerificationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.enrichments().bankAccountVerify( + BankVerificationRequest + .builder() + .tokenId("token_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tokenId:** `String` + +
+
+ +
+
+ +**countryCode:** `Optional` + +
+
+ +
+
+ +**routingNumber:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.enrichments.getcarddetails() -> CardDetailsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.enrichments().getcarddetails( + EnrichmentsGetCardDetailsRequest + .builder() + .bin("bin") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**bin:** `String` + +
+
+
+
+ + +
+
+
+ +## Keys +
client.keys.list() -> List<ClientEncryptionKeyMetadataResponse> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.keys.create(request) -> ClientEncryptionKeyResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().create( + ClientEncryptionKeyRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**expiresAt:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.keys.get(id) -> ClientEncryptionKeyMetadataResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.keys.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## Logs +
client.logs.list() -> LogPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().list( + LogsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**entityType:** `Optional` + +
+
+ +
+
+ +**entityId:** `Optional` + +
+
+ +
+
+ +**startDate:** `Optional` + +
+
+ +
+
+ +**endDate:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.logs.getEntityTypes() -> List<LogEntityType> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().getEntityTypes(); +``` +
+
+
+
+ + +
+
+
+ +## NetworkTokens +
client.networkTokens.create(request) -> NetworkToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().create( + CreateNetworkTokenRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**data:** `Optional` + +
+
+ +
+
+ +**tokenId:** `Optional` + +
+
+ +
+
+ +**tokenIntentId:** `Optional` + +
+
+ +
+
+ +**cardholderInfo:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.networkTokens.cryptogram(id) -> NetworkTokenCryptogram +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().cryptogram("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.networkTokens.get(id) -> NetworkToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.networkTokens.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.networkTokens.suspend(id) -> NetworkToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().suspend("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.networkTokens.resume(id) -> NetworkToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkTokens().resume("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## Permissions +
client.permissions.list() -> List<Permission> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.permissions().list( + PermissionsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**applicationType:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Proxies +
client.proxies.list() -> ProxyPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().list( + ProxiesListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `Optional` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.proxies.create(request) -> Proxy +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().create( + CreateProxyRequest + .builder() + .name("name") + .destinationUrl("destination_url") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**destinationUrl:** `String` + +
+
+ +
+
+ +**requestReactorId:** `Optional` + +
+
+ +
+
+ +**responseReactorId:** `Optional` + +
+
+ +
+
+ +**requestTransform:** `Optional` + +
+
+ +
+
+ +**responseTransform:** `Optional` + +
+
+ +
+
+ +**requestTransforms:** `Optional>` + +
+
+ +
+
+ +**responseTransforms:** `Optional>` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**requireAuth:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.proxies.get(id) -> Proxy +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.proxies.update(id, request) -> Proxy +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().update( + "id", + UpdateProxyRequest + .builder() + .name("name") + .destinationUrl("destination_url") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**destinationUrl:** `String` + +
+
+ +
+
+ +**requestReactorId:** `Optional` + +
+
+ +
+
+ +**responseReactorId:** `Optional` + +
+
+ +
+
+ +**requestTransform:** `Optional` + +
+
+ +
+
+ +**responseTransform:** `Optional` + +
+
+ +
+
+ +**requestTransforms:** `Optional>` + +
+
+ +
+
+ +**responseTransforms:** `Optional>` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**requireAuth:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.proxies.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.proxies.patch(id, request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.proxies().patch( + "id", + PatchProxyRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**destinationUrl:** `Optional` + +
+
+ +
+
+ +**requestTransform:** `Optional` + +
+
+ +
+
+ +**responseTransform:** `Optional` + +
+
+ +
+
+ +**requestTransforms:** `Optional>` + +
+
+ +
+
+ +**responseTransforms:** `Optional>` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**requireAuth:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Reactors +
client.reactors.list() -> ReactorPaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().list( + ReactorsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `Optional` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.reactors.create(request) -> Reactor +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().create( + CreateReactorRequest + .builder() + .name("name") + .code("code") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**code:** `String` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**runtime:** `Optional` + +
+
+ +
+
+ +**options:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.reactors.get(id) -> Reactor +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.reactors.update(id, request) -> Reactor +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().update( + "id", + UpdateReactorRequest + .builder() + .name("name") + .code("code") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**code:** `String` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**runtime:** `Optional` + +
+
+ +
+
+ +**options:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.reactors.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.reactors.patch(id, request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().patch( + "id", + PatchReactorRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**application:** `Optional` + +
+
+ +
+
+ +**code:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional>>` + +
+
+ +
+
+ +**runtime:** `Optional` + +
+
+ +
+
+ +**options:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.reactors.react(id, request) -> ReactResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().react( + "id", + ReactRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**args:** `Optional` + + + + +
+
+ +**callbackUrl:** `Optional` + +
+
+ + + + + + + + +
client.reactors.reactAsync(id, request) -> AsyncReactResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().reactAsync( + "id", + ReactRequestAsync + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**args:** `Optional` + + + + + + + + + + + +## Roles +
client.roles.list() -> List<Role> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().list(); +``` +
+
+
+
+ + +
+
+
+ +## Sessions +
client.sessions.create() -> CreateSessionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.sessions().create(); +``` +
+
+
+
+ + +
+
+
+ +
client.sessions.authorize(request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.sessions().authorize( + AuthorizeSessionRequest + .builder() + .nonce("nonce") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**nonce:** `String` + +
+
+ +
+
+ +**expiresAt:** `Optional` + +
+
+ +
+
+ +**permissions:** `Optional>` + +
+
+ +
+
+ +**rules:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## TokenIntents +
client.tokenIntents.get(id) -> TokenIntent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenIntents().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tokenIntents.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenIntents().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tokenIntents.create(request) -> CreateTokenIntentResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenIntents().create( + CreateTokenIntentRequest + .builder() + .type("x") + .data(new + HashMap() {{put("key", "value"); + }}) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**type:** `String` + +
+
+ +
+
+ +**data:** `Object` + +
+
+
+
+ + +
+
+
+ +## Webhooks +
client.webhooks.ping() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Simple endpoint that can be utilized to verify the application is running +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().ping(); +``` +
+
+
+
+ + +
+
+
+ +
client.webhooks.get(id) -> Webhook +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the webhook +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.update(id, request) -> Webhook +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a new webhook +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().update( + "id", + UpdateWebhookRequest + .builder() + .name("webhook-update") + .url("http://www.example.com") + .events( + new ArrayList( + Arrays.asList("token:created") + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `String` — The name of the webhook + +
+
+ +
+
+ +**url:** `String` — The URL to which the webhook will send events + +
+
+ +
+
+ +**notifyEmail:** `Optional` — The email address to use for management notification events. Ie: webhook disabled + +
+
+ +
+
+ +**events:** `List` — An array of event types that the webhook will listen for + +
+
+
+
+ + +
+
+
+ +
client.webhooks.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a new webhook +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.list() -> WebhookList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the configured webhooks +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.webhooks.create(request) -> Webhook +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new webhook +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().create( + CreateWebhookRequest + .builder() + .name("webhook-create") + .url("http://www.example.com") + .events( + new ArrayList( + Arrays.asList("token:created") + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of the webhook + +
+
+ +
+
+ +**url:** `String` — The URL to which the webhook will send events + +
+
+ +
+
+ +**notifyEmail:** `Optional` — The email address to use for management notification events. Ie: webhook disabled + +
+
+ +
+
+ +**events:** `List` — An array of event types that the webhook will listen for + +
+
+
+
+ + +
+
+
+ +## AccountUpdater Jobs +
client.accountUpdater.jobs.get(id) -> AccountUpdaterJob +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account updater batch job +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.accountUpdater().jobs().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.accountUpdater.jobs.list() -> AccountUpdaterJobList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of account updater batch jobs +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.accountUpdater().jobs().list( + JobsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**size:** `Optional` — The maximum number of jobs to return + +
+
+ +
+
+ +**start:** `Optional` — Cursor for pagination + +
+
+
+
+ + +
+
+
+ +
client.accountUpdater.jobs.create() -> AccountUpdaterJob +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the created account updater batch job +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.accountUpdater().jobs().create(); +``` +
+
+
+
+ + +
+
+
+ +## AccountUpdater RealTime +
client.accountUpdater.realTime.invoke(request) -> AccountUpdaterRealTimeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the update result +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.accountUpdater().realTime().invoke( + AccountUpdaterRealTimeRequest + .builder() + .tokenId("9a420b15-ddfe-4793-9466-48f53520e47c") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tokenId:** `String` — Card Token identifier + +
+
+ +
+
+ +**expirationYear:** `Optional` — The 4-digit expiration year of the account number. Not required if the card token already stores this value. + +
+
+ +
+
+ +**expirationMonth:** `Optional` — The 2-digit expiration month of the account number. Not required if the card token already stores this value. + +
+
+ +
+
+ +**deduplicateToken:** `Optional` — Whether deduplication should be enabled when creating the new token. Uses the value of the Deduplicate Tokens setting on the tenant if not set. + +
+
+
+
+ + +
+
+
+ +## ApplePay Merchant +
client.applePay.merchant.get(id) -> ApplePayToken +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().merchant().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applePay.merchant.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().merchant().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applePay.merchant.create(request) -> ApplePayMerchant +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().merchant().create( + ApplePayMerchantRegisterRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**merchantIdentifier:** `Optional` + +
+
+
+
+ + +
+
+
+ +## ApplePay Domain +
client.applePay.domain.deregister(request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().domain().deregister( + ApplePayDomainDeregistrationRequest + .builder() + .domain("domain") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**domain:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applePay.domain.get() -> ApplePayDomainRegistrationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().domain().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.applePay.domain.register(request) -> ApplePayDomainRegistrationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().domain().register( + ApplePayDomainRegistrationRequest + .builder() + .domain("domain") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**domain:** `String` + +
+
+
+
+ + +
+
+
+ +
client.applePay.domain.registerAll(request) -> ApplePayDomainRegistrationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().domain().registerAll( + ApplePayDomainRegistrationListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**domains:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## ApplePay Session +
client.applePay.session.create(request) -> String +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.applePay().session().create( + ApplePaySessionRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**validationUrl:** `Optional` + +
+
+ +
+
+ +**displayName:** `Optional` + +
+
+ +
+
+ +**domain:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Documents Data +
client.documents.data.get(documentId) -> InputStream +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().data().get("documentId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**documentId:** `String` + +
+
+
+
+ + +
+
+
+ +## Reactors Results +
client.reactors.results.get(id, requestId) -> Object +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.reactors().results().get("id", "requestId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**requestId:** `String` + +
+
+
+
+ + +
+
+
+ +## Tenants Connections +
client.tenants.connections.create(request) -> CreateTenantConnectionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().connections().create( + CreateTenantConnectionRequest + .builder() + .strategy("strategy") + .options( + TenantConnectionOptions + .builder() + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**strategy:** `String` + +
+
+ +
+
+ +**options:** `TenantConnectionOptions` + +
+
+
+
+ + +
+
+
+ +
client.tenants.connections.delete() -> CreateTenantConnectionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().connections().delete(); +``` +
+
+
+
+ + +
+
+
+ +## Tenants Invitations +
client.tenants.invitations.list() -> TenantInvitationResponsePaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().invitations().list( + InvitationsListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**status:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.tenants.invitations.create(request) -> TenantInvitationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().invitations().create( + CreateTenantInvitationRequest + .builder() + .email("email") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**email:** `String` + +
+
+ +
+
+ +**role:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.tenants.invitations.resend(invitationId) -> TenantInvitationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().invitations().resend("invitationId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**invitationId:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tenants.invitations.get(invitationId) -> TenantInvitationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().invitations().get("invitationId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**invitationId:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tenants.invitations.delete(invitationId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().invitations().delete("invitationId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**invitationId:** `String` + +
+
+
+
+ + +
+
+
+ +## Tenants Members +
client.tenants.members.list() -> TenantMemberResponsePaginatedList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().members().list( + MembersListRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `Optional` + +
+
+ +
+
+ +**page:** `Optional` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**size:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.tenants.members.update(memberId, request) -> TenantMemberResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().members().update( + "memberId", + UpdateTenantMemberRequest + .builder() + .role("role") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**memberId:** `String` + +
+
+ +
+
+ +**role:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tenants.members.delete(memberId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().members().delete("memberId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**memberId:** `String` + +
+
+
+
+ + +
+
+
+ +## Tenants Owner +
client.tenants.owner.get() -> TenantMemberResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().owner().get(); +``` +
+
+
+
+ + +
+
+
+ +## Tenants Self +
client.tenants.self.getUsageReports() -> TenantUsageReport +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().self().getUsageReports(); +``` +
+
+
+
+ + +
+
+
+ +
client.tenants.self.get() -> Tenant +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().self().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.tenants.self.update(request) -> Tenant +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().self().update( + UpdateTenantRequest + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**settings:** `Optional>>` + +
+
+
+
+ + +
+
+
+ +
client.tenants.self.delete() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().self().delete(); +``` +
+
+
+
+ + +
+
+
+ +## Threeds Sessions +
client.threeds.sessions.create(request) -> CreateThreeDsSessionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.threeds().sessions().create( + CreateThreeDsSessionRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**pan:** `Optional` + +
+
+ +
+
+ +**tokenId:** `Optional` + +
+
+ +
+
+ +**tokenIntentId:** `Optional` + +
+
+ +
+
+ +**type:** `Optional` + +
+
+ +
+
+ +**device:** `Optional` + +
+
+ +
+
+ +**webChallengeMode:** `Optional` + +
+
+ +
+
+ +**deviceInfo:** `Optional` + +
+
+ +
+
+ +**authenticationRequest:** `Optional` + +
+
+ +
+
+ +**callbackUrls:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.threeds.sessions.authenticate(sessionId, request) -> ThreeDsAuthentication +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.threeds().sessions().authenticate( + "sessionId", + AuthenticateThreeDsSessionRequest + .builder() + .authenticationCategory("authentication_category") + .authenticationType("authentication_type") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**sessionId:** `String` + +
+
+ +
+
+ +**request:** `AuthenticateThreeDsSessionRequest` + +
+
+
+
+ + +
+
+
+ +
client.threeds.sessions.getChallengeResult(sessionId) -> ThreeDsAuthentication +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.threeds().sessions().getChallengeResult("sessionId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**sessionId:** `String` + +
+
+
+
+ + +
+
+
+ +
client.threeds.sessions.get(id) -> ThreeDsSession +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.threeds().sessions().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +## Webhooks Events +
client.webhooks.events.list() -> List<String> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Return a list of available event types +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.webhooks().events().list(); +``` +
+
+
+
+ + +
+
+
diff --git a/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java index d8e763f..5bc47d2 100644 --- a/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java @@ -7,6 +7,7 @@ import com.basistheory.core.RequestOptions; import com.basistheory.core.Suppliers; import com.basistheory.resources.applepay.domain.DomainClient; +import com.basistheory.resources.applepay.merchant.MerchantClient; import com.basistheory.resources.applepay.requests.ApplePayCreateRequest; import com.basistheory.resources.applepay.session.SessionClient; import com.basistheory.types.ApplePayCreateResponse; @@ -18,6 +19,8 @@ public class ApplePayClient { private final RawApplePayClient rawClient; + protected final Supplier merchantClient; + protected final Supplier domainClient; protected final Supplier sessionClient; @@ -25,6 +28,7 @@ public class ApplePayClient { public ApplePayClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawApplePayClient(clientOptions); + this.merchantClient = Suppliers.memoize(() -> new MerchantClient(clientOptions)); this.domainClient = Suppliers.memoize(() -> new DomainClient(clientOptions)); this.sessionClient = Suppliers.memoize(() -> new SessionClient(clientOptions)); } @@ -64,6 +68,10 @@ public String delete(String id, RequestOptions requestOptions) { return this.rawClient.delete(id, requestOptions).body(); } + public MerchantClient merchant() { + return this.merchantClient.get(); + } + public DomainClient domain() { return this.domainClient.get(); } diff --git a/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java index a3df1dc..8187f69 100644 --- a/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java @@ -7,6 +7,7 @@ import com.basistheory.core.RequestOptions; import com.basistheory.core.Suppliers; import com.basistheory.resources.applepay.domain.AsyncDomainClient; +import com.basistheory.resources.applepay.merchant.AsyncMerchantClient; import com.basistheory.resources.applepay.requests.ApplePayCreateRequest; import com.basistheory.resources.applepay.session.AsyncSessionClient; import com.basistheory.types.ApplePayCreateResponse; @@ -19,6 +20,8 @@ public class AsyncApplePayClient { private final AsyncRawApplePayClient rawClient; + protected final Supplier merchantClient; + protected final Supplier domainClient; protected final Supplier sessionClient; @@ -26,6 +29,7 @@ public class AsyncApplePayClient { public AsyncApplePayClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawApplePayClient(clientOptions); + this.merchantClient = Suppliers.memoize(() -> new AsyncMerchantClient(clientOptions)); this.domainClient = Suppliers.memoize(() -> new AsyncDomainClient(clientOptions)); this.sessionClient = Suppliers.memoize(() -> new AsyncSessionClient(clientOptions)); } @@ -66,6 +70,10 @@ public CompletableFuture delete(String id, RequestOptions requestOptions return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); } + public AsyncMerchantClient merchant() { + return this.merchantClient.get(); + } + public AsyncDomainClient domain() { return this.domainClient.get(); } diff --git a/src/main/java/com/basistheory/resources/applepay/merchant/AsyncMerchantClient.java b/src/main/java/com/basistheory/resources/applepay/merchant/AsyncMerchantClient.java new file mode 100644 index 0000000..539620b --- /dev/null +++ b/src/main/java/com/basistheory/resources/applepay/merchant/AsyncMerchantClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.resources.applepay.merchant; + +import com.basistheory.core.ClientOptions; +import com.basistheory.core.RequestOptions; +import com.basistheory.resources.applepay.merchant.requests.ApplePayMerchantRegisterRequest; +import com.basistheory.types.ApplePayMerchant; +import com.basistheory.types.ApplePayToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncMerchantClient { + protected final ClientOptions clientOptions; + + private final AsyncRawMerchantClient rawClient; + + public AsyncMerchantClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawMerchantClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawMerchantClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + public CompletableFuture create(ApplePayMerchantRegisterRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + ApplePayMerchantRegisterRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/basistheory/resources/applepay/merchant/AsyncRawMerchantClient.java b/src/main/java/com/basistheory/resources/applepay/merchant/AsyncRawMerchantClient.java new file mode 100644 index 0000000..5b83bea --- /dev/null +++ b/src/main/java/com/basistheory/resources/applepay/merchant/AsyncRawMerchantClient.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.resources.applepay.merchant; + +import com.basistheory.core.BasisTheoryApiApiException; +import com.basistheory.core.BasisTheoryApiHttpResponse; +import com.basistheory.core.BasisTheoryException; +import com.basistheory.core.ClientOptions; +import com.basistheory.core.MediaTypes; +import com.basistheory.core.ObjectMappers; +import com.basistheory.core.RequestOptions; +import com.basistheory.errors.ForbiddenError; +import com.basistheory.errors.NotFoundError; +import com.basistheory.errors.UnauthorizedError; +import com.basistheory.resources.applepay.merchant.requests.ApplePayMerchantRegisterRequest; +import com.basistheory.types.ApplePayMerchant; +import com.basistheory.types.ApplePayToken; +import com.basistheory.types.ProblemDetails; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawMerchantClient { + protected final ClientOptions clientOptions; + + public AsyncRawMerchantClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> get(String id) { + return get(id, null); + } + + public CompletableFuture> get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplePayToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + future.completeExceptionally(new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new BasisTheoryApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + future.completeExceptionally(new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create() { + return create(ApplePayMerchantRegisterRequest.builder().build()); + } + + public CompletableFuture> create( + ApplePayMerchantRegisterRequest request) { + return create(request, null); + } + + public CompletableFuture> create( + ApplePayMerchantRegisterRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new BasisTheoryException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplePayMerchant.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + future.completeExceptionally(new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/basistheory/resources/applepay/merchant/MerchantClient.java b/src/main/java/com/basistheory/resources/applepay/merchant/MerchantClient.java new file mode 100644 index 0000000..1c1dda3 --- /dev/null +++ b/src/main/java/com/basistheory/resources/applepay/merchant/MerchantClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.resources.applepay.merchant; + +import com.basistheory.core.ClientOptions; +import com.basistheory.core.RequestOptions; +import com.basistheory.resources.applepay.merchant.requests.ApplePayMerchantRegisterRequest; +import com.basistheory.types.ApplePayMerchant; +import com.basistheory.types.ApplePayToken; + +public class MerchantClient { + protected final ClientOptions clientOptions; + + private final RawMerchantClient rawClient; + + public MerchantClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawMerchantClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawMerchantClient withRawResponse() { + return this.rawClient; + } + + public ApplePayToken get(String id) { + return this.rawClient.get(id).body(); + } + + public ApplePayToken get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public ApplePayMerchant create() { + return this.rawClient.create().body(); + } + + public ApplePayMerchant create(ApplePayMerchantRegisterRequest request) { + return this.rawClient.create(request).body(); + } + + public ApplePayMerchant create(ApplePayMerchantRegisterRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/basistheory/resources/applepay/merchant/RawMerchantClient.java b/src/main/java/com/basistheory/resources/applepay/merchant/RawMerchantClient.java new file mode 100644 index 0000000..3149afe --- /dev/null +++ b/src/main/java/com/basistheory/resources/applepay/merchant/RawMerchantClient.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.resources.applepay.merchant; + +import com.basistheory.core.BasisTheoryApiApiException; +import com.basistheory.core.BasisTheoryApiHttpResponse; +import com.basistheory.core.BasisTheoryException; +import com.basistheory.core.ClientOptions; +import com.basistheory.core.MediaTypes; +import com.basistheory.core.ObjectMappers; +import com.basistheory.core.RequestOptions; +import com.basistheory.errors.ForbiddenError; +import com.basistheory.errors.NotFoundError; +import com.basistheory.errors.UnauthorizedError; +import com.basistheory.resources.applepay.merchant.requests.ApplePayMerchantRegisterRequest; +import com.basistheory.types.ApplePayMerchant; +import com.basistheory.types.ApplePayToken; +import com.basistheory.types.ProblemDetails; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawMerchantClient { + protected final ClientOptions clientOptions; + + public RawMerchantClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public BasisTheoryApiHttpResponse get(String id) { + return get(id, null); + } + + public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplePayToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new BasisTheoryException("Network error executing HTTP request", e); + } + } + + public BasisTheoryApiHttpResponse delete(String id) { + return delete(id, null); + } + + public BasisTheoryApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new BasisTheoryApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new BasisTheoryException("Network error executing HTTP request", e); + } + } + + public BasisTheoryApiHttpResponse create() { + return create(ApplePayMerchantRegisterRequest.builder().build()); + } + + public BasisTheoryApiHttpResponse create(ApplePayMerchantRegisterRequest request) { + return create(request, null); + } + + public BasisTheoryApiHttpResponse create( + ApplePayMerchantRegisterRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("apple-pay/merchant-registration") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new BasisTheoryException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplePayMerchant.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new BasisTheoryApiApiException( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new BasisTheoryException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/basistheory/resources/applepay/merchant/requests/ApplePayMerchantRegisterRequest.java b/src/main/java/com/basistheory/resources/applepay/merchant/requests/ApplePayMerchantRegisterRequest.java new file mode 100644 index 0000000..f7d11c1 --- /dev/null +++ b/src/main/java/com/basistheory/resources/applepay/merchant/requests/ApplePayMerchantRegisterRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.resources.applepay.merchant.requests; + +import com.basistheory.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplePayMerchantRegisterRequest.Builder.class) +public final class ApplePayMerchantRegisterRequest { + private final Optional merchantIdentifier; + + private final Map additionalProperties; + + private ApplePayMerchantRegisterRequest( + Optional merchantIdentifier, Map additionalProperties) { + this.merchantIdentifier = merchantIdentifier; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("merchant_identifier") + public Optional getMerchantIdentifier() { + return merchantIdentifier; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplePayMerchantRegisterRequest && equalTo((ApplePayMerchantRegisterRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplePayMerchantRegisterRequest other) { + return merchantIdentifier.equals(other.merchantIdentifier); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.merchantIdentifier); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional merchantIdentifier = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApplePayMerchantRegisterRequest other) { + merchantIdentifier(other.getMerchantIdentifier()); + return this; + } + + @JsonSetter(value = "merchant_identifier", nulls = Nulls.SKIP) + public Builder merchantIdentifier(Optional merchantIdentifier) { + this.merchantIdentifier = merchantIdentifier; + return this; + } + + public Builder merchantIdentifier(String merchantIdentifier) { + this.merchantIdentifier = Optional.ofNullable(merchantIdentifier); + return this; + } + + public ApplePayMerchantRegisterRequest build() { + return new ApplePayMerchantRegisterRequest(merchantIdentifier, additionalProperties); + } + } +} diff --git a/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java b/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java index 85b2f10..93c303d 100644 --- a/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java +++ b/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java @@ -5,6 +5,7 @@ import com.basistheory.core.ObjectMappers; import com.basistheory.types.Application; +import com.basistheory.types.RuntimeOptions; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -30,10 +31,10 @@ public final class CreateReactorRequest { private final Optional>> configuration; - private final Optional>> dependencies; - private final Optional runtime; + private final Optional options; + private final Map additionalProperties; private CreateReactorRequest( @@ -41,15 +42,15 @@ private CreateReactorRequest( String code, Optional application, Optional>> configuration, - Optional>> dependencies, Optional runtime, + Optional options, Map additionalProperties) { this.name = name; this.code = code; this.application = application; this.configuration = configuration; - this.dependencies = dependencies; this.runtime = runtime; + this.options = options; this.additionalProperties = additionalProperties; } @@ -73,16 +74,16 @@ public Optional>> getConfiguration() { return configuration; } - @JsonProperty("dependencies") - public Optional>> getDependencies() { - return dependencies; - } - @JsonProperty("runtime") public Optional getRuntime() { return runtime; } + @JsonProperty("options") + public Optional getOptions() { + return options; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -99,14 +100,13 @@ private boolean equalTo(CreateReactorRequest other) { && code.equals(other.code) && application.equals(other.application) && configuration.equals(other.configuration) - && dependencies.equals(other.dependencies) - && runtime.equals(other.runtime); + && runtime.equals(other.runtime) + && options.equals(other.options); } @java.lang.Override public int hashCode() { - return Objects.hash( - this.name, this.code, this.application, this.configuration, this.dependencies, this.runtime); + return Objects.hash(this.name, this.code, this.application, this.configuration, this.runtime, this.options); } @java.lang.Override @@ -139,13 +139,13 @@ public interface _FinalStage { _FinalStage configuration(Map> configuration); - _FinalStage dependencies(Optional>> dependencies); - - _FinalStage dependencies(Map> dependencies); - _FinalStage runtime(Optional runtime); _FinalStage runtime(String runtime); + + _FinalStage options(Optional options); + + _FinalStage options(RuntimeOptions options); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -154,9 +154,9 @@ public static final class Builder implements NameStage, CodeStage, _FinalStage { private String code; - private Optional runtime = Optional.empty(); + private Optional options = Optional.empty(); - private Optional>> dependencies = Optional.empty(); + private Optional runtime = Optional.empty(); private Optional>> configuration = Optional.empty(); @@ -173,8 +173,8 @@ public Builder from(CreateReactorRequest other) { code(other.getCode()); application(other.getApplication()); configuration(other.getConfiguration()); - dependencies(other.getDependencies()); runtime(other.getRuntime()); + options(other.getOptions()); return this; } @@ -193,28 +193,28 @@ public _FinalStage code(@NotNull String code) { } @java.lang.Override - public _FinalStage runtime(String runtime) { - this.runtime = Optional.ofNullable(runtime); + public _FinalStage options(RuntimeOptions options) { + this.options = Optional.ofNullable(options); return this; } @java.lang.Override - @JsonSetter(value = "runtime", nulls = Nulls.SKIP) - public _FinalStage runtime(Optional runtime) { - this.runtime = runtime; + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public _FinalStage options(Optional options) { + this.options = options; return this; } @java.lang.Override - public _FinalStage dependencies(Map> dependencies) { - this.dependencies = Optional.ofNullable(dependencies); + public _FinalStage runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); return this; } @java.lang.Override - @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public _FinalStage dependencies(Optional>> dependencies) { - this.dependencies = dependencies; + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public _FinalStage runtime(Optional runtime) { + this.runtime = runtime; return this; } @@ -247,7 +247,7 @@ public _FinalStage application(Optional application) { @java.lang.Override public CreateReactorRequest build() { return new CreateReactorRequest( - name, code, application, configuration, dependencies, runtime, additionalProperties); + name, code, application, configuration, runtime, options, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/resources/reactors/requests/PatchReactorRequest.java b/src/main/java/com/basistheory/resources/reactors/requests/PatchReactorRequest.java index 402901f..ab29309 100644 --- a/src/main/java/com/basistheory/resources/reactors/requests/PatchReactorRequest.java +++ b/src/main/java/com/basistheory/resources/reactors/requests/PatchReactorRequest.java @@ -5,6 +5,7 @@ import com.basistheory.core.ObjectMappers; import com.basistheory.types.Application; +import com.basistheory.types.RuntimeOptions; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,6 +30,10 @@ public final class PatchReactorRequest { private final Optional>> configuration; + private final Optional runtime; + + private final Optional options; + private final Map additionalProperties; private PatchReactorRequest( @@ -36,11 +41,15 @@ private PatchReactorRequest( Optional application, Optional code, Optional>> configuration, + Optional runtime, + Optional options, Map additionalProperties) { this.name = name; this.application = application; this.code = code; this.configuration = configuration; + this.runtime = runtime; + this.options = options; this.additionalProperties = additionalProperties; } @@ -64,6 +73,16 @@ public Optional>> getConfiguration() { return configuration; } + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -79,12 +98,14 @@ private boolean equalTo(PatchReactorRequest other) { return name.equals(other.name) && application.equals(other.application) && code.equals(other.code) - && configuration.equals(other.configuration); + && configuration.equals(other.configuration) + && runtime.equals(other.runtime) + && options.equals(other.options); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.application, this.code, this.configuration); + return Objects.hash(this.name, this.application, this.code, this.configuration, this.runtime, this.options); } @java.lang.Override @@ -106,6 +127,10 @@ public static final class Builder { private Optional>> configuration = Optional.empty(); + private Optional runtime = Optional.empty(); + + private Optional options = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -116,6 +141,8 @@ public Builder from(PatchReactorRequest other) { application(other.getApplication()); code(other.getCode()); configuration(other.getConfiguration()); + runtime(other.getRuntime()); + options(other.getOptions()); return this; } @@ -163,8 +190,31 @@ public Builder configuration(Map> configuration) { return this; } + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(RuntimeOptions options) { + this.options = Optional.ofNullable(options); + return this; + } + public PatchReactorRequest build() { - return new PatchReactorRequest(name, application, code, configuration, additionalProperties); + return new PatchReactorRequest( + name, application, code, configuration, runtime, options, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java b/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java index 214554a..3871284 100644 --- a/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java +++ b/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java @@ -5,6 +5,7 @@ import com.basistheory.core.ObjectMappers; import com.basistheory.types.Application; +import com.basistheory.types.RuntimeOptions; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -30,10 +31,10 @@ public final class UpdateReactorRequest { private final Optional>> configuration; - private final Optional>> dependencies; - private final Optional runtime; + private final Optional options; + private final Map additionalProperties; private UpdateReactorRequest( @@ -41,15 +42,15 @@ private UpdateReactorRequest( Optional application, String code, Optional>> configuration, - Optional>> dependencies, Optional runtime, + Optional options, Map additionalProperties) { this.name = name; this.application = application; this.code = code; this.configuration = configuration; - this.dependencies = dependencies; this.runtime = runtime; + this.options = options; this.additionalProperties = additionalProperties; } @@ -73,16 +74,16 @@ public Optional>> getConfiguration() { return configuration; } - @JsonProperty("dependencies") - public Optional>> getDependencies() { - return dependencies; - } - @JsonProperty("runtime") public Optional getRuntime() { return runtime; } + @JsonProperty("options") + public Optional getOptions() { + return options; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -99,14 +100,13 @@ private boolean equalTo(UpdateReactorRequest other) { && application.equals(other.application) && code.equals(other.code) && configuration.equals(other.configuration) - && dependencies.equals(other.dependencies) - && runtime.equals(other.runtime); + && runtime.equals(other.runtime) + && options.equals(other.options); } @java.lang.Override public int hashCode() { - return Objects.hash( - this.name, this.application, this.code, this.configuration, this.dependencies, this.runtime); + return Objects.hash(this.name, this.application, this.code, this.configuration, this.runtime, this.options); } @java.lang.Override @@ -139,13 +139,13 @@ public interface _FinalStage { _FinalStage configuration(Map> configuration); - _FinalStage dependencies(Optional>> dependencies); - - _FinalStage dependencies(Map> dependencies); - _FinalStage runtime(Optional runtime); _FinalStage runtime(String runtime); + + _FinalStage options(Optional options); + + _FinalStage options(RuntimeOptions options); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -154,9 +154,9 @@ public static final class Builder implements NameStage, CodeStage, _FinalStage { private String code; - private Optional runtime = Optional.empty(); + private Optional options = Optional.empty(); - private Optional>> dependencies = Optional.empty(); + private Optional runtime = Optional.empty(); private Optional>> configuration = Optional.empty(); @@ -173,8 +173,8 @@ public Builder from(UpdateReactorRequest other) { application(other.getApplication()); code(other.getCode()); configuration(other.getConfiguration()); - dependencies(other.getDependencies()); runtime(other.getRuntime()); + options(other.getOptions()); return this; } @@ -193,28 +193,28 @@ public _FinalStage code(@NotNull String code) { } @java.lang.Override - public _FinalStage runtime(String runtime) { - this.runtime = Optional.ofNullable(runtime); + public _FinalStage options(RuntimeOptions options) { + this.options = Optional.ofNullable(options); return this; } @java.lang.Override - @JsonSetter(value = "runtime", nulls = Nulls.SKIP) - public _FinalStage runtime(Optional runtime) { - this.runtime = runtime; + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public _FinalStage options(Optional options) { + this.options = options; return this; } @java.lang.Override - public _FinalStage dependencies(Map> dependencies) { - this.dependencies = Optional.ofNullable(dependencies); + public _FinalStage runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); return this; } @java.lang.Override - @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public _FinalStage dependencies(Optional>> dependencies) { - this.dependencies = dependencies; + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public _FinalStage runtime(Optional runtime) { + this.runtime = runtime; return this; } @@ -247,7 +247,7 @@ public _FinalStage application(Optional application) { @java.lang.Override public UpdateReactorRequest build() { return new UpdateReactorRequest( - name, application, code, configuration, dependencies, runtime, additionalProperties); + name, application, code, configuration, runtime, options, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/resources/tokens/AsyncRawTokensClient.java b/src/main/java/com/basistheory/resources/tokens/AsyncRawTokensClient.java index 430a38e..acc7c39 100644 --- a/src/main/java/com/basistheory/resources/tokens/AsyncRawTokensClient.java +++ b/src/main/java/com/basistheory/resources/tokens/AsyncRawTokensClient.java @@ -19,7 +19,6 @@ import com.basistheory.errors.NotFoundError; import com.basistheory.errors.UnauthorizedError; import com.basistheory.resources.tokens.requests.SearchTokensRequestV2; -import com.basistheory.resources.tokens.requests.TokensListRequest; import com.basistheory.resources.tokens.requests.TokensListV2Request; import com.basistheory.resources.tokens.requests.UpdateTokenRequest; import com.basistheory.types.CreateTokenRequest; @@ -27,7 +26,6 @@ import com.basistheory.types.ProblemDetails; import com.basistheory.types.Token; import com.basistheory.types.TokenCursorPaginatedList; -import com.basistheory.types.TokenPaginatedList; import com.basistheory.types.ValidationProblemDetails; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; @@ -225,139 +223,20 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> list() { - return list(TokensListRequest.builder().build()); - } - - public CompletableFuture>> list(TokensListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - TokensListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("tokens"); - if (request.getMetadata().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "metadata", request.getMetadata().get(), false); - } - if (request.getPage().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "page", request.getPage().get(), false); - } - if (request.getStart().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start", request.getStart().get(), false); - } - if (request.getSize().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "size", request.getSize().get(), false); - } - if (request.getId().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), true); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture>> future = new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - if (response.isSuccessful()) { - TokenPaginatedList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TokenPaginatedList.class); - int newPageNumber = request.getPage() - .map((Integer page) -> page + 1) - .orElse(1); - TokensListRequest nextRequest = TokensListRequest.builder() - .from(request) - .page(newPageNumber) - .build(); - List result = parsedResponse.getData().orElse(Collections.emptyList()); - future.complete(new BasisTheoryApiHttpResponse<>( - new SyncPagingIterable(true, result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - switch (response.code()) { - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - future.completeExceptionally(new BasisTheoryApiApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BasisTheoryException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> create() { - return create(CreateTokenRequest.builder().build()); - } - - public CompletableFuture> create(CreateTokenRequest request) { - return create(request, null); + public CompletableFuture> get(String id) { + return get(id, null); } - public CompletableFuture> create( - CreateTokenRequest request, IdempotentRequestOptions requestOptions) { + public CompletableFuture> get(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") + .addPathSegment(id) .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BasisTheoryException("Failed to serialize request", e); - } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", body) + .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); @@ -377,12 +256,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, ValidationProblemDetails.class), - response)); - return; case 401: future.completeExceptionally(new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), @@ -393,9 +266,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response)); return; - case 409: - future.completeExceptionally(new ConflictError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } @@ -421,11 +294,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> get(String id) { - return get(id, null); + public CompletableFuture> delete(String id) { + return delete(id, null); } - public CompletableFuture> get(String id, RequestOptions requestOptions) { + public CompletableFuture> delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") @@ -433,7 +306,7 @@ public CompletableFuture> get(String id, Reque .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("GET", null) + .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Accept", "application/json") .build(); @@ -441,19 +314,24 @@ public CompletableFuture> get(String id, Reque if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new BasisTheoryApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Token.class), response)); + future.complete(new BasisTheoryApiHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ValidationProblemDetails.class), + response)); + return; case 401: future.completeExceptionally(new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), @@ -492,33 +370,48 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> delete(String id) { - return delete(id, null); + public CompletableFuture> update(String id) { + return update(id, UpdateTokenRequest.builder().build()); } - public CompletableFuture> delete(String id, RequestOptions requestOptions) { + public CompletableFuture> update(String id, UpdateTokenRequest request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdateTokenRequest request, IdempotentRequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") .addPathSegment(id) .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), + MediaType.parse("application/merge-patch+json")); + } catch (JsonProcessingException e) { + throw new BasisTheoryException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("DELETE", null) + .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/merge-patch+json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new BasisTheoryApiHttpResponse<>(null, response)); + future.complete(new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Token.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -545,6 +438,11 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response)); + return; } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error @@ -568,34 +466,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> update(String id) { - return update(id, UpdateTokenRequest.builder().build()); + public CompletableFuture> create() { + return create(CreateTokenRequest.builder().build()); } - public CompletableFuture> update(String id, UpdateTokenRequest request) { - return update(id, request, null); + public CompletableFuture> create(CreateTokenRequest request) { + return create(request, null); } - public CompletableFuture> update( - String id, UpdateTokenRequest request, IdempotentRequestOptions requestOptions) { + public CompletableFuture> create( + CreateTokenRequest request, IdempotentRequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") - .addPathSegment(id) .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), - MediaType.parse("application/merge-patch+json")); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BasisTheoryException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("PATCH", body) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/merge-patch+json") + .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); @@ -631,11 +527,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response)); return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; case 409: future.completeExceptionally(new ConflictError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), diff --git a/src/main/java/com/basistheory/resources/tokens/AsyncTokensClient.java b/src/main/java/com/basistheory/resources/tokens/AsyncTokensClient.java index 2481115..53b2c52 100644 --- a/src/main/java/com/basistheory/resources/tokens/AsyncTokensClient.java +++ b/src/main/java/com/basistheory/resources/tokens/AsyncTokensClient.java @@ -8,7 +8,6 @@ import com.basistheory.core.RequestOptions; import com.basistheory.core.pagination.SyncPagingIterable; import com.basistheory.resources.tokens.requests.SearchTokensRequestV2; -import com.basistheory.resources.tokens.requests.TokensListRequest; import com.basistheory.resources.tokens.requests.TokensListV2Request; import com.basistheory.resources.tokens.requests.UpdateTokenRequest; import com.basistheory.types.CreateTokenRequest; @@ -48,30 +47,6 @@ public CompletableFuture tokenize(Object request, IdempotentRequestOptio return this.rawClient.tokenize(request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(TokensListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list(TokensListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture create() { - return this.rawClient.create().thenApply(response -> response.body()); - } - - public CompletableFuture create(CreateTokenRequest request) { - return this.rawClient.create(request).thenApply(response -> response.body()); - } - - public CompletableFuture create(CreateTokenRequest request, IdempotentRequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); - } - public CompletableFuture get(String id) { return this.rawClient.get(id).thenApply(response -> response.body()); } @@ -101,6 +76,18 @@ public CompletableFuture update( return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); } + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + public CompletableFuture create(CreateTokenRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create(CreateTokenRequest request, IdempotentRequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + public CompletableFuture> listV2() { return this.rawClient.listV2().thenApply(response -> response.body()); } diff --git a/src/main/java/com/basistheory/resources/tokens/RawTokensClient.java b/src/main/java/com/basistheory/resources/tokens/RawTokensClient.java index 7caad00..3c792eb 100644 --- a/src/main/java/com/basistheory/resources/tokens/RawTokensClient.java +++ b/src/main/java/com/basistheory/resources/tokens/RawTokensClient.java @@ -19,7 +19,6 @@ import com.basistheory.errors.NotFoundError; import com.basistheory.errors.UnauthorizedError; import com.basistheory.resources.tokens.requests.SearchTokensRequestV2; -import com.basistheory.resources.tokens.requests.TokensListRequest; import com.basistheory.resources.tokens.requests.TokensListV2Request; import com.basistheory.resources.tokens.requests.UpdateTokenRequest; import com.basistheory.types.CreateTokenRequest; @@ -27,7 +26,6 @@ import com.basistheory.types.ProblemDetails; import com.basistheory.types.Token; import com.basistheory.types.TokenCursorPaginatedList; -import com.basistheory.types.TokenPaginatedList; import com.basistheory.types.ValidationProblemDetails; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; @@ -182,116 +180,20 @@ public BasisTheoryApiHttpResponse tokenize(Object request, IdempotentReq } } - public BasisTheoryApiHttpResponse> list() { - return list(TokensListRequest.builder().build()); - } - - public BasisTheoryApiHttpResponse> list(TokensListRequest request) { - return list(request, null); - } - - public BasisTheoryApiHttpResponse> list( - TokensListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("tokens"); - if (request.getMetadata().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "metadata", request.getMetadata().get(), false); - } - if (request.getPage().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "page", request.getPage().get(), false); - } - if (request.getStart().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start", request.getStart().get(), false); - } - if (request.getSize().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "size", request.getSize().get(), false); - } - if (request.getId().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), true); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - TokenPaginatedList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TokenPaginatedList.class); - int newPageNumber = - request.getPage().map((Integer page) -> page + 1).orElse(1); - TokensListRequest nextRequest = TokensListRequest.builder() - .from(request) - .page(newPageNumber) - .build(); - List result = parsedResponse.getData().orElse(Collections.emptyList()); - return new BasisTheoryApiHttpResponse<>( - new SyncPagingIterable(true, result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - try { - switch (response.code()) { - case 401: - throw new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - throw new BasisTheoryApiApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BasisTheoryException("Network error executing HTTP request", e); - } - } - - public BasisTheoryApiHttpResponse create() { - return create(CreateTokenRequest.builder().build()); - } - - public BasisTheoryApiHttpResponse create(CreateTokenRequest request) { - return create(request, null); + public BasisTheoryApiHttpResponse get(String id) { + return get(id, null); } - public BasisTheoryApiHttpResponse create( - CreateTokenRequest request, IdempotentRequestOptions requestOptions) { + public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") + .addPathSegment(id) .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BasisTheoryException("Failed to serialize request", e); - } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", body) + .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); @@ -307,10 +209,6 @@ public BasisTheoryApiHttpResponse create( String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { switch (response.code()) { - case 400: - throw new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ValidationProblemDetails.class), - response); case 401: throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), @@ -319,10 +217,9 @@ public BasisTheoryApiHttpResponse create( throw new ForbiddenError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response); - case 409: - throw new ConflictError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error @@ -337,11 +234,11 @@ public BasisTheoryApiHttpResponse create( } } - public BasisTheoryApiHttpResponse get(String id) { - return get(id, null); + public BasisTheoryApiHttpResponse delete(String id) { + return delete(id, null); } - public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOptions) { + public BasisTheoryApiHttpResponse delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") @@ -349,7 +246,7 @@ public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOp .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("GET", null) + .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Accept", "application/json") .build(); @@ -360,12 +257,15 @@ public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOp try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new BasisTheoryApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Token.class), response); + return new BasisTheoryApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ValidationProblemDetails.class), + response); case 401: throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), @@ -391,20 +291,34 @@ public BasisTheoryApiHttpResponse get(String id, RequestOptions requestOp } } - public BasisTheoryApiHttpResponse delete(String id) { - return delete(id, null); + public BasisTheoryApiHttpResponse update(String id) { + return update(id, UpdateTokenRequest.builder().build()); } - public BasisTheoryApiHttpResponse delete(String id, RequestOptions requestOptions) { + public BasisTheoryApiHttpResponse update(String id, UpdateTokenRequest request) { + return update(id, request, null); + } + + public BasisTheoryApiHttpResponse update( + String id, UpdateTokenRequest request, IdempotentRequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") .addPathSegment(id) .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), + MediaType.parse("application/merge-patch+json")); + } catch (JsonProcessingException e) { + throw new BasisTheoryException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("DELETE", null) + .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/merge-patch+json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); @@ -414,7 +328,8 @@ public BasisTheoryApiHttpResponse delete(String id, RequestOptions request try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new BasisTheoryApiHttpResponse<>(null, response); + return new BasisTheoryApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Token.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -434,6 +349,10 @@ public BasisTheoryApiHttpResponse delete(String id, RequestOptions request case 404: throw new NotFoundError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + response); } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error @@ -448,34 +367,32 @@ public BasisTheoryApiHttpResponse delete(String id, RequestOptions request } } - public BasisTheoryApiHttpResponse update(String id) { - return update(id, UpdateTokenRequest.builder().build()); + public BasisTheoryApiHttpResponse create() { + return create(CreateTokenRequest.builder().build()); } - public BasisTheoryApiHttpResponse update(String id, UpdateTokenRequest request) { - return update(id, request, null); + public BasisTheoryApiHttpResponse create(CreateTokenRequest request) { + return create(request, null); } - public BasisTheoryApiHttpResponse update( - String id, UpdateTokenRequest request, IdempotentRequestOptions requestOptions) { + public BasisTheoryApiHttpResponse create( + CreateTokenRequest request, IdempotentRequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tokens") - .addPathSegment(id) .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), - MediaType.parse("application/merge-patch+json")); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BasisTheoryException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("PATCH", body) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/merge-patch+json") + .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .build(); OkHttpClient client = clientOptions.httpClient(); @@ -503,9 +420,6 @@ public BasisTheoryApiHttpResponse update( throw new ForbiddenError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); case 409: throw new ConflictError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), diff --git a/src/main/java/com/basistheory/resources/tokens/TokensClient.java b/src/main/java/com/basistheory/resources/tokens/TokensClient.java index 73ac9a1..58540fc 100644 --- a/src/main/java/com/basistheory/resources/tokens/TokensClient.java +++ b/src/main/java/com/basistheory/resources/tokens/TokensClient.java @@ -8,7 +8,6 @@ import com.basistheory.core.RequestOptions; import com.basistheory.core.pagination.SyncPagingIterable; import com.basistheory.resources.tokens.requests.SearchTokensRequestV2; -import com.basistheory.resources.tokens.requests.TokensListRequest; import com.basistheory.resources.tokens.requests.TokensListV2Request; import com.basistheory.resources.tokens.requests.UpdateTokenRequest; import com.basistheory.types.CreateTokenRequest; @@ -47,30 +46,6 @@ public Object tokenize(Object request, IdempotentRequestOptions requestOptions) return this.rawClient.tokenize(request, requestOptions).body(); } - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(TokensListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(TokensListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public Token create() { - return this.rawClient.create().body(); - } - - public Token create(CreateTokenRequest request) { - return this.rawClient.create(request).body(); - } - - public Token create(CreateTokenRequest request, IdempotentRequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).body(); - } - public Token get(String id) { return this.rawClient.get(id).body(); } @@ -99,6 +74,18 @@ public Token update(String id, UpdateTokenRequest request, IdempotentRequestOpti return this.rawClient.update(id, request, requestOptions).body(); } + public Token create() { + return this.rawClient.create().body(); + } + + public Token create(CreateTokenRequest request) { + return this.rawClient.create(request).body(); + } + + public Token create(CreateTokenRequest request, IdempotentRequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + public SyncPagingIterable listV2() { return this.rawClient.listV2().body(); } diff --git a/src/main/java/com/basistheory/resources/tokens/requests/TokensListRequest.java b/src/main/java/com/basistheory/resources/tokens/requests/TokensListRequest.java deleted file mode 100644 index e8a1e13..0000000 --- a/src/main/java/com/basistheory/resources/tokens/requests/TokensListRequest.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.basistheory.resources.tokens.requests; - -import com.basistheory.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -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 java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokensListRequest.Builder.class) -public final class TokensListRequest { - private final Optional> id; - - private final Optional>> metadata; - - private final Optional page; - - private final Optional start; - - private final Optional size; - - private final Map additionalProperties; - - private TokensListRequest( - Optional> id, - Optional>> metadata, - Optional page, - Optional start, - Optional size, - Map additionalProperties) { - this.id = id; - this.metadata = metadata; - this.page = page; - this.start = start; - this.size = size; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional> getId() { - return id; - } - - @JsonProperty("metadata") - public Optional>> getMetadata() { - return metadata; - } - - @JsonProperty("page") - public Optional getPage() { - return page; - } - - @JsonProperty("start") - public Optional getStart() { - return start; - } - - @JsonProperty("size") - public Optional getSize() { - return size; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TokensListRequest && equalTo((TokensListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TokensListRequest other) { - return id.equals(other.id) - && metadata.equals(other.metadata) - && page.equals(other.page) - && start.equals(other.start) - && size.equals(other.size); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.metadata, this.page, this.start, this.size); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> id = Optional.empty(); - - private Optional>> metadata = Optional.empty(); - - private Optional page = Optional.empty(); - - private Optional start = Optional.empty(); - - private Optional size = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TokensListRequest other) { - id(other.getId()); - metadata(other.getMetadata()); - page(other.getPage()); - start(other.getStart()); - size(other.getSize()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional> id) { - this.id = id; - return this; - } - - public Builder id(List id) { - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(String id) { - this.id = Optional.of(Collections.singletonList(id)); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional>> metadata) { - this.metadata = metadata; - return this; - } - - public Builder metadata(Map> metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; - } - - @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(Optional page) { - this.page = page; - return this; - } - - public Builder page(Integer page) { - this.page = Optional.ofNullable(page); - return this; - } - - @JsonSetter(value = "start", nulls = Nulls.SKIP) - public Builder start(Optional start) { - this.start = start; - return this; - } - - public Builder start(String start) { - this.start = Optional.ofNullable(start); - return this; - } - - @JsonSetter(value = "size", nulls = Nulls.SKIP) - public Builder size(Optional size) { - this.size = size; - return this; - } - - public Builder size(Integer size) { - this.size = Optional.ofNullable(size); - return this; - } - - public TokensListRequest build() { - return new TokensListRequest(id, metadata, page, start, size, additionalProperties); - } - } -} diff --git a/src/main/java/com/basistheory/types/AccountUpdaterJob.java b/src/main/java/com/basistheory/types/AccountUpdaterJob.java index 5d7ecb3..330e2bd 100644 --- a/src/main/java/com/basistheory/types/AccountUpdaterJob.java +++ b/src/main/java/com/basistheory/types/AccountUpdaterJob.java @@ -39,6 +39,10 @@ public final class AccountUpdaterJob { private final Optional> errors; + private final Optional requests; + + private final Optional> results; + private final Map additionalProperties; private AccountUpdaterJob( @@ -50,6 +54,8 @@ private AccountUpdaterJob( OffsetDateTime createdAt, Optional expiresAt, Optional> errors, + Optional requests, + Optional> results, Map additionalProperties) { this.id = id; this.tenantId = tenantId; @@ -59,6 +65,8 @@ private AccountUpdaterJob( this.createdAt = createdAt; this.expiresAt = expiresAt; this.errors = errors; + this.requests = requests; + this.results = results; this.additionalProperties = additionalProperties; } @@ -120,6 +128,22 @@ public Optional> getErrors() { return errors; } + /** + * @return Total number of requests processed + */ + @JsonProperty("requests") + public Optional getRequests() { + return requests; + } + + /** + * @return Summary count breakdown by result code for all processed rows + */ + @JsonProperty("results") + public Optional> getResults() { + return results; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -139,7 +163,9 @@ private boolean equalTo(AccountUpdaterJob other) { && createdBy.equals(other.createdBy) && createdAt.equals(other.createdAt) && expiresAt.equals(other.expiresAt) - && errors.equals(other.errors); + && errors.equals(other.errors) + && requests.equals(other.requests) + && results.equals(other.results); } @java.lang.Override @@ -152,7 +178,9 @@ public int hashCode() { this.createdBy, this.createdAt, this.expiresAt, - this.errors); + this.errors, + this.requests, + this.results); } @java.lang.Override @@ -218,6 +246,20 @@ public interface _FinalStage { _FinalStage errors(Optional> errors); _FinalStage errors(List errors); + + /** + *

Total number of requests processed

+ */ + _FinalStage requests(Optional requests); + + _FinalStage requests(Integer requests); + + /** + *

Summary count breakdown by result code for all processed rows

+ */ + _FinalStage results(Optional> results); + + _FinalStage results(Map results); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -241,6 +283,10 @@ public static final class Builder private OffsetDateTime createdAt; + private Optional> results = Optional.empty(); + + private Optional requests = Optional.empty(); + private Optional> errors = Optional.empty(); private Optional expiresAt = Optional.empty(); @@ -260,6 +306,8 @@ public Builder from(AccountUpdaterJob other) { createdAt(other.getCreatedAt()); expiresAt(other.getExpiresAt()); errors(other.getErrors()); + requests(other.getRequests()); + results(other.getResults()); return this; } @@ -325,6 +373,46 @@ public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { return this; } + /** + *

Summary count breakdown by result code for all processed rows

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage results(Map results) { + this.results = Optional.ofNullable(results); + return this; + } + + /** + *

Summary count breakdown by result code for all processed rows

+ */ + @java.lang.Override + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public _FinalStage results(Optional> results) { + this.results = results; + return this; + } + + /** + *

Total number of requests processed

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage requests(Integer requests) { + this.requests = Optional.ofNullable(requests); + return this; + } + + /** + *

Total number of requests processed

+ */ + @java.lang.Override + @JsonSetter(value = "requests", nulls = Nulls.SKIP) + public _FinalStage requests(Optional requests) { + this.requests = requests; + return this; + } + /** *

List of errors encountered during processing

* @return Reference to {@code this} so that method calls can be chained together. @@ -368,7 +456,17 @@ public _FinalStage expiresAt(Optional expiresAt) { @java.lang.Override public AccountUpdaterJob build() { return new AccountUpdaterJob( - id, tenantId, status, uploadUrl, createdBy, createdAt, expiresAt, errors, additionalProperties); + id, + tenantId, + status, + uploadUrl, + createdBy, + createdAt, + expiresAt, + errors, + requests, + results, + additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/ApplePayCreateResponse.java b/src/main/java/com/basistheory/types/ApplePayCreateResponse.java index faf1216..5671db4 100644 --- a/src/main/java/com/basistheory/types/ApplePayCreateResponse.java +++ b/src/main/java/com/basistheory/types/ApplePayCreateResponse.java @@ -20,18 +20,17 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ApplePayCreateResponse.Builder.class) public final class ApplePayCreateResponse { - private final Optional applePay; + private final Optional applePay; private final Map additionalProperties; - private ApplePayCreateResponse( - Optional applePay, Map additionalProperties) { + private ApplePayCreateResponse(Optional applePay, Map additionalProperties) { this.applePay = applePay; this.additionalProperties = additionalProperties; } @JsonProperty("apple_pay") - public Optional getApplePay() { + public Optional getApplePay() { return applePay; } @@ -66,7 +65,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional applePay = Optional.empty(); + private Optional applePay = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -79,12 +78,12 @@ public Builder from(ApplePayCreateResponse other) { } @JsonSetter(value = "apple_pay", nulls = Nulls.SKIP) - public Builder applePay(Optional applePay) { + public Builder applePay(Optional applePay) { this.applePay = applePay; return this; } - public Builder applePay(ApplePayCreateTokenResponse applePay) { + public Builder applePay(ApplePayToken applePay) { this.applePay = Optional.ofNullable(applePay); return this; } diff --git a/src/main/java/com/basistheory/types/ApplePayCreateTokenResponse.java b/src/main/java/com/basistheory/types/ApplePayMerchant.java similarity index 55% rename from src/main/java/com/basistheory/types/ApplePayCreateTokenResponse.java rename to src/main/java/com/basistheory/types/ApplePayMerchant.java index 56d0483..974a58b 100644 --- a/src/main/java/com/basistheory/types/ApplePayCreateTokenResponse.java +++ b/src/main/java/com/basistheory/types/ApplePayMerchant.java @@ -19,44 +19,32 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ApplePayCreateTokenResponse.Builder.class) -public final class ApplePayCreateTokenResponse { +@JsonDeserialize(builder = ApplePayMerchant.Builder.class) +public final class ApplePayMerchant { private final Optional id; - private final Optional type; - private final Optional tenantId; - private final Optional status; - - private final Optional expiresAt; + private final Optional merchantIdentifier; private final Optional createdBy; private final Optional createdAt; - private final Optional card; - private final Map additionalProperties; - private ApplePayCreateTokenResponse( + private ApplePayMerchant( Optional id, - Optional type, Optional tenantId, - Optional status, - Optional expiresAt, + Optional merchantIdentifier, Optional createdBy, Optional createdAt, - Optional card, Map additionalProperties) { this.id = id; - this.type = type; this.tenantId = tenantId; - this.status = status; - this.expiresAt = expiresAt; + this.merchantIdentifier = merchantIdentifier; this.createdBy = createdBy; this.createdAt = createdAt; - this.card = card; this.additionalProperties = additionalProperties; } @@ -65,24 +53,14 @@ public Optional getId() { return id; } - @JsonProperty("type") - public Optional getType() { - return type; - } - @JsonProperty("tenant_id") public Optional getTenantId() { return tenantId; } - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("expires_at") - public Optional getExpiresAt() { - return expiresAt; + @JsonProperty("merchant_identifier") + public Optional getMerchantIdentifier() { + return merchantIdentifier; } @JsonProperty("created_by") @@ -95,15 +73,10 @@ public Optional getCreatedAt() { return createdAt; } - @JsonProperty("card") - public Optional getCard() { - return card; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ApplePayCreateTokenResponse && equalTo((ApplePayCreateTokenResponse) other); + return other instanceof ApplePayMerchant && equalTo((ApplePayMerchant) other); } @JsonAnyGetter @@ -111,28 +84,17 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ApplePayCreateTokenResponse other) { + private boolean equalTo(ApplePayMerchant other) { return id.equals(other.id) - && type.equals(other.type) && tenantId.equals(other.tenantId) - && status.equals(other.status) - && expiresAt.equals(other.expiresAt) + && merchantIdentifier.equals(other.merchantIdentifier) && createdBy.equals(other.createdBy) - && createdAt.equals(other.createdAt) - && card.equals(other.card); + && createdAt.equals(other.createdAt); } @java.lang.Override public int hashCode() { - return Objects.hash( - this.id, - this.type, - this.tenantId, - this.status, - this.expiresAt, - this.createdBy, - this.createdAt, - this.card); + return Objects.hash(this.id, this.tenantId, this.merchantIdentifier, this.createdBy, this.createdAt); } @java.lang.Override @@ -148,34 +110,25 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); - private Optional type = Optional.empty(); - private Optional tenantId = Optional.empty(); - private Optional status = Optional.empty(); - - private Optional expiresAt = Optional.empty(); + private Optional merchantIdentifier = Optional.empty(); private Optional createdBy = Optional.empty(); private Optional createdAt = Optional.empty(); - private Optional card = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(ApplePayCreateTokenResponse other) { + public Builder from(ApplePayMerchant other) { id(other.getId()); - type(other.getType()); tenantId(other.getTenantId()); - status(other.getStatus()); - expiresAt(other.getExpiresAt()); + merchantIdentifier(other.getMerchantIdentifier()); createdBy(other.getCreatedBy()); createdAt(other.getCreatedAt()); - card(other.getCard()); return this; } @@ -190,17 +143,6 @@ public Builder id(String id) { return this; } - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - @JsonSetter(value = "tenant_id", nulls = Nulls.SKIP) public Builder tenantId(Optional tenantId) { this.tenantId = tenantId; @@ -212,25 +154,14 @@ public Builder tenantId(String tenantId) { return this; } - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); + @JsonSetter(value = "merchant_identifier", nulls = Nulls.SKIP) + public Builder merchantIdentifier(Optional merchantIdentifier) { + this.merchantIdentifier = merchantIdentifier; return this; } - @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) - public Builder expiresAt(Optional expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - public Builder expiresAt(OffsetDateTime expiresAt) { - this.expiresAt = Optional.ofNullable(expiresAt); + public Builder merchantIdentifier(String merchantIdentifier) { + this.merchantIdentifier = Optional.ofNullable(merchantIdentifier); return this; } @@ -256,20 +187,8 @@ public Builder createdAt(OffsetDateTime createdAt) { return this; } - @JsonSetter(value = "card", nulls = Nulls.SKIP) - public Builder card(Optional card) { - this.card = card; - return this; - } - - public Builder card(CardDetails card) { - this.card = Optional.ofNullable(card); - return this; - } - - public ApplePayCreateTokenResponse build() { - return new ApplePayCreateTokenResponse( - id, type, tenantId, status, expiresAt, createdBy, createdAt, card, additionalProperties); + public ApplePayMerchant build() { + return new ApplePayMerchant(id, tenantId, merchantIdentifier, createdBy, createdAt, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/ApplePayToken.java b/src/main/java/com/basistheory/types/ApplePayToken.java index 4bcca6d..fbf5ce9 100644 --- a/src/main/java/com/basistheory/types/ApplePayToken.java +++ b/src/main/java/com/basistheory/types/ApplePayToken.java @@ -45,6 +45,8 @@ public final class ApplePayToken { private final Optional authentication; + private final Optional fingerprint; + private final Map additionalProperties; private ApplePayToken( @@ -60,6 +62,7 @@ private ApplePayToken( Optional card, Optional data, Optional authentication, + Optional fingerprint, Map additionalProperties) { this.id = id; this.type = type; @@ -73,6 +76,7 @@ private ApplePayToken( this.card = card; this.data = data; this.authentication = authentication; + this.fingerprint = fingerprint; this.additionalProperties = additionalProperties; } @@ -136,6 +140,11 @@ public Optional getAuthentication() { return authentication; } + @JsonProperty("fingerprint") + public Optional getFingerprint() { + return fingerprint; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -159,7 +168,8 @@ private boolean equalTo(ApplePayToken other) { && modifiedAt.equals(other.modifiedAt) && card.equals(other.card) && data.equals(other.data) - && authentication.equals(other.authentication); + && authentication.equals(other.authentication) + && fingerprint.equals(other.fingerprint); } @java.lang.Override @@ -176,7 +186,8 @@ public int hashCode() { this.modifiedAt, this.card, this.data, - this.authentication); + this.authentication, + this.fingerprint); } @java.lang.Override @@ -214,6 +225,8 @@ public static final class Builder { private Optional authentication = Optional.empty(); + private Optional fingerprint = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -232,6 +245,7 @@ public Builder from(ApplePayToken other) { card(other.getCard()); data(other.getData()); authentication(other.getAuthentication()); + fingerprint(other.getFingerprint()); return this; } @@ -367,6 +381,17 @@ public Builder authentication(Authentication authentication) { return this; } + @JsonSetter(value = "fingerprint", nulls = Nulls.SKIP) + public Builder fingerprint(Optional fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public Builder fingerprint(String fingerprint) { + this.fingerprint = Optional.ofNullable(fingerprint); + return this; + } + public ApplePayToken build() { return new ApplePayToken( id, @@ -381,6 +406,7 @@ public ApplePayToken build() { card, data, authentication, + fingerprint, additionalProperties); } } diff --git a/src/main/java/com/basistheory/types/ClientEncryptionKeyMetadataResponse.java b/src/main/java/com/basistheory/types/ClientEncryptionKeyMetadataResponse.java index a52c27e..b0bdb49 100644 --- a/src/main/java/com/basistheory/types/ClientEncryptionKeyMetadataResponse.java +++ b/src/main/java/com/basistheory/types/ClientEncryptionKeyMetadataResponse.java @@ -21,25 +21,25 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ClientEncryptionKeyMetadataResponse.Builder.class) public final class ClientEncryptionKeyMetadataResponse { - private final Optional id; + private final Optional keyId; private final Optional expiresAt; private final Map additionalProperties; private ClientEncryptionKeyMetadataResponse( - Optional id, Optional expiresAt, Map additionalProperties) { - this.id = id; + Optional keyId, Optional expiresAt, Map additionalProperties) { + this.keyId = keyId; this.expiresAt = expiresAt; this.additionalProperties = additionalProperties; } - @JsonProperty("id") - public Optional getId() { - return id; + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; } - @JsonProperty("expiresAt") + @JsonProperty("expires_at") public Optional getExpiresAt() { return expiresAt; } @@ -57,12 +57,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ClientEncryptionKeyMetadataResponse other) { - return id.equals(other.id) && expiresAt.equals(other.expiresAt); + return keyId.equals(other.keyId) && expiresAt.equals(other.expiresAt); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.expiresAt); + return Objects.hash(this.keyId, this.expiresAt); } @java.lang.Override @@ -76,7 +76,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional id = Optional.empty(); + private Optional keyId = Optional.empty(); private Optional expiresAt = Optional.empty(); @@ -86,23 +86,23 @@ public static final class Builder { private Builder() {} public Builder from(ClientEncryptionKeyMetadataResponse other) { - id(other.getId()); + keyId(other.getKeyId()); expiresAt(other.getExpiresAt()); return this; } - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public Builder keyId(Optional keyId) { + this.keyId = keyId; return this; } - public Builder id(String id) { - this.id = Optional.ofNullable(id); + public Builder keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); return this; } - @JsonSetter(value = "expiresAt", nulls = Nulls.SKIP) + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public Builder expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; return this; @@ -114,7 +114,7 @@ public Builder expiresAt(OffsetDateTime expiresAt) { } public ClientEncryptionKeyMetadataResponse build() { - return new ClientEncryptionKeyMetadataResponse(id, expiresAt, additionalProperties); + return new ClientEncryptionKeyMetadataResponse(keyId, expiresAt, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/ClientEncryptionKeyResponse.java b/src/main/java/com/basistheory/types/ClientEncryptionKeyResponse.java index d6e0a0f..2efd27f 100644 --- a/src/main/java/com/basistheory/types/ClientEncryptionKeyResponse.java +++ b/src/main/java/com/basistheory/types/ClientEncryptionKeyResponse.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ClientEncryptionKeyResponse.Builder.class) public final class ClientEncryptionKeyResponse { - private final Optional id; + private final Optional keyId; private final Optional publicKeyPem; @@ -30,27 +30,27 @@ public final class ClientEncryptionKeyResponse { private final Map additionalProperties; private ClientEncryptionKeyResponse( - Optional id, + Optional keyId, Optional publicKeyPem, Optional expiresAt, Map additionalProperties) { - this.id = id; + this.keyId = keyId; this.publicKeyPem = publicKeyPem; this.expiresAt = expiresAt; this.additionalProperties = additionalProperties; } - @JsonProperty("id") - public Optional getId() { - return id; + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; } - @JsonProperty("publicKeyPEM") + @JsonProperty("public_key_pem") public Optional getPublicKeyPem() { return publicKeyPem; } - @JsonProperty("expiresAt") + @JsonProperty("expires_at") public Optional getExpiresAt() { return expiresAt; } @@ -67,12 +67,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(ClientEncryptionKeyResponse other) { - return id.equals(other.id) && publicKeyPem.equals(other.publicKeyPem) && expiresAt.equals(other.expiresAt); + return keyId.equals(other.keyId) + && publicKeyPem.equals(other.publicKeyPem) + && expiresAt.equals(other.expiresAt); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.publicKeyPem, this.expiresAt); + return Objects.hash(this.keyId, this.publicKeyPem, this.expiresAt); } @java.lang.Override @@ -86,7 +88,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional id = Optional.empty(); + private Optional keyId = Optional.empty(); private Optional publicKeyPem = Optional.empty(); @@ -98,24 +100,24 @@ public static final class Builder { private Builder() {} public Builder from(ClientEncryptionKeyResponse other) { - id(other.getId()); + keyId(other.getKeyId()); publicKeyPem(other.getPublicKeyPem()); expiresAt(other.getExpiresAt()); return this; } - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public Builder keyId(Optional keyId) { + this.keyId = keyId; return this; } - public Builder id(String id) { - this.id = Optional.ofNullable(id); + public Builder keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); return this; } - @JsonSetter(value = "publicKeyPEM", nulls = Nulls.SKIP) + @JsonSetter(value = "public_key_pem", nulls = Nulls.SKIP) public Builder publicKeyPem(Optional publicKeyPem) { this.publicKeyPem = publicKeyPem; return this; @@ -126,7 +128,7 @@ public Builder publicKeyPem(String publicKeyPem) { return this; } - @JsonSetter(value = "expiresAt", nulls = Nulls.SKIP) + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public Builder expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; return this; @@ -138,7 +140,7 @@ public Builder expiresAt(OffsetDateTime expiresAt) { } public ClientEncryptionKeyResponse build() { - return new ClientEncryptionKeyResponse(id, publicKeyPem, expiresAt, additionalProperties); + return new ClientEncryptionKeyResponse(keyId, publicKeyPem, expiresAt, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/GetTokens.java b/src/main/java/com/basistheory/types/GetTokens.java deleted file mode 100644 index 033b170..0000000 --- a/src/main/java/com/basistheory/types/GetTokens.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.basistheory.types; - -import com.basistheory.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -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 java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTokens.Builder.class) -public final class GetTokens { - private final Optional> id; - - private final Optional>> metadata; - - private final Optional page; - - private final Optional start; - - private final Optional size; - - private final Map additionalProperties; - - private GetTokens( - Optional> id, - Optional>> metadata, - Optional page, - Optional start, - Optional size, - Map additionalProperties) { - this.id = id; - this.metadata = metadata; - this.page = page; - this.start = start; - this.size = size; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional> getId() { - return id; - } - - @JsonProperty("metadata") - public Optional>> getMetadata() { - return metadata; - } - - @JsonProperty("page") - public Optional getPage() { - return page; - } - - @JsonProperty("start") - public Optional getStart() { - return start; - } - - @JsonProperty("size") - public Optional getSize() { - return size; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTokens && equalTo((GetTokens) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTokens other) { - return id.equals(other.id) - && metadata.equals(other.metadata) - && page.equals(other.page) - && start.equals(other.start) - && size.equals(other.size); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.metadata, this.page, this.start, this.size); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> id = Optional.empty(); - - private Optional>> metadata = Optional.empty(); - - private Optional page = Optional.empty(); - - private Optional start = Optional.empty(); - - private Optional size = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GetTokens other) { - id(other.getId()); - metadata(other.getMetadata()); - page(other.getPage()); - start(other.getStart()); - size(other.getSize()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional> id) { - this.id = id; - return this; - } - - public Builder id(List id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional>> metadata) { - this.metadata = metadata; - return this; - } - - public Builder metadata(Map> metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; - } - - @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(Optional page) { - this.page = page; - return this; - } - - public Builder page(Integer page) { - this.page = Optional.ofNullable(page); - return this; - } - - @JsonSetter(value = "start", nulls = Nulls.SKIP) - public Builder start(Optional start) { - this.start = start; - return this; - } - - public Builder start(String start) { - this.start = Optional.ofNullable(start); - return this; - } - - @JsonSetter(value = "size", nulls = Nulls.SKIP) - public Builder size(Optional size) { - this.size = size; - return this; - } - - public Builder size(Integer size) { - this.size = Optional.ofNullable(size); - return this; - } - - public GetTokens build() { - return new GetTokens(id, metadata, page, start, size, additionalProperties); - } - } -} diff --git a/src/main/java/com/basistheory/types/GooglePayCreateResponse.java b/src/main/java/com/basistheory/types/GooglePayCreateResponse.java index 92d5021..6cd131c 100644 --- a/src/main/java/com/basistheory/types/GooglePayCreateResponse.java +++ b/src/main/java/com/basistheory/types/GooglePayCreateResponse.java @@ -20,14 +20,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = GooglePayCreateResponse.Builder.class) public final class GooglePayCreateResponse { - private final Optional googlePay; + private final Optional googlePay; private final Optional tokenIntent; private final Map additionalProperties; private GooglePayCreateResponse( - Optional googlePay, + Optional googlePay, Optional tokenIntent, Map additionalProperties) { this.googlePay = googlePay; @@ -36,7 +36,7 @@ private GooglePayCreateResponse( } @JsonProperty("google_pay") - public Optional getGooglePay() { + public Optional getGooglePay() { return googlePay; } @@ -76,7 +76,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional googlePay = Optional.empty(); + private Optional googlePay = Optional.empty(); private Optional tokenIntent = Optional.empty(); @@ -92,12 +92,12 @@ public Builder from(GooglePayCreateResponse other) { } @JsonSetter(value = "google_pay", nulls = Nulls.SKIP) - public Builder googlePay(Optional googlePay) { + public Builder googlePay(Optional googlePay) { this.googlePay = googlePay; return this; } - public Builder googlePay(GooglePayCreateTokenResponse googlePay) { + public Builder googlePay(GooglePayToken googlePay) { this.googlePay = Optional.ofNullable(googlePay); return this; } diff --git a/src/main/java/com/basistheory/types/GooglePayCreateTokenResponse.java b/src/main/java/com/basistheory/types/GooglePayCreateTokenResponse.java deleted file mode 100644 index 1b358ea..0000000 --- a/src/main/java/com/basistheory/types/GooglePayCreateTokenResponse.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.basistheory.types; - -import com.basistheory.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -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 java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GooglePayCreateTokenResponse.Builder.class) -public final class GooglePayCreateTokenResponse { - private final Optional id; - - private final Optional tenantId; - - private final Optional status; - - private final Optional expiresAt; - - private final Optional createdBy; - - private final Optional createdAt; - - private final Optional card; - - private final Optional details; - - private final Map additionalProperties; - - private GooglePayCreateTokenResponse( - Optional id, - Optional tenantId, - Optional status, - Optional expiresAt, - Optional createdBy, - Optional createdAt, - Optional card, - Optional details, - Map additionalProperties) { - this.id = id; - this.tenantId = tenantId; - this.status = status; - this.expiresAt = expiresAt; - this.createdBy = createdBy; - this.createdAt = createdAt; - this.card = card; - this.details = details; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("tenant_id") - public Optional getTenantId() { - return tenantId; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("expires_at") - public Optional getExpiresAt() { - return expiresAt; - } - - @JsonProperty("created_by") - public Optional getCreatedBy() { - return createdBy; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @JsonProperty("card") - public Optional getCard() { - return card; - } - - @JsonProperty("details") - public Optional getDetails() { - return details; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GooglePayCreateTokenResponse && equalTo((GooglePayCreateTokenResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GooglePayCreateTokenResponse other) { - return id.equals(other.id) - && tenantId.equals(other.tenantId) - && status.equals(other.status) - && expiresAt.equals(other.expiresAt) - && createdBy.equals(other.createdBy) - && createdAt.equals(other.createdAt) - && card.equals(other.card) - && details.equals(other.details); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.tenantId, - this.status, - this.expiresAt, - this.createdBy, - this.createdAt, - this.card, - this.details); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional tenantId = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional expiresAt = Optional.empty(); - - private Optional createdBy = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional card = Optional.empty(); - - private Optional details = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GooglePayCreateTokenResponse other) { - id(other.getId()); - tenantId(other.getTenantId()); - status(other.getStatus()); - expiresAt(other.getExpiresAt()); - createdBy(other.getCreatedBy()); - createdAt(other.getCreatedAt()); - card(other.getCard()); - details(other.getDetails()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "tenant_id", nulls = Nulls.SKIP) - public Builder tenantId(Optional tenantId) { - this.tenantId = tenantId; - return this; - } - - public Builder tenantId(String tenantId) { - this.tenantId = Optional.ofNullable(tenantId); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) - public Builder expiresAt(Optional expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - public Builder expiresAt(OffsetDateTime expiresAt) { - this.expiresAt = Optional.ofNullable(expiresAt); - return this; - } - - @JsonSetter(value = "created_by", nulls = Nulls.SKIP) - public Builder createdBy(Optional createdBy) { - this.createdBy = createdBy; - return this; - } - - public Builder createdBy(String createdBy) { - this.createdBy = Optional.ofNullable(createdBy); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "card", nulls = Nulls.SKIP) - public Builder card(Optional card) { - this.card = card; - return this; - } - - public Builder card(CardDetails card) { - this.card = Optional.ofNullable(card); - return this; - } - - @JsonSetter(value = "details", nulls = Nulls.SKIP) - public Builder details(Optional details) { - this.details = details; - return this; - } - - public Builder details(TokenServiceProviderDetails details) { - this.details = Optional.ofNullable(details); - return this; - } - - public GooglePayCreateTokenResponse build() { - return new GooglePayCreateTokenResponse( - id, tenantId, status, expiresAt, createdBy, createdAt, card, details, additionalProperties); - } - } -} diff --git a/src/main/java/com/basistheory/types/GooglePayToken.java b/src/main/java/com/basistheory/types/GooglePayToken.java index 124c46c..cc86a45 100644 --- a/src/main/java/com/basistheory/types/GooglePayToken.java +++ b/src/main/java/com/basistheory/types/GooglePayToken.java @@ -45,6 +45,8 @@ public final class GooglePayToken { private final Optional details; + private final Optional fingerprint; + private final Map additionalProperties; private GooglePayToken( @@ -60,6 +62,7 @@ private GooglePayToken( Optional data, Optional authentication, Optional details, + Optional fingerprint, Map additionalProperties) { this.id = id; this.tenantId = tenantId; @@ -73,6 +76,7 @@ private GooglePayToken( this.data = data; this.authentication = authentication; this.details = details; + this.fingerprint = fingerprint; this.additionalProperties = additionalProperties; } @@ -136,6 +140,11 @@ public Optional getDetails() { return details; } + @JsonProperty("fingerprint") + public Optional getFingerprint() { + return fingerprint; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -159,7 +168,8 @@ private boolean equalTo(GooglePayToken other) { && card.equals(other.card) && data.equals(other.data) && authentication.equals(other.authentication) - && details.equals(other.details); + && details.equals(other.details) + && fingerprint.equals(other.fingerprint); } @java.lang.Override @@ -176,7 +186,8 @@ public int hashCode() { this.card, this.data, this.authentication, - this.details); + this.details, + this.fingerprint); } @java.lang.Override @@ -214,6 +225,8 @@ public static final class Builder { private Optional details = Optional.empty(); + private Optional fingerprint = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -232,6 +245,7 @@ public Builder from(GooglePayToken other) { data(other.getData()); authentication(other.getAuthentication()); details(other.getDetails()); + fingerprint(other.getFingerprint()); return this; } @@ -367,6 +381,17 @@ public Builder details(TokenServiceProviderDetails details) { return this; } + @JsonSetter(value = "fingerprint", nulls = Nulls.SKIP) + public Builder fingerprint(Optional fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + public Builder fingerprint(String fingerprint) { + this.fingerprint = Optional.ofNullable(fingerprint); + return this; + } + public GooglePayToken build() { return new GooglePayToken( id, @@ -381,6 +406,7 @@ public GooglePayToken build() { data, authentication, details, + fingerprint, additionalProperties); } } diff --git a/src/main/java/com/basistheory/types/Proxy.java b/src/main/java/com/basistheory/types/Proxy.java index 8606784..2f6360f 100644 --- a/src/main/java/com/basistheory/types/Proxy.java +++ b/src/main/java/com/basistheory/types/Proxy.java @@ -32,6 +32,8 @@ public final class Proxy { private final Optional destinationUrl; + private final Optional state; + private final Optional requestReactorId; private final Optional responseReactorId; @@ -72,6 +74,7 @@ private Proxy( Optional tenantId, Optional name, Optional destinationUrl, + Optional state, Optional requestReactorId, Optional responseReactorId, Optional requireAuth, @@ -94,6 +97,7 @@ private Proxy( this.tenantId = tenantId; this.name = name; this.destinationUrl = destinationUrl; + this.state = state; this.requestReactorId = requestReactorId; this.responseReactorId = responseReactorId; this.requireAuth = requireAuth; @@ -138,6 +142,11 @@ public Optional getDestinationUrl() { return destinationUrl; } + @JsonProperty("state") + public Optional getState() { + return state; + } + @JsonProperty("request_reactor_id") public Optional getRequestReactorId() { return requestReactorId; @@ -235,6 +244,7 @@ private boolean equalTo(Proxy other) { && tenantId.equals(other.tenantId) && name.equals(other.name) && destinationUrl.equals(other.destinationUrl) + && state.equals(other.state) && requestReactorId.equals(other.requestReactorId) && responseReactorId.equals(other.responseReactorId) && requireAuth.equals(other.requireAuth) @@ -261,6 +271,7 @@ public int hashCode() { this.tenantId, this.name, this.destinationUrl, + this.state, this.requestReactorId, this.responseReactorId, this.requireAuth, @@ -300,6 +311,8 @@ public static final class Builder { private Optional destinationUrl = Optional.empty(); + private Optional state = Optional.empty(); + private Optional requestReactorId = Optional.empty(); private Optional responseReactorId = Optional.empty(); @@ -343,6 +356,7 @@ public Builder from(Proxy other) { tenantId(other.getTenantId()); name(other.getName()); destinationUrl(other.getDestinationUrl()); + state(other.getState()); requestReactorId(other.getRequestReactorId()); responseReactorId(other.getResponseReactorId()); requireAuth(other.getRequireAuth()); @@ -417,6 +431,17 @@ public Builder destinationUrl(String destinationUrl) { return this; } + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + @JsonSetter(value = "request_reactor_id", nulls = Nulls.SKIP) public Builder requestReactorId(Optional requestReactorId) { this.requestReactorId = requestReactorId; @@ -600,6 +625,7 @@ public Proxy build() { tenantId, name, destinationUrl, + state, requestReactorId, responseReactorId, requireAuth, diff --git a/src/main/java/com/basistheory/types/ProxyTransformOptions.java b/src/main/java/com/basistheory/types/ProxyTransformOptions.java index 7095c44..8be3a3a 100644 --- a/src/main/java/com/basistheory/types/ProxyTransformOptions.java +++ b/src/main/java/com/basistheory/types/ProxyTransformOptions.java @@ -28,6 +28,10 @@ public final class ProxyTransformOptions { private final Optional location; + private final Optional runtime; + + private final Optional>> dependencies; + private final Map additionalProperties; private ProxyTransformOptions( @@ -35,11 +39,15 @@ private ProxyTransformOptions( Optional identifier, Optional value, Optional location, + Optional runtime, + Optional>> dependencies, Map additionalProperties) { this.token = token; this.identifier = identifier; this.value = value; this.location = location; + this.runtime = runtime; + this.dependencies = dependencies; this.additionalProperties = additionalProperties; } @@ -63,6 +71,16 @@ public Optional getLocation() { return location; } + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + @JsonProperty("dependencies") + public Optional>> getDependencies() { + return dependencies; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +96,14 @@ private boolean equalTo(ProxyTransformOptions other) { return token.equals(other.token) && identifier.equals(other.identifier) && value.equals(other.value) - && location.equals(other.location); + && location.equals(other.location) + && runtime.equals(other.runtime) + && dependencies.equals(other.dependencies); } @java.lang.Override public int hashCode() { - return Objects.hash(this.token, this.identifier, this.value, this.location); + return Objects.hash(this.token, this.identifier, this.value, this.location, this.runtime, this.dependencies); } @java.lang.Override @@ -105,6 +125,10 @@ public static final class Builder { private Optional location = Optional.empty(); + private Optional runtime = Optional.empty(); + + private Optional>> dependencies = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +139,8 @@ public Builder from(ProxyTransformOptions other) { identifier(other.getIdentifier()); value(other.getValue()); location(other.getLocation()); + runtime(other.getRuntime()); + dependencies(other.getDependencies()); return this; } @@ -162,8 +188,31 @@ public Builder location(String location) { return this; } + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional>> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map> dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + public ProxyTransformOptions build() { - return new ProxyTransformOptions(token, identifier, value, location, additionalProperties); + return new ProxyTransformOptions( + token, identifier, value, location, runtime, dependencies, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/Reactor.java b/src/main/java/com/basistheory/types/Reactor.java index 709f488..3c79842 100644 --- a/src/main/java/com/basistheory/types/Reactor.java +++ b/src/main/java/com/basistheory/types/Reactor.java @@ -29,6 +29,8 @@ public final class Reactor { private final Optional formula; + private final Optional state; + private final Optional code; private final Optional application; @@ -43,10 +45,10 @@ public final class Reactor { private final Optional>> configuration; - private final Optional>> dependencies; - private final Optional runtime; + private final Optional options; + private final Map additionalProperties; private Reactor( @@ -54,6 +56,7 @@ private Reactor( Optional tenantId, Optional name, Optional formula, + Optional state, Optional code, Optional application, Optional createdBy, @@ -61,13 +64,14 @@ private Reactor( Optional modifiedBy, Optional modifiedAt, Optional>> configuration, - Optional>> dependencies, Optional runtime, + Optional options, Map additionalProperties) { this.id = id; this.tenantId = tenantId; this.name = name; this.formula = formula; + this.state = state; this.code = code; this.application = application; this.createdBy = createdBy; @@ -75,8 +79,8 @@ private Reactor( this.modifiedBy = modifiedBy; this.modifiedAt = modifiedAt; this.configuration = configuration; - this.dependencies = dependencies; this.runtime = runtime; + this.options = options; this.additionalProperties = additionalProperties; } @@ -100,6 +104,11 @@ public Optional getFormula() { return formula; } + @JsonProperty("state") + public Optional getState() { + return state; + } + @JsonProperty("code") public Optional getCode() { return code; @@ -135,16 +144,16 @@ public Optional>> getConfiguration() { return configuration; } - @JsonProperty("dependencies") - public Optional>> getDependencies() { - return dependencies; - } - @JsonProperty("runtime") public Optional getRuntime() { return runtime; } + @JsonProperty("options") + public Optional getOptions() { + return options; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -161,6 +170,7 @@ private boolean equalTo(Reactor other) { && tenantId.equals(other.tenantId) && name.equals(other.name) && formula.equals(other.formula) + && state.equals(other.state) && code.equals(other.code) && application.equals(other.application) && createdBy.equals(other.createdBy) @@ -168,8 +178,8 @@ private boolean equalTo(Reactor other) { && modifiedBy.equals(other.modifiedBy) && modifiedAt.equals(other.modifiedAt) && configuration.equals(other.configuration) - && dependencies.equals(other.dependencies) - && runtime.equals(other.runtime); + && runtime.equals(other.runtime) + && options.equals(other.options); } @java.lang.Override @@ -179,6 +189,7 @@ public int hashCode() { this.tenantId, this.name, this.formula, + this.state, this.code, this.application, this.createdBy, @@ -186,8 +197,8 @@ public int hashCode() { this.modifiedBy, this.modifiedAt, this.configuration, - this.dependencies, - this.runtime); + this.runtime, + this.options); } @java.lang.Override @@ -209,6 +220,8 @@ public static final class Builder { private Optional formula = Optional.empty(); + private Optional state = Optional.empty(); + private Optional code = Optional.empty(); private Optional application = Optional.empty(); @@ -223,10 +236,10 @@ public static final class Builder { private Optional>> configuration = Optional.empty(); - private Optional>> dependencies = Optional.empty(); - private Optional runtime = Optional.empty(); + private Optional options = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -237,6 +250,7 @@ public Builder from(Reactor other) { tenantId(other.getTenantId()); name(other.getName()); formula(other.getFormula()); + state(other.getState()); code(other.getCode()); application(other.getApplication()); createdBy(other.getCreatedBy()); @@ -244,8 +258,8 @@ public Builder from(Reactor other) { modifiedBy(other.getModifiedBy()); modifiedAt(other.getModifiedAt()); configuration(other.getConfiguration()); - dependencies(other.getDependencies()); runtime(other.getRuntime()); + options(other.getOptions()); return this; } @@ -293,6 +307,17 @@ public Builder formula(ReactorFormula formula) { return this; } + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + @JsonSetter(value = "code", nulls = Nulls.SKIP) public Builder code(Optional code) { this.code = code; @@ -370,25 +395,25 @@ public Builder configuration(Map> configuration) { return this; } - @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional>> dependencies) { - this.dependencies = dependencies; + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; return this; } - public Builder dependencies(Map> dependencies) { - this.dependencies = Optional.ofNullable(dependencies); + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); return this; } - @JsonSetter(value = "runtime", nulls = Nulls.SKIP) - public Builder runtime(Optional runtime) { - this.runtime = runtime; + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; return this; } - public Builder runtime(String runtime) { - this.runtime = Optional.ofNullable(runtime); + public Builder options(RuntimeOptions options) { + this.options = Optional.ofNullable(options); return this; } @@ -398,6 +423,7 @@ public Reactor build() { tenantId, name, formula, + state, code, application, createdBy, @@ -405,8 +431,8 @@ public Reactor build() { modifiedBy, modifiedAt, configuration, - dependencies, runtime, + options, additionalProperties); } } diff --git a/src/main/java/com/basistheory/types/RuntimeOptions.java b/src/main/java/com/basistheory/types/RuntimeOptions.java new file mode 100644 index 0000000..dcbfa60 --- /dev/null +++ b/src/main/java/com/basistheory/types/RuntimeOptions.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.basistheory.types; + +import com.basistheory.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RuntimeOptions.Builder.class) +public final class RuntimeOptions { + private final Optional>> dependencies; + + private final Map additionalProperties; + + private RuntimeOptions( + Optional>> dependencies, Map additionalProperties) { + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("dependencies") + public Optional>> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RuntimeOptions && equalTo((RuntimeOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RuntimeOptions other) { + return dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional>> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RuntimeOptions other) { + dependencies(other.getDependencies()); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional>> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map> dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public RuntimeOptions build() { + return new RuntimeOptions(dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/basistheory/types/ThreeDsAuthentication.java b/src/main/java/com/basistheory/types/ThreeDsAuthentication.java index 000b55f..8d85ef6 100644 --- a/src/main/java/com/basistheory/types/ThreeDsAuthentication.java +++ b/src/main/java/com/basistheory/types/ThreeDsAuthentication.java @@ -33,6 +33,8 @@ public final class ThreeDsAuthentication { private final Optional acsTransactionId; + private final Optional acsOperatorId; + private final Optional dsTransactionId; private final Optional sdkTransactionId; @@ -96,6 +98,7 @@ private ThreeDsAuthentication( Optional sessionId, Optional threedsVersion, Optional acsTransactionId, + Optional acsOperatorId, Optional dsTransactionId, Optional sdkTransactionId, Optional acsReferenceNumber, @@ -130,6 +133,7 @@ private ThreeDsAuthentication( this.sessionId = sessionId; this.threedsVersion = threedsVersion; this.acsTransactionId = acsTransactionId; + this.acsOperatorId = acsOperatorId; this.dsTransactionId = dsTransactionId; this.sdkTransactionId = sdkTransactionId; this.acsReferenceNumber = acsReferenceNumber; @@ -190,6 +194,11 @@ public Optional getAcsTransactionId() { return acsTransactionId; } + @JsonProperty("acs_operator_id") + public Optional getAcsOperatorId() { + return acsOperatorId; + } + @JsonProperty("ds_transaction_id") public Optional getDsTransactionId() { return dsTransactionId; @@ -343,6 +352,7 @@ private boolean equalTo(ThreeDsAuthentication other) { && sessionId.equals(other.sessionId) && threedsVersion.equals(other.threedsVersion) && acsTransactionId.equals(other.acsTransactionId) + && acsOperatorId.equals(other.acsOperatorId) && dsTransactionId.equals(other.dsTransactionId) && sdkTransactionId.equals(other.sdkTransactionId) && acsReferenceNumber.equals(other.acsReferenceNumber) @@ -381,6 +391,7 @@ public int hashCode() { this.sessionId, this.threedsVersion, this.acsTransactionId, + this.acsOperatorId, this.dsTransactionId, this.sdkTransactionId, this.acsReferenceNumber, @@ -433,6 +444,8 @@ public static final class Builder { private Optional acsTransactionId = Optional.empty(); + private Optional acsOperatorId = Optional.empty(); + private Optional dsTransactionId = Optional.empty(); private Optional sdkTransactionId = Optional.empty(); @@ -499,6 +512,7 @@ public Builder from(ThreeDsAuthentication other) { sessionId(other.getSessionId()); threedsVersion(other.getThreedsVersion()); acsTransactionId(other.getAcsTransactionId()); + acsOperatorId(other.getAcsOperatorId()); dsTransactionId(other.getDsTransactionId()); sdkTransactionId(other.getSdkTransactionId()); acsReferenceNumber(other.getAcsReferenceNumber()); @@ -595,6 +609,17 @@ public Builder acsTransactionId(String acsTransactionId) { return this; } + @JsonSetter(value = "acs_operator_id", nulls = Nulls.SKIP) + public Builder acsOperatorId(Optional acsOperatorId) { + this.acsOperatorId = acsOperatorId; + return this; + } + + public Builder acsOperatorId(String acsOperatorId) { + this.acsOperatorId = Optional.ofNullable(acsOperatorId); + return this; + } + @JsonSetter(value = "ds_transaction_id", nulls = Nulls.SKIP) public Builder dsTransactionId(Optional dsTransactionId) { this.dsTransactionId = dsTransactionId; @@ -900,6 +925,7 @@ public ThreeDsAuthentication build() { sessionId, threedsVersion, acsTransactionId, + acsOperatorId, dsTransactionId, sdkTransactionId, acsReferenceNumber, diff --git a/src/main/java/com/basistheory/types/TokenPaginatedList.java b/src/main/java/com/basistheory/types/TokenPaginatedList.java deleted file mode 100644 index 9bdb790..0000000 --- a/src/main/java/com/basistheory/types/TokenPaginatedList.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.basistheory.types; - -import com.basistheory.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -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 java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokenPaginatedList.Builder.class) -public final class TokenPaginatedList { - private final Optional pagination; - - private final Optional> data; - - private final Map additionalProperties; - - private TokenPaginatedList( - Optional pagination, Optional> data, Map additionalProperties) { - this.pagination = pagination; - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pagination") - public Optional getPagination() { - return pagination; - } - - @JsonProperty("data") - public Optional> getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TokenPaginatedList && equalTo((TokenPaginatedList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TokenPaginatedList other) { - return pagination.equals(other.pagination) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pagination, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional pagination = Optional.empty(); - - private Optional> data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TokenPaginatedList other) { - pagination(other.getPagination()); - data(other.getData()); - return this; - } - - @JsonSetter(value = "pagination", nulls = Nulls.SKIP) - public Builder pagination(Optional pagination) { - this.pagination = pagination; - return this; - } - - public Builder pagination(Pagination pagination) { - this.pagination = Optional.ofNullable(pagination); - return this; - } - - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public Builder data(Optional> data) { - this.data = data; - return this; - } - - public Builder data(List data) { - this.data = Optional.ofNullable(data); - return this; - } - - public TokenPaginatedList build() { - return new TokenPaginatedList(pagination, data, additionalProperties); - } - } -} From d4daa679b565e53e9705dfacf5390332b2ed9064 Mon Sep 17 00:00:00 2001 From: Washington Alencar Date: Wed, 29 Oct 2025 18:14:33 -0300 Subject: [PATCH 2/3] feat: fixing client key test --- src/test/java/com/basistheory/TestClient.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/basistheory/TestClient.java b/src/test/java/com/basistheory/TestClient.java index dd738eb..e27a63c 100644 --- a/src/test/java/com/basistheory/TestClient.java +++ b/src/test/java/com/basistheory/TestClient.java @@ -189,13 +189,13 @@ public void shouldSupportKeysLifecycle() { try { ClientEncryptionKeyResponse createdKey = keysClient.create().join(); - assertTrue(createdKey.getId().isPresent(), "Key ID should be present"); - String keyId = createdKey.getId().get(); + assertTrue(createdKey.getKeyId().isPresent(), "Key ID should be present"); + String keyId = createdKey.getKeyId().get(); assertTrue(createdKey.getPublicKeyPem().isPresent(), "Key value should not be null"); ClientEncryptionKeyMetadataResponse retrievedKey = keysClient.get(keyId).join(); - assertTrue(retrievedKey.getId().isPresent(), "Retrieved key ID should be present"); - assertEquals(keyId, retrievedKey.getId().get(), "Retrieved key ID should match created key ID"); + assertTrue(retrievedKey.getKeyId().isPresent(), "Retrieved key ID should be present"); + assertEquals(keyId, retrievedKey.getKeyId().get(), "Retrieved key ID should match created key ID"); assertTrue(retrievedKey.getExpiresAt().isPresent(), "Created at timestamp should not be null"); List keys = keysClient.list().join(); From be225543992b7062d90d21e70e8fa6d98c1a43eb Mon Sep 17 00:00:00 2001 From: Washington Alencar Date: Wed, 29 Oct 2025 18:18:01 -0300 Subject: [PATCH 3/3] feat: fixing client keys test --- src/test/java/com/basistheory/TestClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/basistheory/TestClient.java b/src/test/java/com/basistheory/TestClient.java index e27a63c..bb3dba4 100644 --- a/src/test/java/com/basistheory/TestClient.java +++ b/src/test/java/com/basistheory/TestClient.java @@ -199,7 +199,7 @@ public void shouldSupportKeysLifecycle() { assertTrue(retrievedKey.getExpiresAt().isPresent(), "Created at timestamp should not be null"); List keys = keysClient.list().join(); - assertTrue(keys.stream().anyMatch(k -> k.getId().get().equals(keyId)), + assertTrue(keys.stream().anyMatch(k -> k.getKeyId().get().equals(keyId)), "Created key should be in the list of keys"); keysClient.delete(keyId).join();