diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 89e363e7..b339e746 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,18 @@ lockVersion: 2.0.0 id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119 management: - docChecksum: 95b80b77c1324ffe39698b605e4abf83 + docChecksum: 95b2a00eddd40c769875466ea4574c24 docVersion: 1.0.0 - speakeasyVersion: 1.700.2 - generationVersion: 2.801.2 - releaseVersion: 2.16.21 - configChecksum: 2a8dcf19eaa348429ee0980126d94c54 + speakeasyVersion: 1.703.0 + generationVersion: 2.803.3 + releaseVersion: 2.16.22 + configChecksum: 79ab37c5459b3d0f960b9cd9b028814e repoURL: https://github.com/gr4vy/gr4vy-java.git published: true persistentEdits: - generation_id: 4772aa82-39cb-4c59-b067-2c9747a9745e - pristine_commit_hash: 30daf61fef750dfa747560594077086cc56252fa - pristine_tree_hash: 409c8eff20ecc014b33a1be4633f461361fc5eba + generation_id: ad76695a-f6ae-47d2-8400-1f41aecf81bc + pristine_commit_hash: e8881a546ece82c329212a3a1d3b6b0b01aaf8a6 + pristine_tree_hash: 34e9bf06782dbe4999392b007173ef55c6138027 features: java: additionalDependencies: 0.1.0 @@ -587,6 +587,22 @@ trackedFiles: id: 66caf1e4a763 last_write_checksum: sha1:8fef888caf70a10951f3050057b85dcfc1c58c43 pristine_git_object: 2c3c53b90b88911f1bd1ddeadb18970f1871f7bd + docs/models/components/MerchantAccountThreeDSConfiguration.md: + id: 28adba2fa69e + last_write_checksum: sha1:7dbf47aeee7ba50e3161cb0b8e982bac1a64a3a9 + pristine_git_object: 43adb72c2501502d737c002b1cd0808c5d4836eb + docs/models/components/MerchantAccountThreeDSConfigurationCreate.md: + id: 71153c55fa33 + last_write_checksum: sha1:c572769412e9d158c268e17f9e03599f7f00ef23 + pristine_git_object: a17d57a9477c3423e0748959c68aa85794be17ec + docs/models/components/MerchantAccountThreeDSConfigurationUpdate.md: + id: 6a7f63f1aa9e + last_write_checksum: sha1:738cca2d9ce44c753417f9c35f03c594db2f45b4 + pristine_git_object: 0ae248147654d964f5aaae886def8ffe0ad290c9 + docs/models/components/MerchantAccountThreeDSConfigurations.md: + id: 82cbeba7387f + last_write_checksum: sha1:f6df2f60acef9735dee7a1ebeb2ea6d6d22af57c + pristine_git_object: 7e614985f9499e0ed1baa99697804c76c05ca3db docs/models/components/MerchantAccountUpdate.md: id: 9709bd5efde9 last_write_checksum: sha1:5f32d5b3add1662bd020cf9f526484642953d609 @@ -1373,12 +1389,12 @@ trackedFiles: pristine_git_object: 592e26d087aebedcb3eaddfa57b03aa6ebf1f3fa docs/models/operations/CaptureTransactionRequest.md: id: bd8a5867b0ee - last_write_checksum: sha1:3c10961edafd9c1d396aef701c6cca7e7682dac7 - pristine_git_object: b6be70b219ee42388e561983034c55deef98a1bb + last_write_checksum: sha1:0521687b801caa43ec1167c464bddec0bb269c8f + pristine_git_object: d53a6a1d4cfc0ccd18c87d88219dcfdf754b8bbd docs/models/operations/CaptureTransactionResponse.md: id: 15185e7edce8 - last_write_checksum: sha1:e448e952860836ee1ae86969325f7d66e580ee97 - pristine_git_object: 0ab083e7f5f549dc6e289f65e2bbf31374413f54 + last_write_checksum: sha1:17519a47f81114441f743197f1312440e51b0905 + pristine_git_object: d605509f75d866845a7ac47916248f0d3e89a6b5 docs/models/operations/ConfigureDigitalWalletRequest.md: id: abf82b2a2935 last_write_checksum: sha1:2deab98504e21048bb686f0cb39a164b6e4cc255 @@ -1515,6 +1531,14 @@ trackedFiles: id: 80b78312302e last_write_checksum: sha1:a6fbbd6f10ba12ed1910f077b6e7c138655b4ebc pristine_git_object: 6e2a62c3e0a0399385979b8c075e0704e399bcb1 + docs/models/operations/CreateThreeDsConfigurationRequest.md: + id: e8a8e5f4f247 + last_write_checksum: sha1:f919bf4bc5b71300da98ff33e51727dfa1bd200c + pristine_git_object: fcd49e2672a06d8cf3a4231aee5f93250d023131 + docs/models/operations/CreateThreeDsConfigurationResponse.md: + id: 088eee0b255a + last_write_checksum: sha1:21285da86a5bc6027b898ee8bf2ab89e77e10e64 + pristine_git_object: 073c457209ad4ca845d7112c9b567f19a70d3a27 docs/models/operations/CreateThreeDsScenarioRequest.md: id: b37202bc7c0d last_write_checksum: sha1:8a74de1360c83a68008a77d509472c6cf9b5daa5 @@ -1611,6 +1635,14 @@ trackedFiles: id: 9c15a2891f67 last_write_checksum: sha1:ab9b4c0cca958b8d7890e20ecaaf8e885988eacd pristine_git_object: a73bdc33921ce219bd05f8e259c9a174578072d1 + docs/models/operations/DeleteThreeDsConfigurationRequest.md: + id: 86ab20cc22f6 + last_write_checksum: sha1:b47b01bd5938de4ccfecbf2b2a1ce610b8c73b21 + pristine_git_object: 3553633070c1229a49d5c2dd533ed844b034ab9d + docs/models/operations/DeleteThreeDsConfigurationResponse.md: + id: 4fb7a0bdffbe + last_write_checksum: sha1:f6dd96cc75cd5d9b60f60b7c2cc45b8d2a854b41 + pristine_git_object: 9295cb0507f65aaaf4cd00c5549f35d5a178ec32 docs/models/operations/DeleteThreeDsScenarioRequest.md: id: 4bc02e1e5e8f last_write_checksum: sha1:f7182aff058527f9b1fe44d2eee28f67362513e4 @@ -1619,6 +1651,14 @@ trackedFiles: id: 7f1e76415817 last_write_checksum: sha1:fe4e4504fd9e41c561224c1fac0be3a25b63f436 pristine_git_object: 202208e9ee3aee152836887751779397d0cf2d69 + docs/models/operations/EditThreeDsConfigurationRequest.md: + id: ec743e7e1594 + last_write_checksum: sha1:561d0203f362328ee00051bfc654b1497e27aee8 + pristine_git_object: 3c0440985108b3c7c8c66d5618b5dbe23ee049fe + docs/models/operations/EditThreeDsConfigurationResponse.md: + id: 1b8e57607989 + last_write_checksum: sha1:43e7d57b5c9a5550dcea0abc4eff64175cfb0d6c + pristine_git_object: c543ae06c05fbad967aeaf1847df6b87e0ca5bcf docs/models/operations/ExpirePaymentLinkRequest.md: id: 7d70574d662b last_write_checksum: sha1:34be46ef77ea8d2bf410ba769e8572e6f431eaae @@ -1669,8 +1709,8 @@ trackedFiles: pristine_git_object: 784306c6f4b201360fcb5f771c8624469a321a7e docs/models/operations/GetMerchantAccountRequest.md: id: 129364c6cc46 - last_write_checksum: sha1:42c2fe3d284a23d1af9c7ec54c40c309f8c8a023 - pristine_git_object: 2146fa140b7b655045e026c266becba009697bb8 + last_write_checksum: sha1:69f80ba372560c690bc25089cdaa9c24f9957cec + pristine_git_object: b6088058b550521df92742158a74e515d42e5c4b docs/models/operations/GetMerchantAccountResponse.md: id: 925d9198a067 last_write_checksum: sha1:08577c47c685ae52eeb551df90a10d70f4620e65 @@ -1939,6 +1979,14 @@ trackedFiles: id: 5a96a588a01d last_write_checksum: sha1:a820a9985e8bc8784387ec33a8eb0317e885f002 pristine_git_object: 192a3b88d50e0e622849209d0499dc6c0dd25862 + docs/models/operations/ListThreeDsConfigurationsRequest.md: + id: 3102e3f86d88 + last_write_checksum: sha1:72431be2116957b6775fa5df77cfffb85c5ebb82 + pristine_git_object: 2061f041cd8310dbfc95a54d9a8967f1f055908d + docs/models/operations/ListThreeDsConfigurationsResponse.md: + id: c8a8613cd819 + last_write_checksum: sha1:cba42665e288ac52057a8646c7a101d048635d21 + pristine_git_object: 694935ca31d81154d8fd827ebae0a05dfb9dd091 docs/models/operations/ListTransactionActionsRequest.md: id: d243da14c657 last_write_checksum: sha1:855f68945e8509a3de59d730d71201ab5b5a3a4e @@ -1991,14 +2039,14 @@ trackedFiles: id: 454408eca378 last_write_checksum: sha1:c1e1b8539df7bd582116201a2b36895430983f90 pristine_git_object: 7501f6bbf3f8b6c7063aa6ccbacd24c1fedbee0b + docs/models/operations/Response200CaptureTransaction.md: + id: 444f19568825 + last_write_checksum: sha1:45e7a457f3a381a7fe3768d9ed3172ead5852b78 + pristine_git_object: 795243387b49908ed57ef48947abf368cab095c6 docs/models/operations/Response200VoidTransaction.md: id: 4a5ba792fc53 last_write_checksum: sha1:f1c6f8230c7c4a9e3407bd4c09e744d30ffc42f6 pristine_git_object: d31ea19561a52a8ffbb5b104c9f198396b490111 - docs/models/operations/ResponseCaptureTransaction.md: - id: 285152d8fca3 - last_write_checksum: sha1:fa6b627ea1c3c95791c56f55480e9aaf1c03c008 - pristine_git_object: b5eab7d2b6353db1c2d6a62b814eae353e5aba1a docs/models/operations/ResumePaymentMethodNetworkTokenRequest.md: id: 1d7edc017549 last_write_checksum: sha1:262ebdecb43bd056c2858d16465300e6938b833f @@ -2065,8 +2113,8 @@ trackedFiles: pristine_git_object: 6c43321bff80e9c41008e3ef76b714c94f3099e8 docs/models/operations/UpdateMerchantAccountRequest.md: id: e4cdc98e7917 - last_write_checksum: sha1:ee5197befb255e8ea1e87ff6028041a3375c804a - pristine_git_object: 032fd9dd2ba1c6360312d37e53ab8dcd7aaad289 + last_write_checksum: sha1:11465036ab70586bb8f7ce81a99a436d17649dbe + pristine_git_object: 1c7680d5143f105b1435b90d26f59ae2bdc607c9 docs/models/operations/UpdateMerchantAccountResponse.md: id: 8a19aa9101e6 last_write_checksum: sha1:bcc7983eced9dd10d1fcee7d697c3017baeb905f @@ -2185,8 +2233,8 @@ trackedFiles: pristine_git_object: e56d220e9aa7de67c7893b0c5caea6b1d50dc3b6 docs/sdks/merchantaccounts/README.md: id: 468eec4fc203 - last_write_checksum: sha1:8b81c99329f72b4ab17523b00fe37b38ef77f6cf - pristine_git_object: e28cdfb292f2852c9837c79c86ce2ac2a87dc9b0 + last_write_checksum: sha1:264901300e8622c6e668a7c55ba61b951b585832 + pristine_git_object: 22ca292241bc6113b49cae64b8acc918fce327b7 docs/sdks/networktokens/README.md: id: 4c1c913867c5 last_write_checksum: sha1:f5dd36976b25acea129b6c88d829749b086ec4e6 @@ -2243,14 +2291,18 @@ trackedFiles: id: 4e0fcdcca80c last_write_checksum: sha1:36fe5be93557008034d9bb2cc12f1939acbcbd75 pristine_git_object: db63346cfaccd51ee64210a000874c63d121cda3 + docs/sdks/threedsconfiguration/README.md: + id: 86aa349ed0d5 + last_write_checksum: sha1:6522c02d5606f9547e8d4606290d190200abf562 + pristine_git_object: 486e2a77e0899d422d004f32d28733af8780b96b docs/sdks/threedsscenarios/README.md: id: 81ff4c3f8215 last_write_checksum: sha1:1a2c770bf2a1b02010ab22c87b398105eaef58f2 pristine_git_object: 6a3bd7b0e0d11eb9541b236c78555a101337f743 docs/sdks/transactions/README.md: id: 85592abe3c6b - last_write_checksum: sha1:f83432222c0c0f502bc5759d95e52ccb2ff7e87e - pristine_git_object: 146605f3903b476df9054865b7dff0baedba682f + last_write_checksum: sha1:44cd24ad4266134de731046985128ad42fdc26a8 + pristine_git_object: 6c0fd0aea7ca7990e45ed1edd23b685feae26854 docs/sdks/transactionsrefunds/README.md: id: c6a0400f5020 last_write_checksum: sha1:02f3b80de594917017ad64de59c81166afda85a1 @@ -2261,8 +2313,8 @@ trackedFiles: pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:3eb24e1aee7c10b2bd2116a8ec2233646b56d56c - pristine_git_object: 518a6a4ab0dc3156e7a2f0e24bab5b0dd292cee1 + last_write_checksum: sha1:d1fd62a6d27cf3009992fcea1434838cc0ed1c0d + pristine_git_object: a3daf7c220947484db24691090ef3ea49e3162ea gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -2401,8 +2453,8 @@ trackedFiles: pristine_git_object: 18be0395d39aa9faec3b93258c188aa6691843eb src/main/java/com/gr4vy/sdk/AsyncMerchantAccounts.java: id: e4c90f6324d3 - last_write_checksum: sha1:db9228e459cb4d3b2176074e7e63983e2442227c - pristine_git_object: 8ae747a9941508890a5016f0700174f010455c32 + last_write_checksum: sha1:621313df04e73d293f27f2959355a137a6a60e33 + pristine_git_object: 1df005cd40ebec6fe20dd633a2d12b6c4e00be60 src/main/java/com/gr4vy/sdk/AsyncNetworkTokens.java: id: 1732e241a52f last_write_checksum: sha1:774976983e2d597c7b06ae52dfb23b18e0219e0d @@ -2459,14 +2511,18 @@ trackedFiles: id: a241abab280e last_write_checksum: sha1:ba6f566a85634b7d15159987b738a18a6c539465 pristine_git_object: 1c2a4e96c35adbaa3ed6a13733f6a903df243fa1 + src/main/java/com/gr4vy/sdk/AsyncThreeDsConfiguration.java: + id: 258135d44bbc + last_write_checksum: sha1:86d1cce8feb493d8e41f9d3bd8b0ac84d34a55cd + pristine_git_object: 560cfcccda5eeec41d6e76c9e085a5cde7199ac6 src/main/java/com/gr4vy/sdk/AsyncThreeDsScenarios.java: id: 8224cc208343 last_write_checksum: sha1:e0f8d6738cffe5e49a3c46fe3e49637c5803651c pristine_git_object: a6bbf0fbc29524b348fd7cc9e00047ec46275401 src/main/java/com/gr4vy/sdk/AsyncTransactions.java: id: bf9640b12cf9 - last_write_checksum: sha1:719afdd57b2e37816f6a5dcba5c8fb5ac2d8d9b6 - pristine_git_object: 0b3328ee7fa7d2685c74593af704a7976833fea7 + last_write_checksum: sha1:cfd44c5504b4efed4edbd7d50cc3ca7f7f98568f + pristine_git_object: 0015ca47e856106d8553383173d179f7209d2f2a src/main/java/com/gr4vy/sdk/AsyncTransactionsRefunds.java: id: 25e32812684e last_write_checksum: sha1:dc1b6a43809efd702627e0fb1b8bb768bce94a87 @@ -2533,8 +2589,8 @@ trackedFiles: pristine_git_object: 82ed0f662b9e2c1246c0968d0bd686976c122c1c src/main/java/com/gr4vy/sdk/MerchantAccounts.java: id: 8dcc23ce72b7 - last_write_checksum: sha1:ccd523e1e28418c35e1b4f2689ff5e80a6a7737e - pristine_git_object: 703dd96240da1bd5cb80ec07964a0961a5431e0b + last_write_checksum: sha1:7b247acec82c55659599065654d0626bc9870161 + pristine_git_object: e2460f96409cd9abdf84f1575977e59b36cf402d src/main/java/com/gr4vy/sdk/NetworkTokens.java: id: 560324742dd0 last_write_checksum: sha1:8cb7128e8948fbe3dfbca74f35ad348cd9e58ab5 @@ -2581,8 +2637,8 @@ trackedFiles: pristine_git_object: 502a7312d3dc82c102dbaf7ed5e952d0c793e26f src/main/java/com/gr4vy/sdk/SDKConfiguration.java: id: 73a7edeaca45 - last_write_checksum: sha1:221262fad24c77de1c872febc63d6b42fde85a30 - pristine_git_object: 89016e075976d97cd4f3c10910b32c22c4b9848b + last_write_checksum: sha1:fa7b3437eaf87d5b3a043c727b1caeb88900876c + pristine_git_object: 460ad5c990c2cc9aa71f90eaa1b007d86444d374 src/main/java/com/gr4vy/sdk/SecuritySource.java: id: 1b6add6b9b50 last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd @@ -2599,14 +2655,18 @@ trackedFiles: id: ed1c390abf75 last_write_checksum: sha1:21d5bbb63cc298f9b8d079a0cea3d99ca7a76936 pristine_git_object: fc50cc835b8470e7dbb58c900cd8253f0102162f + src/main/java/com/gr4vy/sdk/ThreeDsConfiguration.java: + id: db857d8506d0 + last_write_checksum: sha1:a2ff41214004f8eb73c687ac1255c8d62d4ea379 + pristine_git_object: f6331e304845a9769ec636f2e20ec758aab47849 src/main/java/com/gr4vy/sdk/ThreeDsScenarios.java: id: 7519c0f04c9f last_write_checksum: sha1:dc38abc7e2572ddb02e431492082d416f78632fe pristine_git_object: c2607f8627fe389c7931efa78da82d0d695d18ac src/main/java/com/gr4vy/sdk/Transactions.java: id: 3cf11cff6a7f - last_write_checksum: sha1:0e74115a199049a46f052fee3890c4c0e7cc803b - pristine_git_object: f86b0d55123e0fceb5b5838a473cdd4e3c2f2c7d + last_write_checksum: sha1:7d75aa7d203a17614e6ef631f58e4c25b4baf716 + pristine_git_object: 9bf521144a51d217ecc0408b8a32e540e5288f31 src/main/java/com/gr4vy/sdk/TransactionsRefunds.java: id: cf62b811d59f last_write_checksum: sha1:50c365428eec86db114bd293148371e32d558554 @@ -3151,6 +3211,22 @@ trackedFiles: id: f630f5edfb5e last_write_checksum: sha1:3e30169e8fd7f65d2c3c0f514bac5fe36bf44485 pristine_git_object: 31c4b025c9d4a2c33900525f6fcf19293121b197 + src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfiguration.java: + id: 254e3fb821ee + last_write_checksum: sha1:7b7de866cff23406f773d056482e46dda4ae7f06 + pristine_git_object: 8e32391d65055086ec38b9efa838051939ff6071 + src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationCreate.java: + id: 0f4cf8108d5e + last_write_checksum: sha1:22e9e28ee24cd7169bb23859a1fe5c2b126fe26d + pristine_git_object: b54ccd6c64f604e5bd42d69eb8b28b66acfdc529 + src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationUpdate.java: + id: ec9315eda5a7 + last_write_checksum: sha1:6eb14f321dbb1f420d41220ae49e094485a9e39e + pristine_git_object: 382eb346a2fde2e67b76c1281c18c36b071a4878 + src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurations.java: + id: 3e80e956f317 + last_write_checksum: sha1:479679514cbf572ceec2cacd47a1405aedb6a2aa + pristine_git_object: c634f8df8c6fe08d35ecb363580187d424a1e69f src/main/java/com/gr4vy/sdk/models/components/MerchantAccountUpdate.java: id: 437f8c2b5c0f last_write_checksum: sha1:871688714add7fe095d4fa47fbf3a06fd64f1663 @@ -3937,8 +4013,8 @@ trackedFiles: pristine_git_object: 68468e2800b421324145e25255d398f4ee1a74f6 src/main/java/com/gr4vy/sdk/models/operations//async/CaptureTransactionRequestBuilder.java: id: 6259ee513793 - last_write_checksum: sha1:cb0211f12c19380bfaad989432500ee51e7cba9c - pristine_git_object: a73c11cf3abd23fca75077e35af53694f0fbcd58 + last_write_checksum: sha1:5f8dddf4e228dc67e467ef8d20c774aed00a0bfa + pristine_git_object: efa3a353a4b04e44954d09bff5706f340183ee58 src/main/java/com/gr4vy/sdk/models/operations//async/ConfigureDigitalWalletRequestBuilder.java: id: 9112b073c532 last_write_checksum: sha1:a34492aee1dbfd89cd3aa57297d674f07d3fb15f @@ -4011,6 +4087,10 @@ trackedFiles: id: 56e414500793 last_write_checksum: sha1:5a75b8135a8a1c2d2b0e8a8172328bc836ecac22 pristine_git_object: f17588c712b0b071e8dc24a5e54d38b6fba6967c + src/main/java/com/gr4vy/sdk/models/operations//async/CreateThreeDsConfigurationRequestBuilder.java: + id: 9f9d54035e73 + last_write_checksum: sha1:4f42d109b570483fb9aefed04ff41bd8c8f0beec + pristine_git_object: fc0d51608ffff498f9ac99dbd73724847a5fea11 src/main/java/com/gr4vy/sdk/models/operations//async/CreateThreeDsScenarioRequestBuilder.java: id: 9e52321a8a57 last_write_checksum: sha1:191ce416e034251ae7628520240466475855f088 @@ -4059,10 +4139,18 @@ trackedFiles: id: 0de1ad9e1dc6 last_write_checksum: sha1:87690e6974b2d9e6968947eacc6094c9bdcf18c1 pristine_git_object: 9f3a73e9a28e3ab9528bea85ae7aa76611dc3d09 + src/main/java/com/gr4vy/sdk/models/operations//async/DeleteThreeDsConfigurationRequestBuilder.java: + id: 89243cea2e80 + last_write_checksum: sha1:4d930d09cfca6b7bc8c52b6abf66595929c0fb35 + pristine_git_object: 9a2b9ea88846fe82a2e2b2668513d346b2bf217c src/main/java/com/gr4vy/sdk/models/operations//async/DeleteThreeDsScenarioRequestBuilder.java: id: d9ea6bcef32f last_write_checksum: sha1:a186bf7ce955b9f0b0acdd2e08777b238a963277 pristine_git_object: a1d3116b9378857f1b1356a61e78410d4a31aab8 + src/main/java/com/gr4vy/sdk/models/operations//async/EditThreeDsConfigurationRequestBuilder.java: + id: 521981112f37 + last_write_checksum: sha1:513295ed5249d4865b25e5095ed1c6d9a0cff9dd + pristine_git_object: eb0368b1936e549be56a540a4b2f92019cb21590 src/main/java/com/gr4vy/sdk/models/operations//async/ExpirePaymentLinkRequestBuilder.java: id: 85957cbd68e1 last_write_checksum: sha1:29d77ec2f735e8057e53321ead4b5655a2cd5056 @@ -4223,6 +4311,10 @@ trackedFiles: id: c2f6ba6be3a2 last_write_checksum: sha1:a40ca4a6b2e30f816f0f6dfe2dae5f5113910d00 pristine_git_object: 8d6f5ea60b5259609ee0287b351d81f68bb12c7e + src/main/java/com/gr4vy/sdk/models/operations//async/ListThreeDsConfigurationsRequestBuilder.java: + id: 9c1a5e61aa3c + last_write_checksum: sha1:e1f6ac7ab2c4ddfc2a14d649a0c38ea93031fda3 + pristine_git_object: 445bcc695f114abbf513e357c2ce46570e2fb3b1 src/main/java/com/gr4vy/sdk/models/operations//async/ListTransactionActionsRequestBuilder.java: id: 95644f7a09eb last_write_checksum: sha1:b1391b16c3b554b8523d13ca318cc306b62e66dc @@ -4373,16 +4465,16 @@ trackedFiles: pristine_git_object: f2070ea323a6135b60748a7e3284c1087beea9a7 src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequest.java: id: 52ba7e8a81b9 - last_write_checksum: sha1:386b0ac913537dda0b42bf72e0519031ed7bdcd1 - pristine_git_object: 30199745492cb59209591953be4db1cddd2fdfe2 + last_write_checksum: sha1:b5a98189a23bd8d0b864e55afaf2147a363c8c3d + pristine_git_object: ae584adc43a16f17139341fe95415e15bf346807 src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequestBuilder.java: id: d93645ce79ae - last_write_checksum: sha1:e7308b1b5e9e104db3d2e5eb079fd807078cab9b - pristine_git_object: 156b9dde93db5a6fe77a0dcd251e3b02e5ef91e8 + last_write_checksum: sha1:d61ba01de623ffa15f757378db8999e25ec1a09d + pristine_git_object: b691198e38c49bdf696cddbb18dda3d471377c6c src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionResponse.java: id: 8a3682dc7716 - last_write_checksum: sha1:6753a1fa3f55df9a28ab3cf70be2ecc58e04efe8 - pristine_git_object: ac3cc4a45e219bc920aa09b27e19db4297b29ec5 + last_write_checksum: sha1:186ea019264bc34d7e18a4ca1181548a3768f6f0 + pristine_git_object: a148a9fed42b620ac842c3704d577bc328e92384 src/main/java/com/gr4vy/sdk/models/operations/ConfigureDigitalWalletRequest.java: id: e75748e7736f last_write_checksum: sha1:3573e527fcbe12de9f2367a560940098dd0f39b8 @@ -4591,6 +4683,18 @@ trackedFiles: id: f1631666d91e last_write_checksum: sha1:6701dc697ba5beffba2b6681594291674445f296 pristine_git_object: 1983cb504ac7ef6702325e4d75e77b71d669bf78 + src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequest.java: + id: 1cae5e9c294c + last_write_checksum: sha1:75d4d695586c9ed0fe4bfe14159b816c00a8db4b + pristine_git_object: a550a35bc732e67c39a16c5f4a8f600348c5aec6 + src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequestBuilder.java: + id: 2613a3979d71 + last_write_checksum: sha1:acb91292174a9eb0547da1f37cf94c1325d03b0e + pristine_git_object: a383f0d42180c4e95b574ff44334a7c11d1c51c1 + src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationResponse.java: + id: 783f0cd69730 + last_write_checksum: sha1:b51254089dc5000f9230bbee335237cedd3e62c0 + pristine_git_object: 531b95dfc66922fdec55e6f17470811bd171b8da src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsScenarioRequest.java: id: 505ade2d8a24 last_write_checksum: sha1:de70aecc07b1513b544c96fe8f9bcf9c41c2d702 @@ -4735,6 +4839,18 @@ trackedFiles: id: 543bc8259544 last_write_checksum: sha1:e9e64e494311ba5cd554b11c0623acc4556fc6a8 pristine_git_object: 3a2fefbdd7a2721d297e4dfe9afa7225966568b7 + src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequest.java: + id: 1cad67b9532c + last_write_checksum: sha1:6d8734894eaea3d1aa80dbab84af655f0f887d7b + pristine_git_object: b2f835e2bcd208a6cb26efcfea659f4f0af99d79 + src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequestBuilder.java: + id: e1a9bda38e41 + last_write_checksum: sha1:9794439181248389eb964eebd42c81b582a752a2 + pristine_git_object: f305673194ab3bc32800647696c6797764bb96b1 + src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationResponse.java: + id: b549ad7e531c + last_write_checksum: sha1:fa63f74b1165c1b0affdb4de8e56fbd330288640 + pristine_git_object: 1fa38b0c1cbadd29cea1a53d9f7ba328f1aefb88 src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsScenarioRequest.java: id: ad60ebc9ad3c last_write_checksum: sha1:b687183ce816163393ac11bc3545aef4e126a699 @@ -4747,6 +4863,18 @@ trackedFiles: id: 67e522476cd5 last_write_checksum: sha1:0943e6afed7f12574b9a7f830e5d6b3a29f7b4ec pristine_git_object: 580c519f3db3560a6f0370cf9cf1711c81dd8248 + src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequest.java: + id: 90c312aadbf0 + last_write_checksum: sha1:e91e12faa13e78be118677a2367689dc56f56efe + pristine_git_object: 16501ee3c69512487069c0d24649b558c7995bed + src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequestBuilder.java: + id: ec5bdb2aacf5 + last_write_checksum: sha1:50820b5d071bd2ae88739fa346fbc9e69869c23c + pristine_git_object: c42f7e0f07c2b348f8d4992d21667977eb1da357 + src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationResponse.java: + id: ff8ce1b7f762 + last_write_checksum: sha1:75659e9b8d7bbd06e32940443d73475f6005b2ac + pristine_git_object: 464629aa3b8528272cbd179f614082282e9c3fc4 src/main/java/com/gr4vy/sdk/models/operations/ExpirePaymentLinkRequest.java: id: 039a81e887f1 last_write_checksum: sha1:561585d65b6439f2e182695c44680a84ebc224e3 @@ -4821,8 +4949,8 @@ trackedFiles: pristine_git_object: 873262f4bb438dd1323b37c72a9e84c5c76c4be4 src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequest.java: id: 1693d7ddd445 - last_write_checksum: sha1:e42a32e73af34ebd47d232a4436051eadce285a4 - pristine_git_object: 22c5eb4e8a89057f8c633bd0154f99c6bb0c7bff + last_write_checksum: sha1:c4651093fc97ae322cedc430531751b731211fed + pristine_git_object: fd2375d876604a568ef1fd83d984d67b6b616343 src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequestBuilder.java: id: fca93b61629b last_write_checksum: sha1:06182c9da02e0a8b13ab3e5aaeca85922685900b @@ -5227,6 +5355,18 @@ trackedFiles: id: 0be548d1550d last_write_checksum: sha1:b9869a84bea111dfa944341d2f9206a2ad702dec pristine_git_object: 627aa2722f4e09d6a16b2f15e3e61f614edcb026 + src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequest.java: + id: f817602a7f75 + last_write_checksum: sha1:e2654b13a2d305af0cc15797ac166b4816f9d1de + pristine_git_object: 3ae09464335943887abc0c42790705c7373bd140 + src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequestBuilder.java: + id: 7a4130e68bb3 + last_write_checksum: sha1:0bd58ad26c63a4aec659028bf1007c655a3fb29a + pristine_git_object: 5ad7c4f2076737f5cb30c804616d83cabcf82c8d + src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsResponse.java: + id: e9aa8550cc3a + last_write_checksum: sha1:67f1580a721f2ff22c08fcb680e39dc78e85f0e4 + pristine_git_object: 9ee9a78a72f3ccb4799e43f92ba01ce482435e37 src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequest.java: id: a6f190df250a last_write_checksum: sha1:3fd60a50faa93d5468c7b73874a357761163ef10 @@ -5303,14 +5443,14 @@ trackedFiles: id: 91911cdf90c5 last_write_checksum: sha1:4e3a7c2198975f3748d8a62e10317d42a1e997f1 pristine_git_object: f12cbf61dbdd8c49fbd8e206c43bd0e7d8184267 + src/main/java/com/gr4vy/sdk/models/operations/Response200CaptureTransaction.java: + id: 758336507cb6 + last_write_checksum: sha1:82a563b8ee43269bf0dcfdf0cfde3e4137ffbce1 + pristine_git_object: 878b8e5a59a7acec2da6323a5c595490e7529dae src/main/java/com/gr4vy/sdk/models/operations/Response200VoidTransaction.java: id: cec38118047f last_write_checksum: sha1:22c0a36917e1bd710846bcce6e8d994e3bad83cc pristine_git_object: f846085a924e02cdfce076c7dd3c55072ae83fbd - src/main/java/com/gr4vy/sdk/models/operations/ResponseCaptureTransaction.java: - id: dfe30fba1468 - last_write_checksum: sha1:0438407da7cb9938e5c74eec94cac1ece1469454 - pristine_git_object: f5ffff4a7ee5e84d5725bf3184f4b0d15d20cfcf src/main/java/com/gr4vy/sdk/models/operations/ResumePaymentMethodNetworkTokenRequest.java: id: c63754a7bb91 last_write_checksum: sha1:407344681a4d91ef429bc64918ff0b5c3b721b5a @@ -5409,8 +5549,8 @@ trackedFiles: pristine_git_object: 92c5eba121d69388b558003ed96ded60cf732590 src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequest.java: id: 49dcc5b0b430 - last_write_checksum: sha1:78f06174aa473598f5e57b84e446027ef31dd646 - pristine_git_object: 08cf6681fd80a8f5f40a052b21621ae4d6e081f7 + last_write_checksum: sha1:c671e3ff60485a96a622c90a6aba31e433b949e1 + pristine_git_object: 9f7ce612821d826bb29dd9c5933d9994d2c9257c src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequestBuilder.java: id: cf02bf696379 last_write_checksum: sha1:35605e56053a7fae1422f036ca6125c3c2771338 @@ -5513,8 +5653,8 @@ trackedFiles: pristine_git_object: 69851b3db62cee3d27cd46d2545d94319b04071e src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionResponse.java: id: ed6306eeb953 - last_write_checksum: sha1:b6611bcb5900dd3e26b9eeb03a81fede6a88eee8 - pristine_git_object: 2aaf390355e268785d8ee682ac889ef5f37c4032 + last_write_checksum: sha1:654a65bf8d8947b615359413518efed2effb8c0c + pristine_git_object: 0ba27e4a8fe57fa8853fe7d888c12a1464f71eae src/main/java/com/gr4vy/sdk/models/operations/async/ConfigureDigitalWalletResponse.java: id: 0a2a18be7edb last_write_checksum: sha1:a9d3dd10febb9e0d07e5d9bfe727071e555bd041 @@ -5587,6 +5727,10 @@ trackedFiles: id: 5848f87f8615 last_write_checksum: sha1:4429e5e769ea9bb5b39c722c30854e05b1cbf591 pristine_git_object: 6bfcceda65d680a3d113f0a0500bcbf65b97c058 + src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationResponse.java: + id: 6b14d9507e8f + last_write_checksum: sha1:a4bc7f436d2f86b56ad35e2bde5cdcc00b066c16 + pristine_git_object: 8bc54dc4943f3547e40c836fbc1a0a009b8c6828 src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsScenarioResponse.java: id: ea310053522f last_write_checksum: sha1:e35c1fb13a0e44aabc1c976419b35dc03cf1e9a3 @@ -5635,10 +5779,18 @@ trackedFiles: id: 8146ede6c5a2 last_write_checksum: sha1:25aef806ce926a72e1c19cece4f360257e771051 pristine_git_object: a129d250fa90cb01b0fe80d258eb8649b47151d3 + src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationResponse.java: + id: f608b6504034 + last_write_checksum: sha1:55796c3f71c587512febc60fd1eb29fd54e2f46f + pristine_git_object: 5d1abe58cfaf3a541bc33a0dd74401e5668e10e6 src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsScenarioResponse.java: id: c305d1bfcee6 last_write_checksum: sha1:0ffe7d93da58bd66a121a12ef60b2cc9298ac9a8 pristine_git_object: b97642fd38523389962b0912d3610772a1bd8bf5 + src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationResponse.java: + id: e22376b47a66 + last_write_checksum: sha1:fce0d5ab6a9c81e716e11f82f23970e1dba09d76 + pristine_git_object: 8e0e542dcb15adea52e2b5f01176794c42720919 src/main/java/com/gr4vy/sdk/models/operations/async/ExpirePaymentLinkResponse.java: id: 10881c0ca9d5 last_write_checksum: sha1:3580e3a7915fe6200139503b14685e290e1081b2 @@ -5799,6 +5951,10 @@ trackedFiles: id: 54d96bb1c1db last_write_checksum: sha1:8611fc86928a0cda5fd7b54a00454bcaad5c339c pristine_git_object: 46b2a8edacb91e21e9b23d44b5106eacab246301 + src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsResponse.java: + id: 134cc0a46ad8 + last_write_checksum: sha1:b3a9fb3e0e3209f9d2e46e153f89a6b4e87f9442 + pristine_git_object: d88c51374b132f402018f9e27cde051e2ba77b1a src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsResponse.java: id: a39e09266a62 last_write_checksum: sha1:7185a24dff2180f65d32b6c0e26b56377bc543bc @@ -5905,8 +6061,8 @@ trackedFiles: pristine_git_object: f06e2ae47a51b9e8e623cde429c8048eb3d912af src/main/java/com/gr4vy/sdk/operations/CaptureTransaction.java: id: 925d2b8fdf2e - last_write_checksum: sha1:4719cca960ce64fff58358ebc50ebf5931b3c4d9 - pristine_git_object: c6ff6ce6c6a224d67bb0f1eca48346a2089da6ba + last_write_checksum: sha1:160c7226fe5c4278d0c4a05c92a3ba9261a29aa6 + pristine_git_object: 60062944955d9684f9b4e1e86ec81d8aebe68e71 src/main/java/com/gr4vy/sdk/operations/ConfigureDigitalWallet.java: id: 46138e27f149 last_write_checksum: sha1:d4eb2e3043fb9515366aaf8c6eb04c04a766f7a5 @@ -5979,6 +6135,10 @@ trackedFiles: id: d4d367c62aea last_write_checksum: sha1:b66373a8d2e9a51ad7c25182e94ede6a4345cee6 pristine_git_object: 551ae7e8ac1247bf2cb823564338eeda12db448d + src/main/java/com/gr4vy/sdk/operations/CreateThreeDsConfiguration.java: + id: 4a8bb674fa79 + last_write_checksum: sha1:bcfc1fcd91b6d6a588b2809deb29a49686465d8b + pristine_git_object: 13fe379d3644a9714991c8e5556536c0c5aba138 src/main/java/com/gr4vy/sdk/operations/CreateThreeDsScenario.java: id: ae5c2c7524df last_write_checksum: sha1:b8d234442c28416e3b321a7d178bc3b6afbb55b9 @@ -6027,10 +6187,18 @@ trackedFiles: id: 29baf1194ca6 last_write_checksum: sha1:955bf515b24722ccc8863fef5bf55724ab8e0d0d pristine_git_object: 125f7d02d3f419cc9ea18768a27540a13dd48894 + src/main/java/com/gr4vy/sdk/operations/DeleteThreeDsConfiguration.java: + id: bb04dd3e6c67 + last_write_checksum: sha1:6c40db1e342ea3f86cee325314e2f7a7ef531632 + pristine_git_object: 423a9c121bf87ad5bbda0226c671d26d934c4431 src/main/java/com/gr4vy/sdk/operations/DeleteThreeDsScenario.java: id: 26b2146ea74d last_write_checksum: sha1:9e302a276cb868c9cfa89d6852b5356cde9e4f62 pristine_git_object: 7b3a92b7037916c0ab55dc3f5444c5c4843d480f + src/main/java/com/gr4vy/sdk/operations/EditThreeDsConfiguration.java: + id: 313784ab5a4a + last_write_checksum: sha1:087694d721a56d2230d2b1c7148b6bbb5cce2562 + pristine_git_object: 6f676c1f7377f04d36fb2e0e5c6b8c93bc5ecc73 src/main/java/com/gr4vy/sdk/operations/ExpirePaymentLink.java: id: bb85b2894295 last_write_checksum: sha1:9a75e51ea2e4093a7681c28b4e210815c8268a78 @@ -6191,6 +6359,10 @@ trackedFiles: id: 20f116bc6064 last_write_checksum: sha1:83c634f4b32e59f7f75699ff629ff40fc4dc5046 pristine_git_object: 3acfb2d3ed618b7157934df0788271f77b0d5463 + src/main/java/com/gr4vy/sdk/operations/ListThreeDsConfigurations.java: + id: 6d1b60ce377b + last_write_checksum: sha1:07ba5e19d78785fb6547fdbd10ed0a32b4413533 + pristine_git_object: f8fea4cbd5dd79cffd946b50cbb19629aaf4b8ee src/main/java/com/gr4vy/sdk/operations/ListTransactionActions.java: id: 1790260027b3 last_write_checksum: sha1:0b7cb6ac147f69310be09001a36f932dd84f36f9 @@ -10164,11 +10336,147 @@ examples: application/json: {"type": "error", "code": "bad_gateway", "status": 502, "message": "Request could not be processed"} "504": application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} + create_three_ds_configuration: + speakeasy-default-create-three-ds-configuration: + parameters: + path: + merchant_account_id: "merchant-12345" + requestBody: + application/json: {"merchant_acquirer_bin": "516327", "merchant_acquirer_id": "123456789012345", "merchant_name": "Acme Inc.", "merchant_country_code": "840", "merchant_category_code": "1234", "merchant_url": "https://example.com", "scheme": "visa", "metadata": {"key": "", "key1": "", "key2": ""}} + responses: + "201": + application/json: {"merchant_acquirer_bin": "516327", "merchant_acquirer_id": "123456789012345", "merchant_name": "Acme Inc.", "merchant_country_code": "840", "merchant_category_code": "1234", "merchant_url": "https://example.com", "type": "merchant-account.three-ds-configuration", "id": "8715f484-1b51-4a62-8fc4-8df19c6d52c7", "merchant_account_id": "", "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00", "scheme": "visa", "currency": "USD", "metadata": {}} + "400": + application/json: {"type": "error", "code": "bad_request", "status": 400, "message": "Request failed validation"} + "401": + application/json: {"type": "error", "code": "unauthorized", "status": 401, "message": "No valid API authentication found"} + "403": + application/json: {"type": "error", "code": "forbidden", "status": 403, "message": "Request failed validation"} + "404": + application/json: {"type": "error", "code": "not_found", "status": 404, "message": "The resource could not be found"} + "405": + application/json: {"type": "error", "code": "method_not_allowed", "status": 405, "message": "Method Not Allowed"} + "409": + application/json: {"type": "error", "code": "duplicate_record", "status": 409, "message": "Request failed validation"} + "422": + application/json: {} + "425": + application/json: {"type": "error", "code": "too_early", "status": 425, "message": "Request failed validation"} + "429": + application/json: {"type": "error", "code": "too_many_requests", "status": 429, "message": "Request failed validation"} + "500": + application/json: {"type": "error", "code": "server_error", "status": 500, "message": "Request could not be processed"} + "502": + application/json: {"type": "error", "code": "bad_gateway", "status": 502, "message": "Request could not be processed"} + "504": + application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} + list_three_ds_configurations: + speakeasy-default-list-three-ds-configurations: + parameters: + path: + merchant_account_id: "merchant-12345" + responses: + "200": + application/json: {"items": []} + "400": + application/json: {"type": "error", "code": "bad_request", "status": 400, "message": "Request failed validation"} + "401": + application/json: {"type": "error", "code": "unauthorized", "status": 401, "message": "No valid API authentication found"} + "403": + application/json: {"type": "error", "code": "forbidden", "status": 403, "message": "Request failed validation"} + "404": + application/json: {"type": "error", "code": "not_found", "status": 404, "message": "The resource could not be found"} + "405": + application/json: {"type": "error", "code": "method_not_allowed", "status": 405, "message": "Method Not Allowed"} + "409": + application/json: {"type": "error", "code": "duplicate_record", "status": 409, "message": "Request failed validation"} + "422": + application/json: {} + "425": + application/json: {"type": "error", "code": "too_early", "status": 425, "message": "Request failed validation"} + "429": + application/json: {"type": "error", "code": "too_many_requests", "status": 429, "message": "Request failed validation"} + "500": + application/json: {"type": "error", "code": "server_error", "status": 500, "message": "Request could not be processed"} + "502": + application/json: {"type": "error", "code": "bad_gateway", "status": 502, "message": "Request could not be processed"} + "504": + application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} + edit_three_ds_configuration: + speakeasy-default-edit-three-ds-configuration: + parameters: + path: + merchant_account_id: "merchant-12345" + three_ds_configuration_id: "1808f5e6-b49c-4db9-94fa-22371ea352f5" + requestBody: + application/json: {} + responses: + "200": + application/json: {"merchant_acquirer_bin": "516327", "merchant_acquirer_id": "123456789012345", "merchant_name": "Acme Inc.", "merchant_country_code": "840", "merchant_category_code": "1234", "merchant_url": "https://example.com", "type": "merchant-account.three-ds-configuration", "id": "f9ebdb2a-60ad-4a87-8605-33f3843ebc89", "merchant_account_id": "", "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00", "scheme": "visa", "currency": "USD", "metadata": {"key": "", "key1": "", "key2": ""}} + "400": + application/json: {"type": "error", "code": "bad_request", "status": 400, "message": "Request failed validation"} + "401": + application/json: {"type": "error", "code": "unauthorized", "status": 401, "message": "No valid API authentication found"} + "403": + application/json: {"type": "error", "code": "forbidden", "status": 403, "message": "Request failed validation"} + "404": + application/json: {"type": "error", "code": "not_found", "status": 404, "message": "The resource could not be found"} + "405": + application/json: {"type": "error", "code": "method_not_allowed", "status": 405, "message": "Method Not Allowed"} + "409": + application/json: {"type": "error", "code": "duplicate_record", "status": 409, "message": "Request failed validation"} + "422": + application/json: {} + "425": + application/json: {"type": "error", "code": "too_early", "status": 425, "message": "Request failed validation"} + "429": + application/json: {"type": "error", "code": "too_many_requests", "status": 429, "message": "Request failed validation"} + "500": + application/json: {"type": "error", "code": "server_error", "status": 500, "message": "Request could not be processed"} + "502": + application/json: {"type": "error", "code": "bad_gateway", "status": 502, "message": "Request could not be processed"} + "504": + application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} + delete_three_ds_configuration: + speakeasy-default-delete-three-ds-configuration: + parameters: + path: + merchant_account_id: "merchant-12345" + three_ds_configuration_id: "1808f5e6-b49c-4db9-94fa-22371ea352f5" + responses: + "400": + application/json: {"type": "error", "code": "bad_request", "status": 400, "message": "Request failed validation"} + "401": + application/json: {"type": "error", "code": "unauthorized", "status": 401, "message": "No valid API authentication found"} + "403": + application/json: {"type": "error", "code": "forbidden", "status": 403, "message": "Request failed validation"} + "404": + application/json: {"type": "error", "code": "not_found", "status": 404, "message": "The resource could not be found"} + "405": + application/json: {"type": "error", "code": "method_not_allowed", "status": 405, "message": "Method Not Allowed"} + "409": + application/json: {"type": "error", "code": "duplicate_record", "status": 409, "message": "Request failed validation"} + "422": + application/json: {} + "425": + application/json: {"type": "error", "code": "too_early", "status": 425, "message": "Request failed validation"} + "429": + application/json: {"type": "error", "code": "too_many_requests", "status": 429, "message": "Request failed validation"} + "500": + application/json: {"type": "error", "code": "server_error", "status": 500, "message": "Request could not be processed"} + "502": + application/json: {"type": "error", "code": "bad_gateway", "status": 502, "message": "Request could not be processed"} + "504": + application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} examplesVersion: 1.0.2 generatedTests: {} releaseNotes: | ## Java SDK Changes: - * `gr4vy.transactions.void()`: `request.idempotencyKey` **Added** + * `gr4vy.transactions.capture()`: `request` **Changed** **Breaking** ⚠️ + * `gr4vy.merchantAccounts.threeDsConfiguration.create()`: **Added** + * `gr4vy.merchantAccounts.threeDsConfiguration.list()`: **Added** + * `gr4vy.merchantAccounts.threeDsConfiguration.update()`: **Added** + * `gr4vy.merchantAccounts.threeDsConfiguration.delete()`: **Added** generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f690c7de..4e408f39 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -22,13 +22,14 @@ generation: schemas: allOfMergeStrategy: shallowMerge requestBodyFieldName: "" + versioningStrategy: automatic persistentEdits: {} tests: generateTests: true generateNewTests: false skipResponseBodyAssertions: false java: - version: 2.16.21 + version: 2.16.22 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter:5.10.0 - implementation:com.auth0:java-jwt:4.5.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0b1660f4..c0d7a7bf 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.700.2 +speakeasyVersion: 1.703.0 sources: Gr4vy: sourceNamespace: openapi @@ -9,11 +9,11 @@ sources: - 1.0.0 openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:1a8db78bf8725fe7b1d503e3fd7b61e41508213c41a6ddc4244aec7cc05547e2 - sourceBlobDigest: sha256:c17807fc9523637430a4fe30a7b80da9227907309e5454cb0fce1681eb0926eb + sourceRevisionDigest: sha256:0288894e14b65a2749d738e6141598db7828cf99e6a7cd3c4fe0f8ef8b9069e9 + sourceBlobDigest: sha256:3c5afd8fb9a7d395368e68040362ddfa190238d465a81481ba1ce21ddeeccd27 tags: - latest - - speakeasy-sdk-regen-1770143811 + - speakeasy-sdk-regen-1770229776 - 1.0.0 targets: gr-4-vy: @@ -26,10 +26,10 @@ targets: java: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:1a8db78bf8725fe7b1d503e3fd7b61e41508213c41a6ddc4244aec7cc05547e2 - sourceBlobDigest: sha256:c17807fc9523637430a4fe30a7b80da9227907309e5454cb0fce1681eb0926eb + sourceRevisionDigest: sha256:0288894e14b65a2749d738e6141598db7828cf99e6a7cd3c4fe0f8ef8b9069e9 + sourceBlobDigest: sha256:3c5afd8fb9a7d395368e68040362ddfa190238d465a81481ba1ce21ddeeccd27 codeSamplesNamespace: openapi-java-code-samples - codeSamplesRevisionDigest: sha256:16ea4907c677dc5048dcbb045e0de1e37c74257b7e2583b5edf266af61fef816 + codeSamplesRevisionDigest: sha256:4d85dc61136edae978844041744162a178fa3d6d23a0018e14e2283d34ef25e1 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index bf0863de..785836aa 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.gr4vy:sdk:2.16.21' +implementation 'com.gr4vy:sdk:2.16.22' ``` Maven: @@ -66,7 +66,7 @@ Maven: com.gr4vy sdk - 2.16.21 + 2.16.22 ``` @@ -373,6 +373,13 @@ Async support is available for: * [get](docs/sdks/merchantaccounts/README.md#get) - Get a merchant account * [update](docs/sdks/merchantaccounts/README.md#update) - Update a merchant account +#### [MerchantAccounts.ThreeDsConfiguration](docs/sdks/threedsconfiguration/README.md) + +* [create](docs/sdks/threedsconfiguration/README.md#create) - Create 3DS configuration for merchant +* [list](docs/sdks/threedsconfiguration/README.md#list) - List 3DS configurations for merchant +* [update](docs/sdks/threedsconfiguration/README.md#update) - Edit 3DS configuration +* [delete](docs/sdks/threedsconfiguration/README.md#delete) - Delete 3DS configuration for a merchant + ### [PaymentLinks](docs/sdks/paymentlinks/README.md) * [create](docs/sdks/paymentlinks/README.md#create) - Add a payment link diff --git a/RELEASES.md b/RELEASES.md index 9d3aa99b..4460f253 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1048,4 +1048,14 @@ Based on: ### Generated - [java v2.16.21] . ### Releases -- [Maven Central v2.16.21] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.21 - . \ No newline at end of file +- [Maven Central v2.16.21] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.21 - . + +## 2026-02-04 18:29:14 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.703.0 (2.803.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.16.22] . +### Releases +- [Maven Central v2.16.22] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.22 - . \ No newline at end of file diff --git a/docs/models/components/MerchantAccountThreeDSConfiguration.md b/docs/models/components/MerchantAccountThreeDSConfiguration.md new file mode 100644 index 00000000..43adb72c --- /dev/null +++ b/docs/models/components/MerchantAccountThreeDSConfiguration.md @@ -0,0 +1,21 @@ +# MerchantAccountThreeDSConfiguration + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `merchantAcquirerBin` | *String* | :heavy_check_mark: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchantAcquirerId` | *String* | :heavy_check_mark: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchantName` | *String* | :heavy_check_mark: | N/A | Acme Inc. | +| `merchantCountryCode` | *String* | :heavy_check_mark: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchantCategoryCode` | *String* | :heavy_check_mark: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchantUrl` | *String* | :heavy_check_mark: | URL to send when calling 3DS through this scheme. | https://example.com | +| `type` | *Optional\* | :heavy_minus_sign: | Always `merchant-account.three-ds-configuration`. | merchant-account.three-ds-configuration | +| `id` | *String* | :heavy_check_mark: | Unique identifier for the 3DS configuration | | +| `merchantAccountId` | *String* | :heavy_check_mark: | ID of the associated merchant account | | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date and time when this 3DS configuration was first created in our system. | 2013-07-16T19:23:00.000+00:00 | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date and time when this 3DS configuration was last updated in our system. | 2013-07-16T19:23:00.000+00:00 | +| `scheme` | [CardScheme](../../models/components/CardScheme.md) | :heavy_check_mark: | N/A | visa | +| `currency` | *Optional\* | :heavy_check_mark: | ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. | USD | +| `metadata` | Map\ | :heavy_check_mark: | Additional information about the 3DS configuration, stored as key-value pairs. | | \ No newline at end of file diff --git a/docs/models/components/MerchantAccountThreeDSConfigurationCreate.md b/docs/models/components/MerchantAccountThreeDSConfigurationCreate.md new file mode 100644 index 00000000..a17d57a9 --- /dev/null +++ b/docs/models/components/MerchantAccountThreeDSConfigurationCreate.md @@ -0,0 +1,16 @@ +# MerchantAccountThreeDSConfigurationCreate + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchantAcquirerBin` | *String* | :heavy_check_mark: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchantAcquirerId` | *String* | :heavy_check_mark: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchantName` | *String* | :heavy_check_mark: | N/A | Acme Inc. | +| `merchantCountryCode` | *String* | :heavy_check_mark: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchantCategoryCode` | *String* | :heavy_check_mark: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchantUrl` | *String* | :heavy_check_mark: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [CardScheme](../../models/components/CardScheme.md) | :heavy_check_mark: | N/A | visa | +| `currency` | *JsonNullable\* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `metadata` | Map\ | :heavy_check_mark: | Any additional information about the 3DS configuration that you would like to store as key-value pairs. | | \ No newline at end of file diff --git a/docs/models/components/MerchantAccountThreeDSConfigurationUpdate.md b/docs/models/components/MerchantAccountThreeDSConfigurationUpdate.md new file mode 100644 index 00000000..0ae24814 --- /dev/null +++ b/docs/models/components/MerchantAccountThreeDSConfigurationUpdate.md @@ -0,0 +1,16 @@ +# MerchantAccountThreeDSConfigurationUpdate + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchantAcquirerBin` | *JsonNullable\* | :heavy_minus_sign: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchantAcquirerId` | *JsonNullable\* | :heavy_minus_sign: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchantName` | *JsonNullable\* | :heavy_minus_sign: | N/A | Acme Inc. | +| `merchantCountryCode` | *JsonNullable\* | :heavy_minus_sign: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchantCategoryCode` | *JsonNullable\* | :heavy_minus_sign: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchantUrl` | *JsonNullable\* | :heavy_minus_sign: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [JsonNullable\](../../models/components/CardScheme.md) | :heavy_minus_sign: | The card scheme for this 3DS configuration | visa | +| `currency` | *JsonNullable\* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `metadata` | Map\ | :heavy_minus_sign: | Any additional information about the 3DS configuration that you would like to store as key-value pairs. | | \ No newline at end of file diff --git a/docs/models/components/MerchantAccountThreeDSConfigurations.md b/docs/models/components/MerchantAccountThreeDSConfigurations.md new file mode 100644 index 00000000..7e614985 --- /dev/null +++ b/docs/models/components/MerchantAccountThreeDSConfigurations.md @@ -0,0 +1,8 @@ +# MerchantAccountThreeDSConfigurations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `items` | List\<[MerchantAccountThreeDSConfiguration](../../models/components/MerchantAccountThreeDSConfiguration.md)> | :heavy_check_mark: | A list of items returned for this request. | \ No newline at end of file diff --git a/docs/models/operations/CaptureTransactionRequest.md b/docs/models/operations/CaptureTransactionRequest.md index b6be70b2..d53a6a1d 100644 --- a/docs/models/operations/CaptureTransactionRequest.md +++ b/docs/models/operations/CaptureTransactionRequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `transactionId` | *String* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | -| `prefer` | List\<*String*> | :heavy_minus_sign: | The preferred resource type in the response. | | -| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | -| `transactionCaptureCreate` | [TransactionCaptureCreate](../../models/components/TransactionCaptureCreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `transactionId` | *String* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | +| `prefer` | List\<*String*> | :heavy_minus_sign: | The preferred resource type in the response. | | +| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | +| `idempotencyKey` | *JsonNullable\* | :heavy_minus_sign: | A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions. | request-12345 | +| `transactionCaptureCreate` | [TransactionCaptureCreate](../../models/components/TransactionCaptureCreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/CaptureTransactionResponse.md b/docs/models/operations/CaptureTransactionResponse.md index 0ab083e7..d605509f 100644 --- a/docs/models/operations/CaptureTransactionResponse.md +++ b/docs/models/operations/CaptureTransactionResponse.md @@ -8,4 +8,4 @@ | `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseCaptureTransaction` | [Optional\](../../models/operations/ResponseCaptureTransaction.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file +| `response200CaptureTransaction` | [Optional\](../../models/operations/Response200CaptureTransaction.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/CreateThreeDsConfigurationRequest.md b/docs/models/operations/CreateThreeDsConfigurationRequest.md new file mode 100644 index 00000000..fcd49e26 --- /dev/null +++ b/docs/models/operations/CreateThreeDsConfigurationRequest.md @@ -0,0 +1,9 @@ +# CreateThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `merchantAccountThreeDSConfigurationCreate` | [MerchantAccountThreeDSConfigurationCreate](../../models/components/MerchantAccountThreeDSConfigurationCreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/CreateThreeDsConfigurationResponse.md b/docs/models/operations/CreateThreeDsConfigurationResponse.md new file mode 100644 index 00000000..073c4572 --- /dev/null +++ b/docs/models/operations/CreateThreeDsConfigurationResponse.md @@ -0,0 +1,11 @@ +# CreateThreeDsConfigurationResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `merchantAccountThreeDSConfiguration` | [Optional\](../../models/components/MerchantAccountThreeDSConfiguration.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/DeleteThreeDsConfigurationRequest.md b/docs/models/operations/DeleteThreeDsConfigurationRequest.md new file mode 100644 index 00000000..35536330 --- /dev/null +++ b/docs/models/operations/DeleteThreeDsConfigurationRequest.md @@ -0,0 +1,9 @@ +# DeleteThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `threeDsConfigurationId` | *String* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | \ No newline at end of file diff --git a/docs/models/operations/DeleteThreeDsConfigurationResponse.md b/docs/models/operations/DeleteThreeDsConfigurationResponse.md new file mode 100644 index 00000000..9295cb05 --- /dev/null +++ b/docs/models/operations/DeleteThreeDsConfigurationResponse.md @@ -0,0 +1,10 @@ +# DeleteThreeDsConfigurationResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/EditThreeDsConfigurationRequest.md b/docs/models/operations/EditThreeDsConfigurationRequest.md new file mode 100644 index 00000000..3c044098 --- /dev/null +++ b/docs/models/operations/EditThreeDsConfigurationRequest.md @@ -0,0 +1,10 @@ +# EditThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `threeDsConfigurationId` | *String* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | +| `merchantAccountThreeDSConfigurationUpdate` | [MerchantAccountThreeDSConfigurationUpdate](../../models/components/MerchantAccountThreeDSConfigurationUpdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/EditThreeDsConfigurationResponse.md b/docs/models/operations/EditThreeDsConfigurationResponse.md new file mode 100644 index 00000000..c543ae06 --- /dev/null +++ b/docs/models/operations/EditThreeDsConfigurationResponse.md @@ -0,0 +1,11 @@ +# EditThreeDsConfigurationResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `merchantAccountThreeDSConfiguration` | [Optional\](../../models/components/MerchantAccountThreeDSConfiguration.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/GetMerchantAccountRequest.md b/docs/models/operations/GetMerchantAccountRequest.md index 2146fa14..b6088058 100644 --- a/docs/models/operations/GetMerchantAccountRequest.md +++ b/docs/models/operations/GetMerchantAccountRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | \ No newline at end of file diff --git a/docs/models/operations/ListThreeDsConfigurationsRequest.md b/docs/models/operations/ListThreeDsConfigurationsRequest.md new file mode 100644 index 00000000..2061f041 --- /dev/null +++ b/docs/models/operations/ListThreeDsConfigurationsRequest.md @@ -0,0 +1,9 @@ +# ListThreeDsConfigurationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `currency` | *JsonNullable\* | :heavy_minus_sign: | ISO 4217 currency code (3 characters) to filter 3DS configurations. | USD | \ No newline at end of file diff --git a/docs/models/operations/ListThreeDsConfigurationsResponse.md b/docs/models/operations/ListThreeDsConfigurationsResponse.md new file mode 100644 index 00000000..694935ca --- /dev/null +++ b/docs/models/operations/ListThreeDsConfigurationsResponse.md @@ -0,0 +1,11 @@ +# ListThreeDsConfigurationsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `merchantAccountThreeDSConfigurations` | [Optional\](../../models/components/MerchantAccountThreeDSConfigurations.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/Response200CaptureTransaction.md b/docs/models/operations/Response200CaptureTransaction.md new file mode 100644 index 00000000..79524338 --- /dev/null +++ b/docs/models/operations/Response200CaptureTransaction.md @@ -0,0 +1,4 @@ +# Response200CaptureTransaction + +Successful Response + diff --git a/docs/models/operations/ResponseCaptureTransaction.md b/docs/models/operations/ResponseCaptureTransaction.md deleted file mode 100644 index b5eab7d2..00000000 --- a/docs/models/operations/ResponseCaptureTransaction.md +++ /dev/null @@ -1,4 +0,0 @@ -# ResponseCaptureTransaction - -Successful Response - diff --git a/docs/models/operations/UpdateMerchantAccountRequest.md b/docs/models/operations/UpdateMerchantAccountRequest.md index 032fd9dd..1c7680d5 100644 --- a/docs/models/operations/UpdateMerchantAccountRequest.md +++ b/docs/models/operations/UpdateMerchantAccountRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | | `merchantAccountUpdate` | [MerchantAccountUpdate](../../models/components/MerchantAccountUpdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdks/merchantaccounts/README.md b/docs/sdks/merchantaccounts/README.md index e28cdfb2..22ca2922 100644 --- a/docs/sdks/merchantaccounts/README.md +++ b/docs/sdks/merchantaccounts/README.md @@ -182,9 +182,9 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| Parameter | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | ### Response @@ -251,7 +251,7 @@ public class Application { | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | | `merchantAccountUpdate` | [MerchantAccountUpdate](../../models/components/MerchantAccountUpdate.md) | :heavy_check_mark: | N/A | | ### Response diff --git a/docs/sdks/threedsconfiguration/README.md b/docs/sdks/threedsconfiguration/README.md new file mode 100644 index 00000000..486e2a77 --- /dev/null +++ b/docs/sdks/threedsconfiguration/README.md @@ -0,0 +1,282 @@ +# MerchantAccounts.ThreeDsConfiguration + +## Overview + +### Available Operations + +* [create](#create) - Create 3DS configuration for merchant +* [list](#list) - List 3DS configurations for merchant +* [update](#update) - Edit 3DS configuration +* [delete](#delete) - Delete 3DS configuration for a merchant + +## create + +Create a new 3DS configuration for a merchant account. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.components.CardScheme; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationResponse; +import java.lang.Exception; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + CreateThreeDsConfigurationResponse res = sdk.merchantAccounts().threeDsConfiguration().create() + .merchantAccountId("merchant-12345") + .merchantAccountThreeDSConfigurationCreate(MerchantAccountThreeDSConfigurationCreate.builder() + .merchantAcquirerBin("516327") + .merchantAcquirerId("123456789012345") + .merchantName("Acme Inc.") + .merchantCountryCode("840") + .merchantCategoryCode("1234") + .merchantUrl("https://example.com") + .scheme(CardScheme.VISA) + .metadata(Map.ofEntries( + Map.entry("key", ""), + Map.entry("key1", ""), + Map.entry("key2", ""))) + .build()) + .call(); + + if (res.merchantAccountThreeDSConfiguration().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `merchantAccountThreeDSConfigurationCreate` | [MerchantAccountThreeDSConfigurationCreate](../../models/components/MerchantAccountThreeDSConfigurationCreate.md) | :heavy_check_mark: | N/A | | + +### Response + +**[CreateThreeDsConfigurationResponse](../../models/operations/CreateThreeDsConfigurationResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## list + +List all 3DS configurations for a merchant account. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + ListThreeDsConfigurationsResponse res = sdk.merchantAccounts().threeDsConfiguration().list() + .merchantAccountId("merchant-12345") + .call(); + + if (res.merchantAccountThreeDSConfigurations().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `currency` | *JsonNullable\* | :heavy_minus_sign: | ISO 4217 currency code (3 characters) to filter 3DS configurations. | USD | + +### Response + +**[ListThreeDsConfigurationsResponse](../../models/operations/ListThreeDsConfigurationsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## update + +Update the 3DS configuration for a merchant account. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + EditThreeDsConfigurationResponse res = sdk.merchantAccounts().threeDsConfiguration().update() + .merchantAccountId("merchant-12345") + .threeDsConfigurationId("1808f5e6-b49c-4db9-94fa-22371ea352f5") + .merchantAccountThreeDSConfigurationUpdate(MerchantAccountThreeDSConfigurationUpdate.builder() + .build()) + .call(); + + if (res.merchantAccountThreeDSConfiguration().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `threeDsConfigurationId` | *String* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | +| `merchantAccountThreeDSConfigurationUpdate` | [MerchantAccountThreeDSConfigurationUpdate](../../models/components/MerchantAccountThreeDSConfigurationUpdate.md) | :heavy_check_mark: | N/A | | + +### Response + +**[EditThreeDsConfigurationResponse](../../models/operations/EditThreeDsConfigurationResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## delete + +Delete a 3DS configuration for a merchant account. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + DeleteThreeDsConfigurationResponse res = sdk.merchantAccounts().threeDsConfiguration().delete() + .merchantAccountId("merchant-12345") + .threeDsConfigurationId("1808f5e6-b49c-4db9-94fa-22371ea352f5") + .call(); + + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `merchantAccountId` | *String* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `threeDsConfigurationId` | *String* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | + +### Response + +**[DeleteThreeDsConfigurationResponse](../../models/operations/DeleteThreeDsConfigurationResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 146605f3..6c0fd0ae 100644 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -366,6 +366,7 @@ package hello.world; import com.gr4vy.sdk.Gr4vy; import com.gr4vy.sdk.models.components.TransactionCaptureCreate; import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.CaptureTransactionRequest; import com.gr4vy.sdk.models.operations.CaptureTransactionResponse; import java.lang.Exception; @@ -378,13 +379,17 @@ public class Application { .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build(); - CaptureTransactionResponse res = sdk.transactions().capture() + CaptureTransactionRequest req = CaptureTransactionRequest.builder() .transactionId("7099948d-7286-47e4-aad8-b68f7eb44591") .transactionCaptureCreate(TransactionCaptureCreate.builder() .build()) + .build(); + + CaptureTransactionResponse res = sdk.transactions().capture() + .request(req) .call(); - if (res.responseCaptureTransaction().isPresent()) { + if (res.response200CaptureTransaction().isPresent()) { // handle response } } @@ -393,12 +398,9 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `transactionId` | *String* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | -| `prefer` | List\<*String*> | :heavy_minus_sign: | The preferred resource type in the response. | | -| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | -| `transactionCaptureCreate` | [TransactionCaptureCreate](../../models/components/TransactionCaptureCreate.md) | :heavy_check_mark: | N/A | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `request` | [CaptureTransactionRequest](../../models/operations/CaptureTransactionRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response diff --git a/gradle.properties b/gradle.properties index 518a6a4a..a3daf7c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.gr4vy artifactId=sdk -version=2.16.21 +version=2.16.22 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/gr4vy/sdk/AsyncMerchantAccounts.java b/src/main/java/com/gr4vy/sdk/AsyncMerchantAccounts.java index 8ae747a9..1df005cd 100644 --- a/src/main/java/com/gr4vy/sdk/AsyncMerchantAccounts.java +++ b/src/main/java/com/gr4vy/sdk/AsyncMerchantAccounts.java @@ -34,13 +34,19 @@ public class AsyncMerchantAccounts { private static final Headers _headers = Headers.EMPTY; private final SDKConfiguration sdkConfiguration; + private final AsyncThreeDsConfiguration threeDsConfiguration; private final MerchantAccounts syncSDK; AsyncMerchantAccounts(MerchantAccounts syncSDK, SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.threeDsConfiguration = new AsyncThreeDsConfiguration(syncSDK.threeDsConfiguration(), this.sdkConfiguration); this.syncSDK = syncSDK; } + public final AsyncThreeDsConfiguration threeDsConfiguration() { + return threeDsConfiguration; + } + /** * Switches to the sync SDK. * @@ -148,7 +154,7 @@ public GetMerchantAccountRequestBuilder get() { * *

Get info about a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @return {@code CompletableFuture} - The async response */ public CompletableFuture get(String merchantAccountId) { @@ -160,7 +166,7 @@ public CompletableFuture get(String merchantAccountI * *

Get info about a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -195,7 +201,7 @@ public UpdateMerchantAccountRequestBuilder update() { * *

Update info for a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @param merchantAccountUpdate * @return {@code CompletableFuture} - The async response */ diff --git a/src/main/java/com/gr4vy/sdk/AsyncThreeDsConfiguration.java b/src/main/java/com/gr4vy/sdk/AsyncThreeDsConfiguration.java new file mode 100644 index 00000000..560cfccc --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/AsyncThreeDsConfiguration.java @@ -0,0 +1,210 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsRequest; +import com.gr4vy.sdk.models.operations.async.CreateThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.async.CreateThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.async.DeleteThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.async.DeleteThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.async.EditThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.async.EditThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.async.ListThreeDsConfigurationsRequestBuilder; +import com.gr4vy.sdk.models.operations.async.ListThreeDsConfigurationsResponse; +import com.gr4vy.sdk.operations.CreateThreeDsConfiguration; +import com.gr4vy.sdk.operations.DeleteThreeDsConfiguration; +import com.gr4vy.sdk.operations.EditThreeDsConfiguration; +import com.gr4vy.sdk.operations.ListThreeDsConfigurations; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AsyncThreeDsConfiguration { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final ThreeDsConfiguration syncSDK; + + AsyncThreeDsConfiguration(ThreeDsConfiguration syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public ThreeDsConfiguration sync() { + return syncSDK; + } + + + /** + * Create 3DS configuration for merchant + * + *

Create a new 3DS configuration for a merchant account. + * + * @return The async call builder + */ + public CreateThreeDsConfigurationRequestBuilder create() { + return new CreateThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Create 3DS configuration for merchant + * + *

Create a new 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param merchantAccountThreeDSConfigurationCreate + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(String merchantAccountId, MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + CreateThreeDsConfigurationRequest request = + CreateThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .merchantAccountThreeDSConfigurationCreate(merchantAccountThreeDSConfigurationCreate) + .build(); + AsyncRequestOperation operation + = new CreateThreeDsConfiguration.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @return The async call builder + */ + public ListThreeDsConfigurationsRequestBuilder list() { + return new ListThreeDsConfigurationsRequestBuilder(sdkConfiguration); + } + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(String merchantAccountId) { + return list(merchantAccountId, JsonNullable.undefined(), Optional.empty()); + } + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param currency ISO 4217 currency code (3 characters) to filter 3DS configurations. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list( + String merchantAccountId, JsonNullable currency, + Optional options) { + ListThreeDsConfigurationsRequest request = + ListThreeDsConfigurationsRequest + .builder() + .merchantAccountId(merchantAccountId) + .currency(currency) + .build(); + AsyncRequestOperation operation + = new ListThreeDsConfigurations.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Edit 3DS configuration + * + *

Update the 3DS configuration for a merchant account. + * + * @return The async call builder + */ + public EditThreeDsConfigurationRequestBuilder update() { + return new EditThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Edit 3DS configuration + * + *

Update the 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param threeDsConfigurationId The ID of the 3DS configuration for a merchant account. + * @param merchantAccountThreeDSConfigurationUpdate + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update( + String merchantAccountId, String threeDsConfigurationId, + MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + EditThreeDsConfigurationRequest request = + EditThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .threeDsConfigurationId(threeDsConfigurationId) + .merchantAccountThreeDSConfigurationUpdate(merchantAccountThreeDSConfigurationUpdate) + .build(); + AsyncRequestOperation operation + = new EditThreeDsConfiguration.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete 3DS configuration for a merchant + * + *

Delete a 3DS configuration for a merchant account. + * + * @return The async call builder + */ + public DeleteThreeDsConfigurationRequestBuilder delete() { + return new DeleteThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Delete 3DS configuration for a merchant + * + *

Delete a 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param threeDsConfigurationId The ID of the 3DS configuration for a merchant account. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(String merchantAccountId, String threeDsConfigurationId) { + DeleteThreeDsConfigurationRequest request = + DeleteThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .threeDsConfigurationId(threeDsConfigurationId) + .build(); + AsyncRequestOperation operation + = new DeleteThreeDsConfiguration.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/gr4vy/sdk/AsyncTransactions.java b/src/main/java/com/gr4vy/sdk/AsyncTransactions.java index 0b3328ee..0015ca47 100644 --- a/src/main/java/com/gr4vy/sdk/AsyncTransactions.java +++ b/src/main/java/com/gr4vy/sdk/AsyncTransactions.java @@ -5,7 +5,6 @@ import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; -import com.gr4vy.sdk.models.components.TransactionCaptureCreate; import com.gr4vy.sdk.models.components.TransactionCreate; import com.gr4vy.sdk.models.components.TransactionUpdate; import com.gr4vy.sdk.models.operations.CancelTransactionRequest; @@ -317,39 +316,10 @@ public CaptureTransactionRequestBuilder capture() { *

Captures a previously authorized transaction. You can capture the full or a partial amount, as long * as it does not exceed the authorized amount (unless over-capture is enabled). * - * @param transactionId The ID of the transaction - * @param transactionCaptureCreate Request body for capturing an authorized transaction. - * @return {@code CompletableFuture} - The async response - */ - public CompletableFuture capture(String transactionId, TransactionCaptureCreate transactionCaptureCreate) { - return capture( - transactionId, JsonNullable.undefined(), JsonNullable.undefined(), - transactionCaptureCreate); - } - - /** - * Capture transaction - * - *

Captures a previously authorized transaction. You can capture the full or a partial amount, as long - * as it does not exceed the authorized amount (unless over-capture is enabled). - * - * @param transactionId The ID of the transaction - * @param prefer The preferred resource type in the response. - * @param merchantAccountId - * @param transactionCaptureCreate Request body for capturing an authorized transaction. + * @param request The request object containing all the parameters for the API call. * @return {@code CompletableFuture} - The async response */ - public CompletableFuture capture( - String transactionId, JsonNullable> prefer, - JsonNullable merchantAccountId, TransactionCaptureCreate transactionCaptureCreate) { - CaptureTransactionRequest request = - CaptureTransactionRequest - .builder() - .transactionId(transactionId) - .prefer(prefer) - .merchantAccountId(merchantAccountId) - .transactionCaptureCreate(transactionCaptureCreate) - .build(); + public CompletableFuture capture(CaptureTransactionRequest request) { AsyncRequestOperation operation = new CaptureTransaction.Async(sdkConfiguration, _headers); return operation.doRequest(request) diff --git a/src/main/java/com/gr4vy/sdk/MerchantAccounts.java b/src/main/java/com/gr4vy/sdk/MerchantAccounts.java index 703dd962..e2460f96 100644 --- a/src/main/java/com/gr4vy/sdk/MerchantAccounts.java +++ b/src/main/java/com/gr4vy/sdk/MerchantAccounts.java @@ -34,12 +34,18 @@ public class MerchantAccounts { private static final Headers _headers = Headers.EMPTY; private final SDKConfiguration sdkConfiguration; private final AsyncMerchantAccounts asyncSDK; + private final ThreeDsConfiguration threeDsConfiguration; MerchantAccounts(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.threeDsConfiguration = new ThreeDsConfiguration(this.sdkConfiguration); this.asyncSDK = new AsyncMerchantAccounts(this, sdkConfiguration); } + public final ThreeDsConfiguration threeDsConfiguration() { + return threeDsConfiguration; + } + /** * Switches to the async SDK. * @@ -142,7 +148,7 @@ public GetMerchantAccountRequestBuilder get() { * *

Get info about a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -155,7 +161,7 @@ public GetMerchantAccountResponse get(String merchantAccountId) { * *

Get info about a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -187,7 +193,7 @@ public UpdateMerchantAccountRequestBuilder update() { * *

Update info for a merchant account in an instance. * - * @param merchantAccountId The ID of the merchant account + * @param merchantAccountId The ID of the merchant account. * @param merchantAccountUpdate * @return The response from the API call * @throws RuntimeException subclass if the API call fails diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java index 89016e07..460ad5c9 100644 --- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java +++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java @@ -22,8 +22,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "1.0.0"; - public static final String SDK_VERSION = "2.16.21"; - public static final String GEN_VERSION = "2.801.2"; + public static final String SDK_VERSION = "2.16.22"; + public static final String GEN_VERSION = "2.803.3"; private static final String BASE_PACKAGE = "com.gr4vy.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/gr4vy/sdk/ThreeDsConfiguration.java b/src/main/java/com/gr4vy/sdk/ThreeDsConfiguration.java new file mode 100644 index 00000000..f6331e30 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/ThreeDsConfiguration.java @@ -0,0 +1,204 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationRequestBuilder; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationResponse; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsRequest; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsRequestBuilder; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsResponse; +import com.gr4vy.sdk.operations.CreateThreeDsConfiguration; +import com.gr4vy.sdk.operations.DeleteThreeDsConfiguration; +import com.gr4vy.sdk.operations.EditThreeDsConfiguration; +import com.gr4vy.sdk.operations.ListThreeDsConfigurations; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ThreeDsConfiguration { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncThreeDsConfiguration asyncSDK; + + ThreeDsConfiguration(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncThreeDsConfiguration(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncThreeDsConfiguration async() { + return asyncSDK; + } + + /** + * Create 3DS configuration for merchant + * + *

Create a new 3DS configuration for a merchant account. + * + * @return The call builder + */ + public CreateThreeDsConfigurationRequestBuilder create() { + return new CreateThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Create 3DS configuration for merchant + * + *

Create a new 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param merchantAccountThreeDSConfigurationCreate + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public CreateThreeDsConfigurationResponse create(String merchantAccountId, MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + CreateThreeDsConfigurationRequest request = + CreateThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .merchantAccountThreeDSConfigurationCreate(merchantAccountThreeDSConfigurationCreate) + .build(); + RequestOperation operation + = new CreateThreeDsConfiguration.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @return The call builder + */ + public ListThreeDsConfigurationsRequestBuilder list() { + return new ListThreeDsConfigurationsRequestBuilder(sdkConfiguration); + } + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public ListThreeDsConfigurationsResponse list(String merchantAccountId) { + return list(merchantAccountId, JsonNullable.undefined(), Optional.empty()); + } + + /** + * List 3DS configurations for merchant + * + *

List all 3DS configurations for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param currency ISO 4217 currency code (3 characters) to filter 3DS configurations. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public ListThreeDsConfigurationsResponse list( + String merchantAccountId, JsonNullable currency, + Optional options) { + ListThreeDsConfigurationsRequest request = + ListThreeDsConfigurationsRequest + .builder() + .merchantAccountId(merchantAccountId) + .currency(currency) + .build(); + RequestOperation operation + = new ListThreeDsConfigurations.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Edit 3DS configuration + * + *

Update the 3DS configuration for a merchant account. + * + * @return The call builder + */ + public EditThreeDsConfigurationRequestBuilder update() { + return new EditThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Edit 3DS configuration + * + *

Update the 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param threeDsConfigurationId The ID of the 3DS configuration for a merchant account. + * @param merchantAccountThreeDSConfigurationUpdate + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public EditThreeDsConfigurationResponse update( + String merchantAccountId, String threeDsConfigurationId, + MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + EditThreeDsConfigurationRequest request = + EditThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .threeDsConfigurationId(threeDsConfigurationId) + .merchantAccountThreeDSConfigurationUpdate(merchantAccountThreeDSConfigurationUpdate) + .build(); + RequestOperation operation + = new EditThreeDsConfiguration.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Delete 3DS configuration for a merchant + * + *

Delete a 3DS configuration for a merchant account. + * + * @return The call builder + */ + public DeleteThreeDsConfigurationRequestBuilder delete() { + return new DeleteThreeDsConfigurationRequestBuilder(sdkConfiguration); + } + + /** + * Delete 3DS configuration for a merchant + * + *

Delete a 3DS configuration for a merchant account. + * + * @param merchantAccountId The ID of the merchant account. + * @param threeDsConfigurationId The ID of the 3DS configuration for a merchant account. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public DeleteThreeDsConfigurationResponse delete(String merchantAccountId, String threeDsConfigurationId) { + DeleteThreeDsConfigurationRequest request = + DeleteThreeDsConfigurationRequest + .builder() + .merchantAccountId(merchantAccountId) + .threeDsConfigurationId(threeDsConfigurationId) + .build(); + RequestOperation operation + = new DeleteThreeDsConfiguration.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/gr4vy/sdk/Transactions.java b/src/main/java/com/gr4vy/sdk/Transactions.java index f86b0d55..9bf52114 100644 --- a/src/main/java/com/gr4vy/sdk/Transactions.java +++ b/src/main/java/com/gr4vy/sdk/Transactions.java @@ -5,7 +5,6 @@ import static com.gr4vy.sdk.operations.Operations.RequestOperation; -import com.gr4vy.sdk.models.components.TransactionCaptureCreate; import com.gr4vy.sdk.models.components.TransactionCreate; import com.gr4vy.sdk.models.components.TransactionUpdate; import com.gr4vy.sdk.models.operations.CancelTransactionRequest; @@ -310,40 +309,11 @@ public CaptureTransactionRequestBuilder capture() { *

Captures a previously authorized transaction. You can capture the full or a partial amount, as long * as it does not exceed the authorized amount (unless over-capture is enabled). * - * @param transactionId The ID of the transaction - * @param transactionCaptureCreate Request body for capturing an authorized transaction. - * @return The response from the API call - * @throws RuntimeException subclass if the API call fails - */ - public CaptureTransactionResponse capture(String transactionId, TransactionCaptureCreate transactionCaptureCreate) { - return capture(transactionId, JsonNullable.undefined(), JsonNullable.undefined(), - transactionCaptureCreate); - } - - /** - * Capture transaction - * - *

Captures a previously authorized transaction. You can capture the full or a partial amount, as long - * as it does not exceed the authorized amount (unless over-capture is enabled). - * - * @param transactionId The ID of the transaction - * @param prefer The preferred resource type in the response. - * @param merchantAccountId - * @param transactionCaptureCreate Request body for capturing an authorized transaction. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public CaptureTransactionResponse capture( - String transactionId, JsonNullable> prefer, - JsonNullable merchantAccountId, TransactionCaptureCreate transactionCaptureCreate) { - CaptureTransactionRequest request = - CaptureTransactionRequest - .builder() - .transactionId(transactionId) - .prefer(prefer) - .merchantAccountId(merchantAccountId) - .transactionCaptureCreate(transactionCaptureCreate) - .build(); + public CaptureTransactionResponse capture(CaptureTransactionRequest request) { RequestOperation operation = new CaptureTransaction.Sync(sdkConfiguration, _headers); return operation.handleResponse(operation.doRequest(request)); diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfiguration.java b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfiguration.java new file mode 100644 index 00000000..8e32391d --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfiguration.java @@ -0,0 +1,639 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.Optional; + + +public class MerchantAccountThreeDSConfiguration { + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_acquirer_bin") + private String merchantAcquirerBin; + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_acquirer_id") + private String merchantAcquirerId; + + + @JsonProperty("merchant_name") + private String merchantName; + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonProperty("merchant_country_code") + private String merchantCountryCode; + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_category_code") + private String merchantCategoryCode; + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonProperty("merchant_url") + private String merchantUrl; + + /** + * Always `merchant-account.three-ds-configuration`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * Unique identifier for the 3DS configuration + */ + @JsonProperty("id") + private String id; + + /** + * ID of the associated merchant account + */ + @JsonProperty("merchant_account_id") + private String merchantAccountId; + + /** + * The date and time when this 3DS configuration was first created in our system. + */ + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + /** + * The date and time when this 3DS configuration was last updated in our system. + */ + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + + @JsonProperty("scheme") + private CardScheme scheme; + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("currency") + private Optional currency; + + /** + * Additional information about the 3DS configuration, stored as key-value pairs. + */ + @JsonProperty("metadata") + private Map metadata; + + @JsonCreator + public MerchantAccountThreeDSConfiguration( + @JsonProperty("merchant_acquirer_bin") String merchantAcquirerBin, + @JsonProperty("merchant_acquirer_id") String merchantAcquirerId, + @JsonProperty("merchant_name") String merchantName, + @JsonProperty("merchant_country_code") String merchantCountryCode, + @JsonProperty("merchant_category_code") String merchantCategoryCode, + @JsonProperty("merchant_url") String merchantUrl, + @JsonProperty("id") String id, + @JsonProperty("merchant_account_id") String merchantAccountId, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("scheme") CardScheme scheme, + @JsonProperty("currency") Optional currency, + @JsonProperty("metadata") Map metadata) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + Utils.checkNotNull(merchantName, "merchantName"); + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + Utils.checkNotNull(merchantUrl, "merchantUrl"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(scheme, "scheme"); + Utils.checkNotNull(currency, "currency"); + metadata = Utils.emptyMapIfNull(metadata); + Utils.checkNotNull(metadata, "metadata"); + this.merchantAcquirerBin = merchantAcquirerBin; + this.merchantAcquirerId = merchantAcquirerId; + this.merchantName = merchantName; + this.merchantCountryCode = merchantCountryCode; + this.merchantCategoryCode = merchantCategoryCode; + this.merchantUrl = merchantUrl; + this.type = Builder._SINGLETON_VALUE_Type.value(); + this.id = id; + this.merchantAccountId = merchantAccountId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.scheme = scheme; + this.currency = currency; + this.metadata = metadata; + } + + public MerchantAccountThreeDSConfiguration( + String merchantAcquirerBin, + String merchantAcquirerId, + String merchantName, + String merchantCountryCode, + String merchantCategoryCode, + String merchantUrl, + String id, + String merchantAccountId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + CardScheme scheme, + Map metadata) { + this(merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + id, merchantAccountId, createdAt, + updatedAt, scheme, Optional.empty(), + metadata); + } + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantAcquirerBin() { + return merchantAcquirerBin; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantAcquirerId() { + return merchantAcquirerId; + } + + @JsonIgnore + public String merchantName() { + return merchantName; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonIgnore + public String merchantCountryCode() { + return merchantCountryCode; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantUrl() { + return merchantUrl; + } + + /** + * Always `merchant-account.three-ds-configuration`. + */ + @JsonIgnore + public Optional type() { + return type; + } + + /** + * Unique identifier for the 3DS configuration + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the associated merchant account + */ + @JsonIgnore + public String merchantAccountId() { + return merchantAccountId; + } + + /** + * The date and time when this 3DS configuration was first created in our system. + */ + @JsonIgnore + public OffsetDateTime createdAt() { + return createdAt; + } + + /** + * The date and time when this 3DS configuration was last updated in our system. + */ + @JsonIgnore + public OffsetDateTime updatedAt() { + return updatedAt; + } + + @JsonIgnore + public CardScheme scheme() { + return scheme; + } + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + @JsonIgnore + public Optional currency() { + return currency; + } + + /** + * Additional information about the 3DS configuration, stored as key-value pairs. + */ + @JsonIgnore + public Map metadata() { + return metadata; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfiguration withMerchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfiguration withMerchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + public MerchantAccountThreeDSConfiguration withMerchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public MerchantAccountThreeDSConfiguration withMerchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfiguration withMerchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfiguration withMerchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + /** + * Unique identifier for the 3DS configuration + */ + public MerchantAccountThreeDSConfiguration withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the associated merchant account + */ + public MerchantAccountThreeDSConfiguration withMerchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The date and time when this 3DS configuration was first created in our system. + */ + public MerchantAccountThreeDSConfiguration withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this 3DS configuration was last updated in our system. + */ + public MerchantAccountThreeDSConfiguration withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public MerchantAccountThreeDSConfiguration withScheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + public MerchantAccountThreeDSConfiguration withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + public MerchantAccountThreeDSConfiguration withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Additional information about the 3DS configuration, stored as key-value pairs. + */ + public MerchantAccountThreeDSConfiguration withMetadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantAccountThreeDSConfiguration other = (MerchantAccountThreeDSConfiguration) o; + return + Utils.enhancedDeepEquals(this.merchantAcquirerBin, other.merchantAcquirerBin) && + Utils.enhancedDeepEquals(this.merchantAcquirerId, other.merchantAcquirerId) && + Utils.enhancedDeepEquals(this.merchantName, other.merchantName) && + Utils.enhancedDeepEquals(this.merchantCountryCode, other.merchantCountryCode) && + Utils.enhancedDeepEquals(this.merchantCategoryCode, other.merchantCategoryCode) && + Utils.enhancedDeepEquals(this.merchantUrl, other.merchantUrl) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.scheme, other.scheme) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + type, id, merchantAccountId, + createdAt, updatedAt, scheme, + currency, metadata); + } + + @Override + public String toString() { + return Utils.toString(MerchantAccountThreeDSConfiguration.class, + "merchantAcquirerBin", merchantAcquirerBin, + "merchantAcquirerId", merchantAcquirerId, + "merchantName", merchantName, + "merchantCountryCode", merchantCountryCode, + "merchantCategoryCode", merchantCategoryCode, + "merchantUrl", merchantUrl, + "type", type, + "id", id, + "merchantAccountId", merchantAccountId, + "createdAt", createdAt, + "updatedAt", updatedAt, + "scheme", scheme, + "currency", currency, + "metadata", metadata); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAcquirerBin; + + private String merchantAcquirerId; + + private String merchantName; + + private String merchantCountryCode; + + private String merchantCategoryCode; + + private String merchantUrl; + + private String id; + + private String merchantAccountId; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private CardScheme scheme; + + private Optional currency = Optional.empty(); + + private Map metadata; + + private Builder() { + // force use of static builder() method + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + + public Builder merchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public Builder merchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public Builder merchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + + /** + * URL to send when calling 3DS through this scheme. + */ + public Builder merchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + + /** + * Unique identifier for the 3DS configuration + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the associated merchant account + */ + public Builder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + + /** + * The date and time when this 3DS configuration was first created in our system. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * The date and time when this 3DS configuration was last updated in our system. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + public Builder scheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Additional information about the 3DS configuration, stored as key-value pairs. + */ + public Builder metadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public MerchantAccountThreeDSConfiguration build() { + + return new MerchantAccountThreeDSConfiguration( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + id, merchantAccountId, createdAt, + updatedAt, scheme, currency, + metadata); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"merchant-account.three-ds-configuration\"", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationCreate.java b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationCreate.java new file mode 100644 index 00000000..b54ccd6c --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationCreate.java @@ -0,0 +1,445 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class MerchantAccountThreeDSConfigurationCreate { + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_acquirer_bin") + private String merchantAcquirerBin; + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_acquirer_id") + private String merchantAcquirerId; + + + @JsonProperty("merchant_name") + private String merchantName; + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonProperty("merchant_country_code") + private String merchantCountryCode; + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonProperty("merchant_category_code") + private String merchantCategoryCode; + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonProperty("merchant_url") + private String merchantUrl; + + + @JsonProperty("scheme") + private CardScheme scheme; + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + @JsonProperty("metadata") + private Map metadata; + + @JsonCreator + public MerchantAccountThreeDSConfigurationCreate( + @JsonProperty("merchant_acquirer_bin") String merchantAcquirerBin, + @JsonProperty("merchant_acquirer_id") String merchantAcquirerId, + @JsonProperty("merchant_name") String merchantName, + @JsonProperty("merchant_country_code") String merchantCountryCode, + @JsonProperty("merchant_category_code") String merchantCategoryCode, + @JsonProperty("merchant_url") String merchantUrl, + @JsonProperty("scheme") CardScheme scheme, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("metadata") Map metadata) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + Utils.checkNotNull(merchantName, "merchantName"); + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + Utils.checkNotNull(merchantUrl, "merchantUrl"); + Utils.checkNotNull(scheme, "scheme"); + Utils.checkNotNull(currency, "currency"); + metadata = Utils.emptyMapIfNull(metadata); + Utils.checkNotNull(metadata, "metadata"); + this.merchantAcquirerBin = merchantAcquirerBin; + this.merchantAcquirerId = merchantAcquirerId; + this.merchantName = merchantName; + this.merchantCountryCode = merchantCountryCode; + this.merchantCategoryCode = merchantCategoryCode; + this.merchantUrl = merchantUrl; + this.scheme = scheme; + this.currency = currency; + this.metadata = metadata; + } + + public MerchantAccountThreeDSConfigurationCreate( + String merchantAcquirerBin, + String merchantAcquirerId, + String merchantName, + String merchantCountryCode, + String merchantCategoryCode, + String merchantUrl, + CardScheme scheme, + Map metadata) { + this(merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + scheme, JsonNullable.undefined(), metadata); + } + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantAcquirerBin() { + return merchantAcquirerBin; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantAcquirerId() { + return merchantAcquirerId; + } + + @JsonIgnore + public String merchantName() { + return merchantName; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonIgnore + public String merchantCountryCode() { + return merchantCountryCode; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonIgnore + public String merchantUrl() { + return merchantUrl; + } + + @JsonIgnore + public CardScheme scheme() { + return scheme; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + @JsonIgnore + public JsonNullable currency() { + return currency; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + @JsonIgnore + public Map metadata() { + return metadata; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationCreate withMerchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationCreate withMerchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + public MerchantAccountThreeDSConfigurationCreate withMerchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public MerchantAccountThreeDSConfigurationCreate withMerchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationCreate withMerchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationCreate withMerchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + public MerchantAccountThreeDSConfigurationCreate withScheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public MerchantAccountThreeDSConfigurationCreate withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public MerchantAccountThreeDSConfigurationCreate withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public MerchantAccountThreeDSConfigurationCreate withMetadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantAccountThreeDSConfigurationCreate other = (MerchantAccountThreeDSConfigurationCreate) o; + return + Utils.enhancedDeepEquals(this.merchantAcquirerBin, other.merchantAcquirerBin) && + Utils.enhancedDeepEquals(this.merchantAcquirerId, other.merchantAcquirerId) && + Utils.enhancedDeepEquals(this.merchantName, other.merchantName) && + Utils.enhancedDeepEquals(this.merchantCountryCode, other.merchantCountryCode) && + Utils.enhancedDeepEquals(this.merchantCategoryCode, other.merchantCategoryCode) && + Utils.enhancedDeepEquals(this.merchantUrl, other.merchantUrl) && + Utils.enhancedDeepEquals(this.scheme, other.scheme) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + scheme, currency, metadata); + } + + @Override + public String toString() { + return Utils.toString(MerchantAccountThreeDSConfigurationCreate.class, + "merchantAcquirerBin", merchantAcquirerBin, + "merchantAcquirerId", merchantAcquirerId, + "merchantName", merchantName, + "merchantCountryCode", merchantCountryCode, + "merchantCategoryCode", merchantCategoryCode, + "merchantUrl", merchantUrl, + "scheme", scheme, + "currency", currency, + "metadata", metadata); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAcquirerBin; + + private String merchantAcquirerId; + + private String merchantName; + + private String merchantCountryCode; + + private String merchantCategoryCode; + + private String merchantUrl; + + private CardScheme scheme; + + private JsonNullable currency = JsonNullable.undefined(); + + private Map metadata; + + private Builder() { + // force use of static builder() method + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + + public Builder merchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public Builder merchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public Builder merchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + + /** + * URL to send when calling 3DS through this scheme. + */ + public Builder merchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + + public Builder scheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public Builder metadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public MerchantAccountThreeDSConfigurationCreate build() { + + return new MerchantAccountThreeDSConfigurationCreate( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + scheme, currency, metadata); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationUpdate.java b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationUpdate.java new file mode 100644 index 00000000..382eb346 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurationUpdate.java @@ -0,0 +1,598 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class MerchantAccountThreeDSConfigurationUpdate { + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_acquirer_bin") + private JsonNullable merchantAcquirerBin; + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_acquirer_id") + private JsonNullable merchantAcquirerId; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_name") + private JsonNullable merchantName; + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_country_code") + private JsonNullable merchantCountryCode; + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_category_code") + private JsonNullable merchantCategoryCode; + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_url") + private JsonNullable merchantUrl; + + /** + * The card scheme for this 3DS configuration + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scheme") + private JsonNullable scheme; + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private JsonNullable> metadata; + + @JsonCreator + public MerchantAccountThreeDSConfigurationUpdate( + @JsonProperty("merchant_acquirer_bin") JsonNullable merchantAcquirerBin, + @JsonProperty("merchant_acquirer_id") JsonNullable merchantAcquirerId, + @JsonProperty("merchant_name") JsonNullable merchantName, + @JsonProperty("merchant_country_code") JsonNullable merchantCountryCode, + @JsonProperty("merchant_category_code") JsonNullable merchantCategoryCode, + @JsonProperty("merchant_url") JsonNullable merchantUrl, + @JsonProperty("scheme") JsonNullable scheme, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("metadata") JsonNullable> metadata) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + Utils.checkNotNull(merchantName, "merchantName"); + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + Utils.checkNotNull(merchantUrl, "merchantUrl"); + Utils.checkNotNull(scheme, "scheme"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(metadata, "metadata"); + this.merchantAcquirerBin = merchantAcquirerBin; + this.merchantAcquirerId = merchantAcquirerId; + this.merchantName = merchantName; + this.merchantCountryCode = merchantCountryCode; + this.merchantCategoryCode = merchantCategoryCode; + this.merchantUrl = merchantUrl; + this.scheme = scheme; + this.currency = currency; + this.metadata = metadata; + } + + public MerchantAccountThreeDSConfigurationUpdate() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + @JsonIgnore + public JsonNullable merchantAcquirerBin() { + return merchantAcquirerBin; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + @JsonIgnore + public JsonNullable merchantAcquirerId() { + return merchantAcquirerId; + } + + @JsonIgnore + public JsonNullable merchantName() { + return merchantName; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + @JsonIgnore + public JsonNullable merchantCountryCode() { + return merchantCountryCode; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + @JsonIgnore + public JsonNullable merchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + @JsonIgnore + public JsonNullable merchantUrl() { + return merchantUrl; + } + + /** + * The card scheme for this 3DS configuration + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable scheme() { + return (JsonNullable) scheme; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + @JsonIgnore + public JsonNullable currency() { + return currency; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> metadata() { + return (JsonNullable>) metadata; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = JsonNullable.of(merchantAcquirerBin); + return this; + } + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantAcquirerBin(JsonNullable merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = JsonNullable.of(merchantAcquirerId); + return this; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantAcquirerId(JsonNullable merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + public MerchantAccountThreeDSConfigurationUpdate withMerchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = JsonNullable.of(merchantName); + return this; + } + + public MerchantAccountThreeDSConfigurationUpdate withMerchantName(JsonNullable merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = JsonNullable.of(merchantCountryCode); + return this; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantCountryCode(JsonNullable merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = JsonNullable.of(merchantCategoryCode); + return this; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantCategoryCode(JsonNullable merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = JsonNullable.of(merchantUrl); + return this; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + public MerchantAccountThreeDSConfigurationUpdate withMerchantUrl(JsonNullable merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + /** + * The card scheme for this 3DS configuration + */ + public MerchantAccountThreeDSConfigurationUpdate withScheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = JsonNullable.of(scheme); + return this; + } + + /** + * The card scheme for this 3DS configuration + */ + public MerchantAccountThreeDSConfigurationUpdate withScheme(JsonNullable scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public MerchantAccountThreeDSConfigurationUpdate withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public MerchantAccountThreeDSConfigurationUpdate withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public MerchantAccountThreeDSConfigurationUpdate withMetadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = JsonNullable.of(metadata); + return this; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public MerchantAccountThreeDSConfigurationUpdate withMetadata(JsonNullable> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantAccountThreeDSConfigurationUpdate other = (MerchantAccountThreeDSConfigurationUpdate) o; + return + Utils.enhancedDeepEquals(this.merchantAcquirerBin, other.merchantAcquirerBin) && + Utils.enhancedDeepEquals(this.merchantAcquirerId, other.merchantAcquirerId) && + Utils.enhancedDeepEquals(this.merchantName, other.merchantName) && + Utils.enhancedDeepEquals(this.merchantCountryCode, other.merchantCountryCode) && + Utils.enhancedDeepEquals(this.merchantCategoryCode, other.merchantCategoryCode) && + Utils.enhancedDeepEquals(this.merchantUrl, other.merchantUrl) && + Utils.enhancedDeepEquals(this.scheme, other.scheme) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + scheme, currency, metadata); + } + + @Override + public String toString() { + return Utils.toString(MerchantAccountThreeDSConfigurationUpdate.class, + "merchantAcquirerBin", merchantAcquirerBin, + "merchantAcquirerId", merchantAcquirerId, + "merchantName", merchantName, + "merchantCountryCode", merchantCountryCode, + "merchantCategoryCode", merchantCategoryCode, + "merchantUrl", merchantUrl, + "scheme", scheme, + "currency", currency, + "metadata", metadata); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable merchantAcquirerBin = JsonNullable.undefined(); + + private JsonNullable merchantAcquirerId = JsonNullable.undefined(); + + private JsonNullable merchantName = JsonNullable.undefined(); + + private JsonNullable merchantCountryCode = JsonNullable.undefined(); + + private JsonNullable merchantCategoryCode = JsonNullable.undefined(); + + private JsonNullable merchantUrl = JsonNullable.undefined(); + + private JsonNullable scheme = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable> metadata = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerBin(String merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = JsonNullable.of(merchantAcquirerBin); + return this; + } + + /** + * Acquirer BIN to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerBin(JsonNullable merchantAcquirerBin) { + Utils.checkNotNull(merchantAcquirerBin, "merchantAcquirerBin"); + this.merchantAcquirerBin = merchantAcquirerBin; + return this; + } + + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerId(String merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = JsonNullable.of(merchantAcquirerId); + return this; + } + + /** + * Merchant ID to use when calling 3DS through this scheme. + */ + public Builder merchantAcquirerId(JsonNullable merchantAcquirerId) { + Utils.checkNotNull(merchantAcquirerId, "merchantAcquirerId"); + this.merchantAcquirerId = merchantAcquirerId; + return this; + } + + + public Builder merchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = JsonNullable.of(merchantName); + return this; + } + + public Builder merchantName(JsonNullable merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public Builder merchantCountryCode(String merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = JsonNullable.of(merchantCountryCode); + return this; + } + + /** + * The merchant's ISO 3166-1 numeric country code. + */ + public Builder merchantCountryCode(JsonNullable merchantCountryCode) { + Utils.checkNotNull(merchantCountryCode, "merchantCountryCode"); + this.merchantCountryCode = merchantCountryCode; + return this; + } + + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public Builder merchantCategoryCode(String merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = JsonNullable.of(merchantCategoryCode); + return this; + } + + /** + * Merchant category code to use when calling 3DS through this scheme. + */ + public Builder merchantCategoryCode(JsonNullable merchantCategoryCode) { + Utils.checkNotNull(merchantCategoryCode, "merchantCategoryCode"); + this.merchantCategoryCode = merchantCategoryCode; + return this; + } + + + /** + * URL to send when calling 3DS through this scheme. + */ + public Builder merchantUrl(String merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = JsonNullable.of(merchantUrl); + return this; + } + + /** + * URL to send when calling 3DS through this scheme. + */ + public Builder merchantUrl(JsonNullable merchantUrl) { + Utils.checkNotNull(merchantUrl, "merchantUrl"); + this.merchantUrl = merchantUrl; + return this; + } + + + /** + * The card scheme for this 3DS configuration + */ + public Builder scheme(CardScheme scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = JsonNullable.of(scheme); + return this; + } + + /** + * The card scheme for this 3DS configuration + */ + public Builder scheme(JsonNullable scheme) { + Utils.checkNotNull(scheme, "scheme"); + this.scheme = scheme; + return this; + } + + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public Builder metadata(Map metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = JsonNullable.of(metadata); + return this; + } + + /** + * Any additional information about the 3DS configuration that you would like to store as key-value + * pairs. + */ + public Builder metadata(JsonNullable> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public MerchantAccountThreeDSConfigurationUpdate build() { + + return new MerchantAccountThreeDSConfigurationUpdate( + merchantAcquirerBin, merchantAcquirerId, merchantName, + merchantCountryCode, merchantCategoryCode, merchantUrl, + scheme, currency, metadata); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurations.java b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurations.java new file mode 100644 index 00000000..c634f8df --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccountThreeDSConfigurations.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.List; + + +public class MerchantAccountThreeDSConfigurations { + /** + * A list of items returned for this request. + */ + @JsonProperty("items") + private List items; + + @JsonCreator + public MerchantAccountThreeDSConfigurations( + @JsonProperty("items") List items) { + Utils.checkNotNull(items, "items"); + this.items = items; + } + + /** + * A list of items returned for this request. + */ + @JsonIgnore + public List items() { + return items; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A list of items returned for this request. + */ + public MerchantAccountThreeDSConfigurations withItems(List items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantAccountThreeDSConfigurations other = (MerchantAccountThreeDSConfigurations) o; + return + Utils.enhancedDeepEquals(this.items, other.items); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + items); + } + + @Override + public String toString() { + return Utils.toString(MerchantAccountThreeDSConfigurations.class, + "items", items); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private List items; + + private Builder() { + // force use of static builder() method + } + + + /** + * A list of items returned for this request. + */ + public Builder items(List items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + public MerchantAccountThreeDSConfigurations build() { + + return new MerchantAccountThreeDSConfigurations( + items); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequest.java index 30199745..ae584adc 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequest.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequest.java @@ -34,6 +34,14 @@ public class CaptureTransactionRequest { @SpeakeasyMetadata("header:style=simple,explode=false,name=x-gr4vy-merchant-account-id") private JsonNullable merchantAccountId; + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=idempotency-key") + private JsonNullable idempotencyKey; + @SpeakeasyMetadata("request:mediaType=application/json") private TransactionCaptureCreate transactionCaptureCreate; @@ -43,14 +51,17 @@ public CaptureTransactionRequest( String transactionId, JsonNullable> prefer, JsonNullable merchantAccountId, + JsonNullable idempotencyKey, TransactionCaptureCreate transactionCaptureCreate) { Utils.checkNotNull(transactionId, "transactionId"); Utils.checkNotNull(prefer, "prefer"); Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(idempotencyKey, "idempotencyKey"); Utils.checkNotNull(transactionCaptureCreate, "transactionCaptureCreate"); this.transactionId = transactionId; this.prefer = prefer; this.merchantAccountId = merchantAccountId; + this.idempotencyKey = idempotencyKey; this.transactionCaptureCreate = transactionCaptureCreate; } @@ -58,7 +69,7 @@ public CaptureTransactionRequest( String transactionId, TransactionCaptureCreate transactionCaptureCreate) { this(transactionId, JsonNullable.undefined(), JsonNullable.undefined(), - transactionCaptureCreate); + JsonNullable.undefined(), transactionCaptureCreate); } /** @@ -86,6 +97,16 @@ public JsonNullable merchantAccountId() { return merchantAccountId; } + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + @JsonIgnore + public JsonNullable idempotencyKey() { + return idempotencyKey; + } + @JsonIgnore public TransactionCaptureCreate transactionCaptureCreate() { return transactionCaptureCreate; @@ -141,6 +162,28 @@ public CaptureTransactionRequest withMerchantAccountId(JsonNullable merc return this; } + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + public CaptureTransactionRequest withIdempotencyKey(String idempotencyKey) { + Utils.checkNotNull(idempotencyKey, "idempotencyKey"); + this.idempotencyKey = JsonNullable.of(idempotencyKey); + return this; + } + + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + public CaptureTransactionRequest withIdempotencyKey(JsonNullable idempotencyKey) { + Utils.checkNotNull(idempotencyKey, "idempotencyKey"); + this.idempotencyKey = idempotencyKey; + return this; + } + public CaptureTransactionRequest withTransactionCaptureCreate(TransactionCaptureCreate transactionCaptureCreate) { Utils.checkNotNull(transactionCaptureCreate, "transactionCaptureCreate"); this.transactionCaptureCreate = transactionCaptureCreate; @@ -160,6 +203,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.transactionId, other.transactionId) && Utils.enhancedDeepEquals(this.prefer, other.prefer) && Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.idempotencyKey, other.idempotencyKey) && Utils.enhancedDeepEquals(this.transactionCaptureCreate, other.transactionCaptureCreate); } @@ -167,7 +211,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( transactionId, prefer, merchantAccountId, - transactionCaptureCreate); + idempotencyKey, transactionCaptureCreate); } @Override @@ -176,6 +220,7 @@ public String toString() { "transactionId", transactionId, "prefer", prefer, "merchantAccountId", merchantAccountId, + "idempotencyKey", idempotencyKey, "transactionCaptureCreate", transactionCaptureCreate); } @@ -188,6 +233,8 @@ public final static class Builder { private JsonNullable merchantAccountId = JsonNullable.undefined(); + private JsonNullable idempotencyKey = JsonNullable.undefined(); + private TransactionCaptureCreate transactionCaptureCreate; private Builder() { @@ -243,6 +290,29 @@ public Builder merchantAccountId(JsonNullable merchantAccountId) { } + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + public Builder idempotencyKey(String idempotencyKey) { + Utils.checkNotNull(idempotencyKey, "idempotencyKey"); + this.idempotencyKey = JsonNullable.of(idempotencyKey); + return this; + } + + /** + * A unique key that identifies this request. Providing this header will make this an idempotent + * request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid + * collisions. + */ + public Builder idempotencyKey(JsonNullable idempotencyKey) { + Utils.checkNotNull(idempotencyKey, "idempotencyKey"); + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder transactionCaptureCreate(TransactionCaptureCreate transactionCaptureCreate) { Utils.checkNotNull(transactionCaptureCreate, "transactionCaptureCreate"); this.transactionCaptureCreate = transactionCaptureCreate; @@ -253,7 +323,7 @@ public CaptureTransactionRequest build() { return new CaptureTransactionRequest( transactionId, prefer, merchantAccountId, - transactionCaptureCreate); + idempotencyKey, transactionCaptureCreate); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequestBuilder.java index 156b9dde..b691198e 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequestBuilder.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionRequestBuilder.java @@ -6,20 +6,13 @@ import static com.gr4vy.sdk.operations.Operations.RequestOperation; import com.gr4vy.sdk.SDKConfiguration; -import com.gr4vy.sdk.models.components.TransactionCaptureCreate; import com.gr4vy.sdk.operations.CaptureTransaction; import com.gr4vy.sdk.utils.Headers; import com.gr4vy.sdk.utils.Utils; -import java.lang.String; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; public class CaptureTransactionRequestBuilder { - private String transactionId; - private JsonNullable> prefer = JsonNullable.undefined(); - private JsonNullable merchantAccountId = JsonNullable.undefined(); - private TransactionCaptureCreate transactionCaptureCreate; + private CaptureTransactionRequest request; private final SDKConfiguration sdkConfiguration; private final Headers _headers = new Headers(); @@ -27,58 +20,16 @@ public CaptureTransactionRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; } - public CaptureTransactionRequestBuilder transactionId(String transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); - this.transactionId = transactionId; + public CaptureTransactionRequestBuilder request(CaptureTransactionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; return this; } - public CaptureTransactionRequestBuilder prefer(List prefer) { - Utils.checkNotNull(prefer, "prefer"); - this.prefer = JsonNullable.of(prefer); - return this; - } - - public CaptureTransactionRequestBuilder prefer(JsonNullable> prefer) { - Utils.checkNotNull(prefer, "prefer"); - this.prefer = prefer; - return this; - } - - public CaptureTransactionRequestBuilder merchantAccountId(String merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = JsonNullable.of(merchantAccountId); - return this; - } - - public CaptureTransactionRequestBuilder merchantAccountId(JsonNullable merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = merchantAccountId; - return this; - } - - public CaptureTransactionRequestBuilder transactionCaptureCreate(TransactionCaptureCreate transactionCaptureCreate) { - Utils.checkNotNull(transactionCaptureCreate, "transactionCaptureCreate"); - this.transactionCaptureCreate = transactionCaptureCreate; - return this; - } - - - private CaptureTransactionRequest buildRequest() { - - CaptureTransactionRequest request = new CaptureTransactionRequest(transactionId, - prefer, - merchantAccountId, - transactionCaptureCreate); - - return request; - } - public CaptureTransactionResponse call() { RequestOperation operation = new CaptureTransaction.Sync(sdkConfiguration, _headers); - CaptureTransactionRequest request = buildRequest(); return operation.handleResponse(operation.doRequest(request)); } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionResponse.java index ac3cc4a4..a148a9fe 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/CaptureTransactionResponse.java @@ -35,22 +35,22 @@ public class CaptureTransactionResponse implements Response { /** * Successful Response */ - private Optional responseCaptureTransaction; + private Optional response200CaptureTransaction; @JsonCreator public CaptureTransactionResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional responseCaptureTransaction) { + Optional response200CaptureTransaction) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.responseCaptureTransaction = responseCaptureTransaction; + this.response200CaptureTransaction = response200CaptureTransaction; } public CaptureTransactionResponse( @@ -90,8 +90,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional responseCaptureTransaction() { - return (Optional) responseCaptureTransaction; + public Optional response200CaptureTransaction() { + return (Optional) response200CaptureTransaction; } public static Builder builder() { @@ -129,9 +129,9 @@ public CaptureTransactionResponse withRawResponse(HttpResponse rawR /** * Successful Response */ - public CaptureTransactionResponse withResponseCaptureTransaction(ResponseCaptureTransaction responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = Optional.ofNullable(responseCaptureTransaction); + public CaptureTransactionResponse withResponse200CaptureTransaction(Response200CaptureTransaction response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = Optional.ofNullable(response200CaptureTransaction); return this; } @@ -139,9 +139,9 @@ public CaptureTransactionResponse withResponseCaptureTransaction(ResponseCapture /** * Successful Response */ - public CaptureTransactionResponse withResponseCaptureTransaction(Optional responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = responseCaptureTransaction; + public CaptureTransactionResponse withResponse200CaptureTransaction(Optional response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = response200CaptureTransaction; return this; } @@ -158,14 +158,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.responseCaptureTransaction, other.responseCaptureTransaction); + Utils.enhancedDeepEquals(this.response200CaptureTransaction, other.response200CaptureTransaction); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - responseCaptureTransaction); + response200CaptureTransaction); } @Override @@ -174,7 +174,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "responseCaptureTransaction", responseCaptureTransaction); + "response200CaptureTransaction", response200CaptureTransaction); } @SuppressWarnings("UnusedReturnValue") @@ -186,7 +186,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional responseCaptureTransaction = Optional.empty(); + private Optional response200CaptureTransaction = Optional.empty(); private Builder() { // force use of static builder() method @@ -226,18 +226,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder responseCaptureTransaction(ResponseCaptureTransaction responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = Optional.ofNullable(responseCaptureTransaction); + public Builder response200CaptureTransaction(Response200CaptureTransaction response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = Optional.ofNullable(response200CaptureTransaction); return this; } /** * Successful Response */ - public Builder responseCaptureTransaction(Optional responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = responseCaptureTransaction; + public Builder response200CaptureTransaction(Optional response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = response200CaptureTransaction; return this; } @@ -245,7 +245,7 @@ public CaptureTransactionResponse build() { return new CaptureTransactionResponse( contentType, statusCode, rawResponse, - responseCaptureTransaction); + response200CaptureTransaction); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequest.java new file mode 100644 index 00000000..a550a35b --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class CreateThreeDsConfigurationRequest { + /** + * The ID of the merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") + private String merchantAccountId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate; + + @JsonCreator + public CreateThreeDsConfigurationRequest( + String merchantAccountId, + MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(merchantAccountThreeDSConfigurationCreate, "merchantAccountThreeDSConfigurationCreate"); + this.merchantAccountId = merchantAccountId; + this.merchantAccountThreeDSConfigurationCreate = merchantAccountThreeDSConfigurationCreate; + } + + /** + * The ID of the merchant account. + */ + @JsonIgnore + public String merchantAccountId() { + return merchantAccountId; + } + + @JsonIgnore + public MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate() { + return merchantAccountThreeDSConfigurationCreate; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the merchant account. + */ + public CreateThreeDsConfigurationRequest withMerchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public CreateThreeDsConfigurationRequest withMerchantAccountThreeDSConfigurationCreate(MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationCreate, "merchantAccountThreeDSConfigurationCreate"); + this.merchantAccountThreeDSConfigurationCreate = merchantAccountThreeDSConfigurationCreate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateThreeDsConfigurationRequest other = (CreateThreeDsConfigurationRequest) o; + return + Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfigurationCreate, other.merchantAccountThreeDSConfigurationCreate); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAccountId, merchantAccountThreeDSConfigurationCreate); + } + + @Override + public String toString() { + return Utils.toString(CreateThreeDsConfigurationRequest.class, + "merchantAccountId", merchantAccountId, + "merchantAccountThreeDSConfigurationCreate", merchantAccountThreeDSConfigurationCreate); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAccountId; + + private MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the merchant account. + */ + public Builder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + + public Builder merchantAccountThreeDSConfigurationCreate(MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationCreate, "merchantAccountThreeDSConfigurationCreate"); + this.merchantAccountThreeDSConfigurationCreate = merchantAccountThreeDSConfigurationCreate; + return this; + } + + public CreateThreeDsConfigurationRequest build() { + + return new CreateThreeDsConfigurationRequest( + merchantAccountId, merchantAccountThreeDSConfigurationCreate); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..a383f0d4 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.operations.CreateThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; + +public class CreateThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public CreateThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CreateThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public CreateThreeDsConfigurationRequestBuilder merchantAccountThreeDSConfigurationCreate(MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationCreate, "merchantAccountThreeDSConfigurationCreate"); + this.merchantAccountThreeDSConfigurationCreate = merchantAccountThreeDSConfigurationCreate; + return this; + } + + + private CreateThreeDsConfigurationRequest buildRequest() { + + CreateThreeDsConfigurationRequest request = new CreateThreeDsConfigurationRequest(merchantAccountId, + merchantAccountThreeDSConfigurationCreate); + + return request; + } + + public CreateThreeDsConfigurationResponse call() { + + RequestOperation operation + = new CreateThreeDsConfiguration.Sync(sdkConfiguration, _headers); + CreateThreeDsConfigurationRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationResponse.java new file mode 100644 index 00000000..531b95df --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateThreeDsConfigurationResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateThreeDsConfigurationResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfiguration; + + @JsonCreator + public CreateThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + } + + public CreateThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfiguration() { + return (Optional) merchantAccountThreeDSConfiguration; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CreateThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public CreateThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + + /** + * Successful Response + */ + public CreateThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateThreeDsConfigurationResponse other = (CreateThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfiguration, other.merchantAccountThreeDSConfiguration); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + @Override + public String toString() { + return Utils.toString(CreateThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfiguration", merchantAccountThreeDSConfiguration); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfiguration = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + public CreateThreeDsConfigurationResponse build() { + + return new CreateThreeDsConfigurationResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequest.java new file mode 100644 index 00000000..b2f835e2 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequest.java @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class DeleteThreeDsConfigurationRequest { + /** + * The ID of the merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") + private String merchantAccountId; + + /** + * The ID of the 3DS configuration for a merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=three_ds_configuration_id") + private String threeDsConfigurationId; + + @JsonCreator + public DeleteThreeDsConfigurationRequest( + String merchantAccountId, + String threeDsConfigurationId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.merchantAccountId = merchantAccountId; + this.threeDsConfigurationId = threeDsConfigurationId; + } + + /** + * The ID of the merchant account. + */ + @JsonIgnore + public String merchantAccountId() { + return merchantAccountId; + } + + /** + * The ID of the 3DS configuration for a merchant account. + */ + @JsonIgnore + public String threeDsConfigurationId() { + return threeDsConfigurationId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the merchant account. + */ + public DeleteThreeDsConfigurationRequest withMerchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The ID of the 3DS configuration for a merchant account. + */ + public DeleteThreeDsConfigurationRequest withThreeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteThreeDsConfigurationRequest other = (DeleteThreeDsConfigurationRequest) o; + return + Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.threeDsConfigurationId, other.threeDsConfigurationId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAccountId, threeDsConfigurationId); + } + + @Override + public String toString() { + return Utils.toString(DeleteThreeDsConfigurationRequest.class, + "merchantAccountId", merchantAccountId, + "threeDsConfigurationId", threeDsConfigurationId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAccountId; + + private String threeDsConfigurationId; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the merchant account. + */ + public Builder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + + /** + * The ID of the 3DS configuration for a merchant account. + */ + public Builder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + public DeleteThreeDsConfigurationRequest build() { + + return new DeleteThreeDsConfigurationRequest( + merchantAccountId, threeDsConfigurationId); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..f3056731 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.operations.DeleteThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; + +public class DeleteThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private String threeDsConfigurationId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public DeleteThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeleteThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public DeleteThreeDsConfigurationRequestBuilder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + + private DeleteThreeDsConfigurationRequest buildRequest() { + + DeleteThreeDsConfigurationRequest request = new DeleteThreeDsConfigurationRequest(merchantAccountId, + threeDsConfigurationId); + + return request; + } + + public DeleteThreeDsConfigurationResponse call() { + + RequestOperation operation + = new DeleteThreeDsConfiguration.Sync(sdkConfiguration, _headers); + DeleteThreeDsConfigurationRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationResponse.java new file mode 100644 index 00000000..1fa38b0c --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteThreeDsConfigurationResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeleteThreeDsConfigurationResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeleteThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteThreeDsConfigurationResponse other = (DeleteThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteThreeDsConfigurationResponse build() { + + return new DeleteThreeDsConfigurationResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequest.java new file mode 100644 index 00000000..16501ee3 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequest.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class EditThreeDsConfigurationRequest { + /** + * The ID of the merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") + private String merchantAccountId; + + /** + * The ID of the 3DS configuration for a merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=three_ds_configuration_id") + private String threeDsConfigurationId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate; + + @JsonCreator + public EditThreeDsConfigurationRequest( + String merchantAccountId, + String threeDsConfigurationId, + MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + Utils.checkNotNull(merchantAccountThreeDSConfigurationUpdate, "merchantAccountThreeDSConfigurationUpdate"); + this.merchantAccountId = merchantAccountId; + this.threeDsConfigurationId = threeDsConfigurationId; + this.merchantAccountThreeDSConfigurationUpdate = merchantAccountThreeDSConfigurationUpdate; + } + + /** + * The ID of the merchant account. + */ + @JsonIgnore + public String merchantAccountId() { + return merchantAccountId; + } + + /** + * The ID of the 3DS configuration for a merchant account. + */ + @JsonIgnore + public String threeDsConfigurationId() { + return threeDsConfigurationId; + } + + @JsonIgnore + public MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate() { + return merchantAccountThreeDSConfigurationUpdate; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the merchant account. + */ + public EditThreeDsConfigurationRequest withMerchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The ID of the 3DS configuration for a merchant account. + */ + public EditThreeDsConfigurationRequest withThreeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + public EditThreeDsConfigurationRequest withMerchantAccountThreeDSConfigurationUpdate(MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationUpdate, "merchantAccountThreeDSConfigurationUpdate"); + this.merchantAccountThreeDSConfigurationUpdate = merchantAccountThreeDSConfigurationUpdate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EditThreeDsConfigurationRequest other = (EditThreeDsConfigurationRequest) o; + return + Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.threeDsConfigurationId, other.threeDsConfigurationId) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfigurationUpdate, other.merchantAccountThreeDSConfigurationUpdate); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAccountId, threeDsConfigurationId, merchantAccountThreeDSConfigurationUpdate); + } + + @Override + public String toString() { + return Utils.toString(EditThreeDsConfigurationRequest.class, + "merchantAccountId", merchantAccountId, + "threeDsConfigurationId", threeDsConfigurationId, + "merchantAccountThreeDSConfigurationUpdate", merchantAccountThreeDSConfigurationUpdate); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAccountId; + + private String threeDsConfigurationId; + + private MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the merchant account. + */ + public Builder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + + /** + * The ID of the 3DS configuration for a merchant account. + */ + public Builder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + + public Builder merchantAccountThreeDSConfigurationUpdate(MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationUpdate, "merchantAccountThreeDSConfigurationUpdate"); + this.merchantAccountThreeDSConfigurationUpdate = merchantAccountThreeDSConfigurationUpdate; + return this; + } + + public EditThreeDsConfigurationRequest build() { + + return new EditThreeDsConfigurationRequest( + merchantAccountId, threeDsConfigurationId, merchantAccountThreeDSConfigurationUpdate); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..c42f7e0f --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.operations.EditThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; + +public class EditThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private String threeDsConfigurationId; + private MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public EditThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public EditThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public EditThreeDsConfigurationRequestBuilder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + public EditThreeDsConfigurationRequestBuilder merchantAccountThreeDSConfigurationUpdate(MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationUpdate, "merchantAccountThreeDSConfigurationUpdate"); + this.merchantAccountThreeDSConfigurationUpdate = merchantAccountThreeDSConfigurationUpdate; + return this; + } + + + private EditThreeDsConfigurationRequest buildRequest() { + + EditThreeDsConfigurationRequest request = new EditThreeDsConfigurationRequest(merchantAccountId, + threeDsConfigurationId, + merchantAccountThreeDSConfigurationUpdate); + + return request; + } + + public EditThreeDsConfigurationResponse call() { + + RequestOperation operation + = new EditThreeDsConfiguration.Sync(sdkConfiguration, _headers); + EditThreeDsConfigurationRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationResponse.java new file mode 100644 index 00000000..464629aa --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/EditThreeDsConfigurationResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditThreeDsConfigurationResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfiguration; + + @JsonCreator + public EditThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + } + + public EditThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfiguration() { + return (Optional) merchantAccountThreeDSConfiguration; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public EditThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public EditThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EditThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public EditThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + + /** + * Successful Response + */ + public EditThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EditThreeDsConfigurationResponse other = (EditThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfiguration, other.merchantAccountThreeDSConfiguration); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + @Override + public String toString() { + return Utils.toString(EditThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfiguration", merchantAccountThreeDSConfiguration); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfiguration = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + public EditThreeDsConfigurationResponse build() { + + return new EditThreeDsConfigurationResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequest.java index 22c5eb4e..fd2375d8 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequest.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountRequest.java @@ -13,7 +13,7 @@ public class GetMerchantAccountRequest { /** - * The ID of the merchant account + * The ID of the merchant account. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") private String merchantAccountId; @@ -26,7 +26,7 @@ public GetMerchantAccountRequest( } /** - * The ID of the merchant account + * The ID of the merchant account. */ @JsonIgnore public String merchantAccountId() { @@ -39,7 +39,7 @@ public static Builder builder() { /** - * The ID of the merchant account + * The ID of the merchant account. */ public GetMerchantAccountRequest withMerchantAccountId(String merchantAccountId) { Utils.checkNotNull(merchantAccountId, "merchantAccountId"); @@ -83,7 +83,7 @@ private Builder() { /** - * The ID of the merchant account + * The ID of the merchant account. */ public Builder merchantAccountId(String merchantAccountId) { Utils.checkNotNull(merchantAccountId, "merchantAccountId"); diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequest.java new file mode 100644 index 00000000..3ae09464 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequest.java @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListThreeDsConfigurationsRequest { + /** + * The ID of the merchant account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") + private String merchantAccountId; + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=currency") + private JsonNullable currency; + + @JsonCreator + public ListThreeDsConfigurationsRequest( + String merchantAccountId, + JsonNullable currency) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + Utils.checkNotNull(currency, "currency"); + this.merchantAccountId = merchantAccountId; + this.currency = currency; + } + + public ListThreeDsConfigurationsRequest( + String merchantAccountId) { + this(merchantAccountId, JsonNullable.undefined()); + } + + /** + * The ID of the merchant account. + */ + @JsonIgnore + public String merchantAccountId() { + return merchantAccountId; + } + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + @JsonIgnore + public JsonNullable currency() { + return currency; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the merchant account. + */ + public ListThreeDsConfigurationsRequest withMerchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + public ListThreeDsConfigurationsRequest withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + public ListThreeDsConfigurationsRequest withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListThreeDsConfigurationsRequest other = (ListThreeDsConfigurationsRequest) o; + return + Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId) && + Utils.enhancedDeepEquals(this.currency, other.currency); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + merchantAccountId, currency); + } + + @Override + public String toString() { + return Utils.toString(ListThreeDsConfigurationsRequest.class, + "merchantAccountId", merchantAccountId, + "currency", currency); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String merchantAccountId; + + private JsonNullable currency = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the merchant account. + */ + public Builder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * ISO 4217 currency code (3 characters) to filter 3DS configurations. + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public ListThreeDsConfigurationsRequest build() { + + return new ListThreeDsConfigurationsRequest( + merchantAccountId, currency); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequestBuilder.java new file mode 100644 index 00000000..5ad7c4f2 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsRequestBuilder.java @@ -0,0 +1,80 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.operations.ListThreeDsConfigurations; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ListThreeDsConfigurationsRequestBuilder { + + private String merchantAccountId; + private JsonNullable currency = JsonNullable.undefined(); + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public ListThreeDsConfigurationsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ListThreeDsConfigurationsRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public ListThreeDsConfigurationsRequestBuilder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + public ListThreeDsConfigurationsRequestBuilder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public ListThreeDsConfigurationsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ListThreeDsConfigurationsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private ListThreeDsConfigurationsRequest buildRequest() { + + ListThreeDsConfigurationsRequest request = new ListThreeDsConfigurationsRequest(merchantAccountId, + currency); + + return request; + } + + public ListThreeDsConfigurationsResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new ListThreeDsConfigurations.Sync(sdkConfiguration, options, _headers); + ListThreeDsConfigurationsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsResponse.java new file mode 100644 index 00000000..9ee9a78a --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListThreeDsConfigurationsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurations; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListThreeDsConfigurationsResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfigurations; + + @JsonCreator + public ListThreeDsConfigurationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + } + + public ListThreeDsConfigurationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfigurations() { + return (Optional) merchantAccountThreeDSConfigurations; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ListThreeDsConfigurationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListThreeDsConfigurationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListThreeDsConfigurationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public ListThreeDsConfigurationsResponse withMerchantAccountThreeDSConfigurations(MerchantAccountThreeDSConfigurations merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = Optional.ofNullable(merchantAccountThreeDSConfigurations); + return this; + } + + + /** + * Successful Response + */ + public ListThreeDsConfigurationsResponse withMerchantAccountThreeDSConfigurations(Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListThreeDsConfigurationsResponse other = (ListThreeDsConfigurationsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfigurations, other.merchantAccountThreeDSConfigurations); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfigurations); + } + + @Override + public String toString() { + return Utils.toString(ListThreeDsConfigurationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfigurations", merchantAccountThreeDSConfigurations); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfigurations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfigurations(MerchantAccountThreeDSConfigurations merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = Optional.ofNullable(merchantAccountThreeDSConfigurations); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfigurations(Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + return this; + } + + public ListThreeDsConfigurationsResponse build() { + + return new ListThreeDsConfigurationsResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfigurations); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ResponseCaptureTransaction.java b/src/main/java/com/gr4vy/sdk/models/operations/Response200CaptureTransaction.java similarity index 74% rename from src/main/java/com/gr4vy/sdk/models/operations/ResponseCaptureTransaction.java rename to src/main/java/com/gr4vy/sdk/models/operations/Response200CaptureTransaction.java index f5ffff4a..878b8e5a 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/ResponseCaptureTransaction.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/Response200CaptureTransaction.java @@ -18,28 +18,28 @@ import java.lang.SuppressWarnings; /** - * ResponseCaptureTransaction + * Response200CaptureTransaction * *

Successful Response */ -@JsonDeserialize(using = ResponseCaptureTransaction._Deserializer.class) -public class ResponseCaptureTransaction { +@JsonDeserialize(using = Response200CaptureTransaction._Deserializer.class) +public class Response200CaptureTransaction { @JsonValue private final TypedObject value; - private ResponseCaptureTransaction(TypedObject value) { + private Response200CaptureTransaction(TypedObject value) { this.value = value; } - public static ResponseCaptureTransaction of(Transaction value) { + public static Response200CaptureTransaction of(Transaction value) { Utils.checkNotNull(value, "value"); - return new ResponseCaptureTransaction(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + return new Response200CaptureTransaction(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); } - public static ResponseCaptureTransaction of(TransactionCapture value) { + public static Response200CaptureTransaction of(TransactionCapture value) { Utils.checkNotNull(value, "value"); - return new ResponseCaptureTransaction(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + return new Response200CaptureTransaction(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); } /** @@ -72,7 +72,7 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ResponseCaptureTransaction other = (ResponseCaptureTransaction) o; + Response200CaptureTransaction other = (Response200CaptureTransaction) o; return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @@ -82,10 +82,10 @@ public int hashCode() { } @SuppressWarnings("serial") - public static final class _Deserializer extends OneOfDeserializer { + public static final class _Deserializer extends OneOfDeserializer { public _Deserializer() { - super(ResponseCaptureTransaction.class, false, + super(Response200CaptureTransaction.class, false, TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); } @@ -93,7 +93,7 @@ public _Deserializer() { @Override public String toString() { - return Utils.toString(ResponseCaptureTransaction.class, + return Utils.toString(Response200CaptureTransaction.class, "value", value); } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequest.java index 08cf6681..9f7ce612 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequest.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountRequest.java @@ -14,7 +14,7 @@ public class UpdateMerchantAccountRequest { /** - * The ID of the merchant account + * The ID of the merchant account. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=merchant_account_id") private String merchantAccountId; @@ -34,7 +34,7 @@ public UpdateMerchantAccountRequest( } /** - * The ID of the merchant account + * The ID of the merchant account. */ @JsonIgnore public String merchantAccountId() { @@ -52,7 +52,7 @@ public static Builder builder() { /** - * The ID of the merchant account + * The ID of the merchant account. */ public UpdateMerchantAccountRequest withMerchantAccountId(String merchantAccountId) { Utils.checkNotNull(merchantAccountId, "merchantAccountId"); @@ -106,7 +106,7 @@ private Builder() { /** - * The ID of the merchant account + * The ID of the merchant account. */ public Builder merchantAccountId(String merchantAccountId) { Utils.checkNotNull(merchantAccountId, "merchantAccountId"); diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionRequestBuilder.java index a73c11cf..efa3a353 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionRequestBuilder.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionRequestBuilder.java @@ -6,22 +6,15 @@ import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; import com.gr4vy.sdk.SDKConfiguration; -import com.gr4vy.sdk.models.components.TransactionCaptureCreate; import com.gr4vy.sdk.models.operations.CaptureTransactionRequest; import com.gr4vy.sdk.operations.CaptureTransaction; import com.gr4vy.sdk.utils.Headers; import com.gr4vy.sdk.utils.Utils; -import java.lang.String; -import java.util.List; import java.util.concurrent.CompletableFuture; -import org.openapitools.jackson.nullable.JsonNullable; public class CaptureTransactionRequestBuilder { - private String transactionId; - private JsonNullable> prefer = JsonNullable.undefined(); - private JsonNullable merchantAccountId = JsonNullable.undefined(); - private TransactionCaptureCreate transactionCaptureCreate; + private CaptureTransactionRequest request; private final SDKConfiguration sdkConfiguration; private final Headers _headers = new Headers(); @@ -29,58 +22,16 @@ public CaptureTransactionRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; } - public CaptureTransactionRequestBuilder transactionId(String transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); - this.transactionId = transactionId; + public CaptureTransactionRequestBuilder request(CaptureTransactionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; return this; } - public CaptureTransactionRequestBuilder prefer(List prefer) { - Utils.checkNotNull(prefer, "prefer"); - this.prefer = JsonNullable.of(prefer); - return this; - } - - public CaptureTransactionRequestBuilder prefer(JsonNullable> prefer) { - Utils.checkNotNull(prefer, "prefer"); - this.prefer = prefer; - return this; - } - - public CaptureTransactionRequestBuilder merchantAccountId(String merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = JsonNullable.of(merchantAccountId); - return this; - } - - public CaptureTransactionRequestBuilder merchantAccountId(JsonNullable merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = merchantAccountId; - return this; - } - - public CaptureTransactionRequestBuilder transactionCaptureCreate(TransactionCaptureCreate transactionCaptureCreate) { - Utils.checkNotNull(transactionCaptureCreate, "transactionCaptureCreate"); - this.transactionCaptureCreate = transactionCaptureCreate; - return this; - } - - - private CaptureTransactionRequest buildRequest() { - - CaptureTransactionRequest request = new CaptureTransactionRequest(transactionId, - prefer, - merchantAccountId, - transactionCaptureCreate); - - return request; - } - public CompletableFuture call() { AsyncRequestOperation operation = new CaptureTransaction.Async(sdkConfiguration, _headers); - CaptureTransactionRequest request = buildRequest(); return operation.doRequest(request) .thenCompose(operation::handleResponse); diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionResponse.java index 2aaf3903..0ba27e4a 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CaptureTransactionResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.operations.ResponseCaptureTransaction; +import com.gr4vy.sdk.models.operations.Response200CaptureTransaction; import com.gr4vy.sdk.utils.AsyncResponse; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Utils; @@ -36,22 +36,22 @@ public class CaptureTransactionResponse implements AsyncResponse { /** * Successful Response */ - private Optional responseCaptureTransaction; + private Optional response200CaptureTransaction; @JsonCreator public CaptureTransactionResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional responseCaptureTransaction) { + Optional response200CaptureTransaction) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.responseCaptureTransaction = responseCaptureTransaction; + this.response200CaptureTransaction = response200CaptureTransaction; } public CaptureTransactionResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional responseCaptureTransaction() { - return (Optional) responseCaptureTransaction; + public Optional response200CaptureTransaction() { + return (Optional) response200CaptureTransaction; } public static Builder builder() { @@ -130,9 +130,9 @@ public CaptureTransactionResponse withRawResponse(HttpResponse rawResponse /** * Successful Response */ - public CaptureTransactionResponse withResponseCaptureTransaction(ResponseCaptureTransaction responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = Optional.ofNullable(responseCaptureTransaction); + public CaptureTransactionResponse withResponse200CaptureTransaction(Response200CaptureTransaction response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = Optional.ofNullable(response200CaptureTransaction); return this; } @@ -140,9 +140,9 @@ public CaptureTransactionResponse withResponseCaptureTransaction(ResponseCapture /** * Successful Response */ - public CaptureTransactionResponse withResponseCaptureTransaction(Optional responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = responseCaptureTransaction; + public CaptureTransactionResponse withResponse200CaptureTransaction(Optional response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = response200CaptureTransaction; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.responseCaptureTransaction, other.responseCaptureTransaction); + Utils.enhancedDeepEquals(this.response200CaptureTransaction, other.response200CaptureTransaction); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - responseCaptureTransaction); + response200CaptureTransaction); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "responseCaptureTransaction", responseCaptureTransaction); + "response200CaptureTransaction", response200CaptureTransaction); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional responseCaptureTransaction = Optional.empty(); + private Optional response200CaptureTransaction = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder responseCaptureTransaction(ResponseCaptureTransaction responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = Optional.ofNullable(responseCaptureTransaction); + public Builder response200CaptureTransaction(Response200CaptureTransaction response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = Optional.ofNullable(response200CaptureTransaction); return this; } /** * Successful Response */ - public Builder responseCaptureTransaction(Optional responseCaptureTransaction) { - Utils.checkNotNull(responseCaptureTransaction, "responseCaptureTransaction"); - this.responseCaptureTransaction = responseCaptureTransaction; + public Builder response200CaptureTransaction(Optional response200CaptureTransaction) { + Utils.checkNotNull(response200CaptureTransaction, "response200CaptureTransaction"); + this.response200CaptureTransaction = response200CaptureTransaction; return this; } @@ -246,7 +246,7 @@ public CaptureTransactionResponse build() { return new CaptureTransactionResponse( contentType, statusCode, rawResponse, - responseCaptureTransaction); + response200CaptureTransaction); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..fc0d5160 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationCreate; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationRequest; +import com.gr4vy.sdk.operations.CreateThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class CreateThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public CreateThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CreateThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public CreateThreeDsConfigurationRequestBuilder merchantAccountThreeDSConfigurationCreate(MerchantAccountThreeDSConfigurationCreate merchantAccountThreeDSConfigurationCreate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationCreate, "merchantAccountThreeDSConfigurationCreate"); + this.merchantAccountThreeDSConfigurationCreate = merchantAccountThreeDSConfigurationCreate; + return this; + } + + + private CreateThreeDsConfigurationRequest buildRequest() { + + CreateThreeDsConfigurationRequest request = new CreateThreeDsConfigurationRequest(merchantAccountId, + merchantAccountThreeDSConfigurationCreate); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new CreateThreeDsConfiguration.Async(sdkConfiguration, _headers); + CreateThreeDsConfigurationRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationResponse.java new file mode 100644 index 00000000..8bc54dc4 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateThreeDsConfigurationResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateThreeDsConfigurationResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfiguration; + + @JsonCreator + public CreateThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + } + + public CreateThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfiguration() { + return (Optional) merchantAccountThreeDSConfiguration; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CreateThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public CreateThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + + /** + * Successful Response + */ + public CreateThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateThreeDsConfigurationResponse other = (CreateThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfiguration, other.merchantAccountThreeDSConfiguration); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + @Override + public String toString() { + return Utils.toString(CreateThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfiguration", merchantAccountThreeDSConfiguration); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfiguration = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + public CreateThreeDsConfigurationResponse build() { + + return new CreateThreeDsConfigurationResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..9a2b9ea8 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationRequest; +import com.gr4vy.sdk.operations.DeleteThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class DeleteThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private String threeDsConfigurationId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public DeleteThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeleteThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public DeleteThreeDsConfigurationRequestBuilder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + + private DeleteThreeDsConfigurationRequest buildRequest() { + + DeleteThreeDsConfigurationRequest request = new DeleteThreeDsConfigurationRequest(merchantAccountId, + threeDsConfigurationId); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new DeleteThreeDsConfiguration.Async(sdkConfiguration, _headers); + DeleteThreeDsConfigurationRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationResponse.java new file mode 100644 index 00000000..5d1abe58 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteThreeDsConfigurationResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeleteThreeDsConfigurationResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeleteThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteThreeDsConfigurationResponse other = (DeleteThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteThreeDsConfigurationResponse build() { + + return new DeleteThreeDsConfigurationResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationRequestBuilder.java new file mode 100644 index 00000000..eb0368b1 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationRequestBuilder.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurationUpdate; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationRequest; +import com.gr4vy.sdk.operations.EditThreeDsConfiguration; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class EditThreeDsConfigurationRequestBuilder { + + private String merchantAccountId; + private String threeDsConfigurationId; + private MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public EditThreeDsConfigurationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public EditThreeDsConfigurationRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public EditThreeDsConfigurationRequestBuilder threeDsConfigurationId(String threeDsConfigurationId) { + Utils.checkNotNull(threeDsConfigurationId, "threeDsConfigurationId"); + this.threeDsConfigurationId = threeDsConfigurationId; + return this; + } + + public EditThreeDsConfigurationRequestBuilder merchantAccountThreeDSConfigurationUpdate(MerchantAccountThreeDSConfigurationUpdate merchantAccountThreeDSConfigurationUpdate) { + Utils.checkNotNull(merchantAccountThreeDSConfigurationUpdate, "merchantAccountThreeDSConfigurationUpdate"); + this.merchantAccountThreeDSConfigurationUpdate = merchantAccountThreeDSConfigurationUpdate; + return this; + } + + + private EditThreeDsConfigurationRequest buildRequest() { + + EditThreeDsConfigurationRequest request = new EditThreeDsConfigurationRequest(merchantAccountId, + threeDsConfigurationId, + merchantAccountThreeDSConfigurationUpdate); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new EditThreeDsConfiguration.Async(sdkConfiguration, _headers); + EditThreeDsConfigurationRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationResponse.java new file mode 100644 index 00000000..8e0e542d --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/EditThreeDsConfigurationResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditThreeDsConfigurationResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfiguration; + + @JsonCreator + public EditThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + } + + public EditThreeDsConfigurationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfiguration() { + return (Optional) merchantAccountThreeDSConfiguration; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public EditThreeDsConfigurationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public EditThreeDsConfigurationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EditThreeDsConfigurationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public EditThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + + /** + * Successful Response + */ + public EditThreeDsConfigurationResponse withMerchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EditThreeDsConfigurationResponse other = (EditThreeDsConfigurationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfiguration, other.merchantAccountThreeDSConfiguration); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + @Override + public String toString() { + return Utils.toString(EditThreeDsConfigurationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfiguration", merchantAccountThreeDSConfiguration); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfiguration = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(MerchantAccountThreeDSConfiguration merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = Optional.ofNullable(merchantAccountThreeDSConfiguration); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfiguration(Optional merchantAccountThreeDSConfiguration) { + Utils.checkNotNull(merchantAccountThreeDSConfiguration, "merchantAccountThreeDSConfiguration"); + this.merchantAccountThreeDSConfiguration = merchantAccountThreeDSConfiguration; + return this; + } + + public EditThreeDsConfigurationResponse build() { + + return new EditThreeDsConfigurationResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfiguration); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsRequestBuilder.java new file mode 100644 index 00000000..445bcc69 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsRequestBuilder.java @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsRequest; +import com.gr4vy.sdk.operations.ListThreeDsConfigurations; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ListThreeDsConfigurationsRequestBuilder { + + private String merchantAccountId; + private JsonNullable currency = JsonNullable.undefined(); + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public ListThreeDsConfigurationsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ListThreeDsConfigurationsRequestBuilder merchantAccountId(String merchantAccountId) { + Utils.checkNotNull(merchantAccountId, "merchantAccountId"); + this.merchantAccountId = merchantAccountId; + return this; + } + + public ListThreeDsConfigurationsRequestBuilder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + public ListThreeDsConfigurationsRequestBuilder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public ListThreeDsConfigurationsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ListThreeDsConfigurationsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private ListThreeDsConfigurationsRequest buildRequest() { + + ListThreeDsConfigurationsRequest request = new ListThreeDsConfigurationsRequest(merchantAccountId, + currency); + + return request; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new ListThreeDsConfigurations.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + ListThreeDsConfigurationsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsResponse.java new file mode 100644 index 00000000..d88c5137 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListThreeDsConfigurationsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurations; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListThreeDsConfigurationsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional merchantAccountThreeDSConfigurations; + + @JsonCreator + public ListThreeDsConfigurationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + } + + public ListThreeDsConfigurationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional merchantAccountThreeDSConfigurations() { + return (Optional) merchantAccountThreeDSConfigurations; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ListThreeDsConfigurationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListThreeDsConfigurationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListThreeDsConfigurationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public ListThreeDsConfigurationsResponse withMerchantAccountThreeDSConfigurations(MerchantAccountThreeDSConfigurations merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = Optional.ofNullable(merchantAccountThreeDSConfigurations); + return this; + } + + + /** + * Successful Response + */ + public ListThreeDsConfigurationsResponse withMerchantAccountThreeDSConfigurations(Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListThreeDsConfigurationsResponse other = (ListThreeDsConfigurationsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.merchantAccountThreeDSConfigurations, other.merchantAccountThreeDSConfigurations); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfigurations); + } + + @Override + public String toString() { + return Utils.toString(ListThreeDsConfigurationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "merchantAccountThreeDSConfigurations", merchantAccountThreeDSConfigurations); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional merchantAccountThreeDSConfigurations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfigurations(MerchantAccountThreeDSConfigurations merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = Optional.ofNullable(merchantAccountThreeDSConfigurations); + return this; + } + + /** + * Successful Response + */ + public Builder merchantAccountThreeDSConfigurations(Optional merchantAccountThreeDSConfigurations) { + Utils.checkNotNull(merchantAccountThreeDSConfigurations, "merchantAccountThreeDSConfigurations"); + this.merchantAccountThreeDSConfigurations = merchantAccountThreeDSConfigurations; + return this; + } + + public ListThreeDsConfigurationsResponse build() { + + return new ListThreeDsConfigurationsResponse( + contentType, statusCode, rawResponse, + merchantAccountThreeDSConfigurations); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/CaptureTransaction.java b/src/main/java/com/gr4vy/sdk/operations/CaptureTransaction.java index c6ff6ce6..60062944 100644 --- a/src/main/java/com/gr4vy/sdk/operations/CaptureTransaction.java +++ b/src/main/java/com/gr4vy/sdk/operations/CaptureTransaction.java @@ -25,7 +25,7 @@ import com.gr4vy.sdk.models.errors.HTTPValidationError; import com.gr4vy.sdk.models.operations.CaptureTransactionRequest; import com.gr4vy.sdk.models.operations.CaptureTransactionResponse; -import com.gr4vy.sdk.models.operations.ResponseCaptureTransaction; +import com.gr4vy.sdk.models.operations.Response200CaptureTransaction; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Globals; import com.gr4vy.sdk.utils.HTTPClient; @@ -190,7 +190,7 @@ public CaptureTransactionResponse handleResponse(HttpResponse respo if (Utils.statusCodeMatches(response.statusCode(), "200")) { if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withResponseCaptureTransaction(Utils.unmarshal(response, new TypeReference() {})); + return res.withResponse200CaptureTransaction(Utils.unmarshal(response, new TypeReference() {})); } else { throw APIException.from("Unexpected content-type received: " + contentType, response); } @@ -344,8 +344,8 @@ public CompletableFuture() {}) - .thenApply(res::withResponseCaptureTransaction); + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withResponse200CaptureTransaction); } else { return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); } diff --git a/src/main/java/com/gr4vy/sdk/operations/CreateThreeDsConfiguration.java b/src/main/java/com/gr4vy/sdk/operations/CreateThreeDsConfiguration.java new file mode 100644 index 00000000..13fe379d --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/CreateThreeDsConfiguration.java @@ -0,0 +1,454 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.CreateThreeDsConfigurationResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.SerializedBody; +import com.gr4vy.sdk.utils.Utils.JsonShape; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.IllegalArgumentException; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class CreateThreeDsConfiguration { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/merchant-accounts/{merchant_account_id}/three-ds-configurations", + request, null); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "merchantAccountThreeDSConfigurationCreate", + "json", + false); + if (serializedRequestBody == null) { + throw new IllegalArgumentException("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(CreateThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, CreateThreeDsConfigurationRequest.class, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(CreateThreeDsConfigurationRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public CreateThreeDsConfigurationResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateThreeDsConfigurationResponse.Builder resBuilder = + CreateThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withMerchantAccountThreeDSConfiguration(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(CreateThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, CreateThreeDsConfigurationRequest.class, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(CreateThreeDsConfigurationRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.CreateThreeDsConfigurationResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.CreateThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.CreateThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withMerchantAccountThreeDSConfiguration); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/DeleteThreeDsConfiguration.java b/src/main/java/com/gr4vy/sdk/operations/DeleteThreeDsConfiguration.java new file mode 100644 index 00000000..423a9c12 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/DeleteThreeDsConfiguration.java @@ -0,0 +1,428 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.DeleteThreeDsConfigurationResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class DeleteThreeDsConfiguration { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(DeleteThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteThreeDsConfigurationRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(DeleteThreeDsConfigurationRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public DeleteThreeDsConfigurationResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteThreeDsConfigurationResponse.Builder resBuilder = + DeleteThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(DeleteThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteThreeDsConfigurationRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(DeleteThreeDsConfigurationRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.DeleteThreeDsConfigurationResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.DeleteThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.DeleteThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return CompletableFuture.completedFuture(res); + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/EditThreeDsConfiguration.java b/src/main/java/com/gr4vy/sdk/operations/EditThreeDsConfiguration.java new file mode 100644 index 00000000..6f676c1f --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/EditThreeDsConfiguration.java @@ -0,0 +1,454 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfiguration; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationRequest; +import com.gr4vy.sdk.models.operations.EditThreeDsConfigurationResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.SerializedBody; +import com.gr4vy.sdk.utils.Utils.JsonShape; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.IllegalArgumentException; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class EditThreeDsConfiguration { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "edit_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "edit_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "edit_three_ds_configuration", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "PUT"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "merchantAccountThreeDSConfigurationUpdate", + "json", + false); + if (serializedRequestBody == null) { + throw new IllegalArgumentException("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(EditThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, EditThreeDsConfigurationRequest.class, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(EditThreeDsConfigurationRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public EditThreeDsConfigurationResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EditThreeDsConfigurationResponse.Builder resBuilder = + EditThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EditThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withMerchantAccountThreeDSConfiguration(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(EditThreeDsConfigurationRequest request) throws Exception { + HttpRequest req = buildRequest(request, EditThreeDsConfigurationRequest.class, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(EditThreeDsConfigurationRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.EditThreeDsConfigurationResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.EditThreeDsConfigurationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.EditThreeDsConfigurationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withMerchantAccountThreeDSConfiguration); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/ListThreeDsConfigurations.java b/src/main/java/com/gr4vy/sdk/operations/ListThreeDsConfigurations.java new file mode 100644 index 00000000..f8fea4cb --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/ListThreeDsConfigurations.java @@ -0,0 +1,492 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.MerchantAccountThreeDSConfigurations; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsRequest; +import com.gr4vy.sdk.models.operations.ListThreeDsConfigurationsResponse; +import com.gr4vy.sdk.utils.AsyncRetries; +import com.gr4vy.sdk.utils.BackoffStrategy; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.NonRetryableException; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.Retries; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + + +public class ListThreeDsConfigurations { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final List retryStatusCodes; + final RetryConfig retryConfig; + final HTTPClient client; + final Headers _headers; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("5XX"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(200, TimeUnit.MILLISECONDS) + .maxInterval(200, TimeUnit.MILLISECONDS) + .baseFactor((double) (1)) + .maxElapsedTime(1000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_three_ds_configurations", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_three_ds_configurations", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_three_ds_configurations", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/merchant-accounts/{merchant_account_id}/three-ds-configurations", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + super( + sdkConfiguration, options, + _headers); + } + + private HttpRequest onBuildRequest(ListThreeDsConfigurationsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ListThreeDsConfigurationsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(ListThreeDsConfigurationsRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + return onError(httpRes, null); + } + return httpRes; + } catch (Exception e) { + return onError(null, e); + } + }) + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .build(); + return unchecked(() -> onSuccess(retries.run())).get(); + } + + + @Override + public ListThreeDsConfigurationsResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListThreeDsConfigurationsResponse.Builder resBuilder = + ListThreeDsConfigurationsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListThreeDsConfigurationsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withMerchantAccountThreeDSConfigurations(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + private final ScheduledExecutorService retryScheduler; + + public Async( + SDKConfiguration sdkConfiguration, Optional options, + ScheduledExecutorService retryScheduler, Headers _headers) { + super( + sdkConfiguration, options, + _headers); + this.retryScheduler = retryScheduler; + } + + private CompletableFuture onBuildRequest(ListThreeDsConfigurationsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ListThreeDsConfigurationsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(ListThreeDsConfigurationsRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity())) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.ListThreeDsConfigurationsResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.ListThreeDsConfigurationsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.ListThreeDsConfigurationsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withMerchantAccountThreeDSConfigurations); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +}