diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c89c4486..ceeb2b61 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,10 +19,11 @@ jobs: strategy: matrix: python: - - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" + - "3.14" permissions: contents: write diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b329e9fa..0f6e5410 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,24 +1,24 @@ lockVersion: 2.0.0 id: 833c6a67-4a4a-4ef1-ba24-165a29264e4a management: - docChecksum: 5a02cc3b209ade5cc09d56e6c34c76ed + docChecksum: 5d11683dc561ef88372ecf4ea4f43681 docVersion: 1.0.0 - speakeasyVersion: 1.700.2 - generationVersion: 2.801.2 - releaseVersion: 1.10.21 - configChecksum: 9f893066e001cdf30742bb0360312320 + speakeasyVersion: 1.703.0 + generationVersion: 2.803.3 + releaseVersion: 2.0.0 + configChecksum: 13351656d4f134a1c8efe1e6ff73eab9 repoURL: https://github.com/gr4vy/gr4vy-python.git installationURL: https://github.com/gr4vy/gr4vy-python.git published: true persistentEdits: - generation_id: 18b71f9c-8043-48f4-969a-684736df3410 - pristine_commit_hash: 84961c71832855d259e50cf4593750cbcdb093f9 - pristine_tree_hash: 761fe773db4e6d0440ca4f00719bc78d3755e2ab + generation_id: 389dcbbb-780b-4727-9618-f395cecc70e1 + pristine_commit_hash: 40345a022c3778cd8545b0d5d9559bc31a0df6a7 + pristine_tree_hash: 62d22c885880f04fe5032a5555687113a3fa547c features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.23.18 + core: 6.0.1 defaultEnabledRetries: 0.2.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 @@ -36,7 +36,7 @@ features: nullables: 1.0.2 openEnums: 1.0.3 pagination: 3.0.7 - responseFormat: 1.0.1 + responseFormat: 1.1.0 retries: 3.0.3 sdkHooks: 1.2.1 serverIDs: 3.0.0 @@ -304,8 +304,8 @@ trackedFiles: pristine_git_object: 2c01b9aa7304aaabd38155446cec15a18c739f68 docs/models/capturetransactionrequest.md: id: 664f2cf318c0 - last_write_checksum: sha1:fb06f0fa192612340ef9ee3f9adecb948a120394 - pristine_git_object: 83eb73c8156b2b6e10fe2429d705a6fb2256221e + last_write_checksum: sha1:712998e7e1907b1caa35ebfc313bc6ec46868384 + pristine_git_object: f4b7112a5fdd82a71a0a87bc27bd9bc5755afbcb docs/models/cardpaymentmethodcreate.md: id: 87e2f599f9a5 last_write_checksum: sha1:1c7580a9a5da4a1e942584f88cb876b6170b4f4d @@ -522,6 +522,10 @@ trackedFiles: id: c0562d6fdba0 last_write_checksum: sha1:f65b0f8cd6a8a5c1badddb5724ed4b346cfbe8a6 pristine_git_object: 6f3f6107dde63495b9222fbf864248ce1bfd12e3 + docs/models/createthreedsconfigurationrequest.md: + id: cf47bfa38743 + last_write_checksum: sha1:48094b3a60036dd0b40ffb0cacbb702853d4366d + pristine_git_object: 09e8a156da074f503fc2750a4fb0176f8f934d92 docs/models/createthreedsscenarioglobals.md: id: 4bfb80f5302b last_write_checksum: sha1:5f0e51cdcfca2ec540403c8ed7c9df6a14f6a854 @@ -650,6 +654,10 @@ trackedFiles: id: e1ca399ab707 last_write_checksum: sha1:65e1d0aa5077997147c234c296e859c23d72f406 pristine_git_object: 7749f9056ee4cad53ec32a80149656db0c550448 + docs/models/deletethreedsconfigurationrequest.md: + id: 2f7bfbc41a27 + last_write_checksum: sha1:1928a2a9c94af0dd123e4467256dfa1367e33b9f + pristine_git_object: d3b3e0a8d0b084913c208e5c99d4747a14bd4fb7 docs/models/deletethreedsscenarioglobals.md: id: 7dff0271721e last_write_checksum: sha1:1dbd546081d0eebc1571f0bfe9ae6aa1ebe7382d @@ -706,6 +714,10 @@ trackedFiles: id: cebcecf111be last_write_checksum: sha1:18f36bb27eabe1260557cde12862f8d40a17c0a3 pristine_git_object: 078f60bfee9b1c364636dc34e1d1ec6e664a17d4 + docs/models/editthreedsconfigurationrequest.md: + id: 5354279a0798 + last_write_checksum: sha1:877e45d9c4919004e787f7da0441568cd4ab9a0b + pristine_git_object: f33b91fb1e36e0abf664e9961bc39d30c75306be docs/models/errordetail.md: id: 8ef87dd0aeb1 last_write_checksum: sha1:ffa3f437c15ae71d3c60a8462fbae9457d017db8 @@ -840,8 +852,8 @@ trackedFiles: pristine_git_object: e806e6ba10e16a0587748bb49015d5c04b1bd702 docs/models/getmerchantaccountrequest.md: id: 3f4cf4649282 - last_write_checksum: sha1:3cfbc216ff1269ef1e8c977e49fd2c8bf6df9f0c - pristine_git_object: a59b3311fa2b783f0d49fb2eb6fa1774d13806e9 + last_write_checksum: sha1:2789cfef4fcd6ec11bfd8b6166b7a773a8bbf887 + pristine_git_object: de24c86998d229d97c8007b2fed28240f8112b4b docs/models/getpaymentlinkglobals.md: id: c71b0b7428ac last_write_checksum: sha1:ce55c681dd41902669f7661a43294984729aeac7 @@ -1266,6 +1278,10 @@ trackedFiles: id: 8c84b32f7e4a last_write_checksum: sha1:28907a6e71e0d3f6bb8b1c0dc12c5fcc2bb0036a pristine_git_object: f5c8ceb6cda906b8f24dcd11986527c0e868a11a + docs/models/listthreedsconfigurationsrequest.md: + id: f39090671a4a + last_write_checksum: sha1:60574191b63d4220c85e252f4fec005e361ff75f + pristine_git_object: bd03877550c0542c5bd0a7202eb4d32acc12e830 docs/models/listtransactionactionsglobals.md: id: 5ca55a449898 last_write_checksum: sha1:5d26cd8c1364806e7e8f2e40615d96fad48fe2b2 @@ -1334,6 +1350,22 @@ trackedFiles: id: 2b8c0cb06a58 last_write_checksum: sha1:efa315d8d287df3315adabe99c61b0370675e1c2 pristine_git_object: 6b1087e840f2fe77db805fef5a2afba604bd0e02 + docs/models/merchantaccountthreedsconfiguration.md: + id: 8b7af4499332 + last_write_checksum: sha1:f2b132fc52a2d92a48c2fb09c4334f93f50483a1 + pristine_git_object: 774bf34d292eb3fa2530e52a561dba554fb06cb3 + docs/models/merchantaccountthreedsconfigurationcreate.md: + id: 3fbc5d3ca360 + last_write_checksum: sha1:458701fd1e72f70062d3db3fd00898f223fffdab + pristine_git_object: daf9eec2ee743de1fbd26262552eb525b445061e + docs/models/merchantaccountthreedsconfigurations.md: + id: 87d5ea2627cb + last_write_checksum: sha1:afd9946eb8be36693860689b5faf7f8a43ee7e06 + pristine_git_object: 1d469a443f8a614bf3f355f0eb2fc6d34540e4ae + docs/models/merchantaccountthreedsconfigurationupdate.md: + id: 16d659f63040 + last_write_checksum: sha1:bc7dde7302ed175d40e1baf7a4f318338f38b8f4 + pristine_git_object: 4f28755103328aee270383df9932b8bf41d73484 docs/models/merchantaccountupdate.md: id: ccd76c07dc8b last_write_checksum: sha1:11e06ed32edc38efd1ce4753d3c45e54fa29ae5c @@ -1714,14 +1746,14 @@ trackedFiles: id: 77014f6aa487 last_write_checksum: sha1:83a664e74b7f9dbd6d223a22f61cdcc07e0f629f pristine_git_object: 99031b7ff8f2fbb2801f3274b4ec3277fada5df0 + docs/models/response200capturetransaction.md: + id: ab3ab5ea5148 + last_write_checksum: sha1:1da54e86401ded1ab4e8cb5426c581d91b721a43 + pristine_git_object: 72923e65515ead8c67c87f928000d25c74bd2c5a docs/models/response200voidtransaction.md: id: 2dfa9c780768 last_write_checksum: sha1:09b1917ececb32330fe6cf45e2fedb7715a173ed pristine_git_object: 0d0d1729a75a3f3d7a05d328ad985b48bdb07d0c - docs/models/responsecapturetransaction.md: - id: 8807a6792409 - last_write_checksum: sha1:0e1b7d0e660b38202183d4ef99829cd14cbd89c6 - pristine_git_object: 1b288b93f6f4eee58d84e3230b226eb0b3935699 docs/models/responsedata.md: id: e0a6143f9ed8 last_write_checksum: sha1:d209a1481225b0e71933e72104e50cae1508ff14 @@ -2060,8 +2092,8 @@ trackedFiles: pristine_git_object: e6f6d38537cb4d024e5778a50a5fc3fc013cc028 docs/models/updatemerchantaccountrequest.md: id: 26229513ee40 - last_write_checksum: sha1:deef3513dadfb61d16a1cc8b256b5d4cc57c05a1 - pristine_git_object: b9c674650fca346a610b4f83510888e1d0d0f7bf + last_write_checksum: sha1:cb8bdda85929fa91e5a237d6101d1369e6d04200 + pristine_git_object: f718501f7bd20400aeadeaeb46354a2ad72eca77 docs/models/updatepaymentserviceglobals.md: id: bcb679bc7f46 last_write_checksum: sha1:0c6814a9c55abd65944dcc7328105a99c798e362 @@ -2228,8 +2260,8 @@ trackedFiles: pristine_git_object: 1b2ca14485f19909d286ffa638d6fcdd333223ed docs/sdks/merchantaccountssdk/README.md: id: 39108cecfab1 - last_write_checksum: sha1:b5f8234b91e1cebb1f947b11e38435d31057204d - pristine_git_object: 6d46d5105ae380438a2ad2a61cba7a932ee94c5f + last_write_checksum: sha1:8aa01910d40dd76ff6ee257fa4a72f1e6c3e298f + pristine_git_object: 9749df94530cd44f2fa5e1bc63fec27a759442ae docs/sdks/networktokenscryptogram/README.md: id: 7aef02dc3c54 last_write_checksum: sha1:3ac01232944c881072602290f8de7132617e85fc @@ -2282,14 +2314,18 @@ trackedFiles: id: 57ad62844f79 last_write_checksum: sha1:362894b9f8c3e1e12abb43e7442703693d925db1 pristine_git_object: a3f212b22be155a47de24e7e217168022f33403f + docs/sdks/threedsconfiguration/README.md: + id: 86aa349ed0d5 + last_write_checksum: sha1:d8ab26174170923418d1c012eb7cf6c943e2a486 + pristine_git_object: 2c30913680940bec79371dc01dafdb6e62bdcac2 docs/sdks/threedsscenarios/README.md: id: 81ff4c3f8215 last_write_checksum: sha1:e7a911d50a015cfd120fd3e6863fbbf0bfe50cbb pristine_git_object: 1c164f363de02939f9ce80cf4dc53933c585e5b2 docs/sdks/transactions/README.md: id: 85592abe3c6b - last_write_checksum: sha1:29eb450e2f00a9221a6471ebd26dee8273106033 - pristine_git_object: 19aaa453f7c21969bf810e95064bedfe7b4e3fed + last_write_checksum: sha1:52bd9e446c5a80041ca37e0e0b3529182c257768 + pristine_git_object: 6273873ba6935b3c22b0b4db227c2c5adfc8fe70 docs/sdks/transactionsrefunds/README.md: id: c6a0400f5020 last_write_checksum: sha1:9f066fc497802c0814246b158c659f494f74b520 @@ -2308,12 +2344,12 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pylintrc: id: 7ce8b9f946e6 - last_write_checksum: sha1:db2aebd83e553dd59d3965e79104a3fb780c403a - pristine_git_object: e8cd3e85682cd3d489cf3c5be75a0563d0c9f4bf + last_write_checksum: sha1:0e10638ea7d22a917f716f609a4c05ca0cd18e91 + pristine_git_object: ba6a998b82e6e5fce3f37f2c3a73b345395d952c pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:1cde98ea9fbf1ea8a85b546ac0850321c5297255 - pristine_git_object: 50d86b33fe1bd06760b69cde5bc17c8902257748 + last_write_checksum: sha1:29ce9bd36859b995cc01b43a311c5e3ebf87410c + pristine_git_object: 4e508ceba337305809d90bc7303bcfcca7e00a44 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:63a92abbd1de3323613f0d4c1ae4412076577710 @@ -2340,8 +2376,8 @@ trackedFiles: pristine_git_object: 83a0d00f9b5b1a6d837643a32bfd0f82cd4f98ce src/gr4vy/_version.py: id: 1b5ad1da47aa - last_write_checksum: sha1:1373af1d92e5f10945e2155ac521edadac2f4e65 - pristine_git_object: 82b2671e8f44bb99089096b6dac839e65341a8ad + last_write_checksum: sha1:1f0e0d320f316d10b2634a66bfa08714f4e2e127 + pristine_git_object: bf64007c188ee234918362fb93f3d63eb2773985 src/gr4vy/account_updater.py: id: 6dc8f39e2fb9 last_write_checksum: sha1:fabc79a59dd06fb927ce2d834fbafbcad5836a4b @@ -2488,12 +2524,12 @@ trackedFiles: pristine_git_object: ac8cd5d23a7477e7f626f8fc348f5b4e11ab25c5 src/gr4vy/merchant_accounts_sdk.py: id: 6649e2875667 - last_write_checksum: sha1:25291a4844417704da6c19b242891bcf5eaaacdb - pristine_git_object: 2d392799bbe0b66682b15c14348917eccbcd684e + last_write_checksum: sha1:3f94b3abf79858de06f9d42e3874fabbe628e197 + pristine_git_object: a9cb8aa8d8d4d7471403f39651bb0c4ca7b81cb4 src/gr4vy/models/__init__.py: id: 427cc7fddfe2 - last_write_checksum: sha1:fa078159ace73d3248541727dd6b0a3b6d6ca0c5 - pristine_git_object: 066ffecd489f6baae1a8af71f863eeba429376f1 + last_write_checksum: sha1:1cfe7a260317747070955a7d165c6b4722dcaef5 + pristine_git_object: 13bab9d7a0315e02543e8de0e300eeb81c74619f src/gr4vy/models/accountsreceivablesreportspec.py: id: cc6a9368f988 last_write_checksum: sha1:dcf155a79da77b3ca554d2cf60138dd4fbae33bd @@ -2660,8 +2696,8 @@ trackedFiles: pristine_git_object: 9c07ce68fa1a96fad83539592f950f68dfb19c5e src/gr4vy/models/capture_transactionop.py: id: 2b1662028651 - last_write_checksum: sha1:897e80dc8aa3ac84f5cebd7acf7d610524d1b681 - pristine_git_object: 4ee824a881355d4c6e2f5edd5ba3546928ef561d + last_write_checksum: sha1:2c85e4d48274d6c62de296454369d2f03f987b9a + pristine_git_object: a0c13b31cbf5ad6f5fda375fb7cde33ed1bd8869 src/gr4vy/models/capturestatus.py: id: e67d540a3637 last_write_checksum: sha1:7a7466a8398b7b2742d75479f3d2afcb099bfa77 @@ -2806,6 +2842,10 @@ trackedFiles: id: e7252aef8bbc last_write_checksum: sha1:341757dff5b1fd888aa72df94e947dfe859bb7b7 pristine_git_object: cc64fe8e845d24c3ba58b7f48008d5e3e98c007a + src/gr4vy/models/create_three_ds_configurationop.py: + id: d44a94ed05c1 + last_write_checksum: sha1:9f8feb4e096bc559abe8ea9394ba8d0068a5e93f + pristine_git_object: 74a96d33b6956e7f3351a99901f79a32d4361a9b src/gr4vy/models/create_three_ds_scenarioop.py: id: bfeb1cbc0784 last_write_checksum: sha1:1f39032f0877aafaab9967cf33a3c33dfb25c5b1 @@ -2894,6 +2934,10 @@ trackedFiles: id: 8b438d670f6c last_write_checksum: sha1:d7ca788ed860a461be1411600a91b4211f078e79 pristine_git_object: f68f7c9618be8f7bbdf6f99b2e68b3fe265492bf + src/gr4vy/models/delete_three_ds_configurationop.py: + id: b0e2ce26c08b + last_write_checksum: sha1:d1e6e7e169e0ecf77d0bf257f1aed337188265da + pristine_git_object: ad1a1a5dea57f2d3b9486594659d489edadf759e src/gr4vy/models/delete_three_ds_scenarioop.py: id: 9d36ef9e6969 last_write_checksum: sha1:027c50d26eb5c76282e40eaa0b9ca198b3b8f34d @@ -2946,6 +2990,10 @@ trackedFiles: id: 485448c851d9 last_write_checksum: sha1:bd7182ba38cf514e8fad00f4828eee9cf342b564 pristine_git_object: c7c1698740bd61e0362a3ca4a8e443704de5ea5c + src/gr4vy/models/edit_three_ds_configurationop.py: + id: d68d85ae8240 + last_write_checksum: sha1:4aaecff01fba94e55359e8e6aad516e185562ae2 + pristine_git_object: f8bdb444411fad812becd98e69a414307e44b75d src/gr4vy/models/errordetail.py: id: 288e2721a37a last_write_checksum: sha1:9dc90822953e2cc52dc4f5d21fbd18a2be4850cf @@ -3044,8 +3092,8 @@ trackedFiles: pristine_git_object: 50c1b6e60448d3a16cbfd3cf2a0d9c83f59221e5 src/gr4vy/models/get_merchant_accountop.py: id: 7a9daa346d0d - last_write_checksum: sha1:a51c6871bb6ec83eaf219e9f54af54f346617e38 - pristine_git_object: e9000f6d09b139ae4940ba95f8ef53a595f296de + last_write_checksum: sha1:ae49f3ba71988821e0143db363f18a98475dce3a + pristine_git_object: e947059a773715d315e7ce94b0ff3e4f1dc7da46 src/gr4vy/models/get_payment_linkop.py: id: "750521910e18" last_write_checksum: sha1:b8c3e1906ccfd607c599d5711454ff251b915fb0 @@ -3294,6 +3342,10 @@ trackedFiles: id: e04af97d8861 last_write_checksum: sha1:17c6eb1aab0b382eb6f0e80c23efbe261d482055 pristine_git_object: 0c880c2858427f86b945e4850aa317cd65ac46c4 + src/gr4vy/models/list_three_ds_configurationsop.py: + id: 8b8a0f0df5c1 + last_write_checksum: sha1:b51912356972c5747e341ddb0dfc46662d55fd0e + pristine_git_object: 5a06b5ea5cf408c75b07219ae6b8ffcc926d81b6 src/gr4vy/models/list_transaction_actionsop.py: id: 30dd9c4d0912 last_write_checksum: sha1:754979fdc1e7ceb74484672e96024955d3041f59 @@ -3330,6 +3382,22 @@ trackedFiles: id: 54ec47424955 last_write_checksum: sha1:c850d0e6c81d46d1743034cbdb868b32567a98f3 pristine_git_object: acc21aaa4b4adde13b69a6b9746478ade2105bda + src/gr4vy/models/merchantaccountthreedsconfiguration.py: + id: 80000774859e + last_write_checksum: sha1:75e3dcabd28ab2ea532721f5d8bcdbe633e30992 + pristine_git_object: 8d1dd25e6728df4bb1fff29153a4b1d5dff013e8 + src/gr4vy/models/merchantaccountthreedsconfigurationcreate.py: + id: 040489834ed8 + last_write_checksum: sha1:b58e27da51061e1560c0ac3b41e1bdf29858cca6 + pristine_git_object: ac3b4a236c7bf67db71d343e989c369008051bb9 + src/gr4vy/models/merchantaccountthreedsconfigurations.py: + id: c304c5f85045 + last_write_checksum: sha1:fd2f878e96f594c3ffe124a6b1417703d15dfce7 + pristine_git_object: 2e4f669a66aa31bc388d0bb3f1960a1e0633302b + src/gr4vy/models/merchantaccountthreedsconfigurationupdate.py: + id: c92d3cc1d642 + last_write_checksum: sha1:eeada153a76d23178918c1541476017405ac6406 + pristine_git_object: 7b540bb9f17e84ee74169243ec165e7ff01b150c src/gr4vy/models/merchantaccountupdate.py: id: 54746d93e043 last_write_checksum: sha1:7694251b999c7b5e6571bce5e7937a0eb96821ba @@ -3940,8 +4008,8 @@ trackedFiles: pristine_git_object: dfa31467acc905171e081641cf6e434e89271b40 src/gr4vy/models/update_merchant_accountop.py: id: a5c141ca5ee7 - last_write_checksum: sha1:e3257b4ebaa77c1aa2d02609fe6328cc37d1ce97 - pristine_git_object: 37ccccaf84c276c9cad1acec7484e7b1de110c6c + last_write_checksum: sha1:b021739bc526885851805e8ef9d2997244de4d0b + pristine_git_object: cc301186e03f8e2035069315f0e488814ea60ae8 src/gr4vy/models/update_payment_serviceop.py: id: 29c1e70fd707 last_write_checksum: sha1:91731b7a54e78ae635ee7e7d07b14e0f95612efb @@ -4070,14 +4138,18 @@ trackedFiles: id: c10d3c9c5eec last_write_checksum: sha1:2c5ea10e7e7541795c2186f7186f160a3819d5f4 pristine_git_object: 5449feb9e2541c9537efc7337e7fab9530b09901 + src/gr4vy/three_ds_configuration.py: + id: 408758b2e6fd + last_write_checksum: sha1:5ba51167164c4db9e8c6ce3b43a5d739dba659a8 + pristine_git_object: 1aef781cb71fb47181f673dfd60a6b63926c641c src/gr4vy/three_ds_scenarios.py: id: 3007c831a97f last_write_checksum: sha1:f1178818394877202aac89e7296bb8c787de1f9a pristine_git_object: 0fdc029c1b56125e39db86d75bc3dcc7ecffdeef src/gr4vy/transactions.py: id: 88da8fa0ed7f - last_write_checksum: sha1:d5cb5f20f6406a7e907fc355c4979ee96916d687 - pristine_git_object: e07d70fa9453a7f45e126638d0934cb20abda9ed + last_write_checksum: sha1:08e6e58b7b283f1f5c49035609d70e7680069566 + pristine_git_object: e199d92b98b9acd3b9e01cd4b71a07ef6a919dc9 src/gr4vy/transactions_refunds.py: id: ee2cc8522919 last_write_checksum: sha1:2e652c610c1c919026d04c9485fc63dfe29e5887 @@ -4096,8 +4168,8 @@ trackedFiles: pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee src/gr4vy/utils/__init__.py: id: e52060886bd2 - last_write_checksum: sha1:ffaf69e6877a274b08066215f5a31a1b344f5402 - pristine_git_object: f4525b2057c3d54fb3b9eff6248fd172478ce94c + last_write_checksum: sha1:141be7a6debce43d0acfb482e4b3dab85a894c4a + pristine_git_object: 23ac44834d842f128e6b5625ebc19d2b79f87cea src/gr4vy/utils/annotations.py: id: 4e6f3048ab03 last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc @@ -7755,11 +7827,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: | ## Python SDK Changes: - * `gr4vy.transactions.void()`: `request.idempotency_key` **Added** + * `gr4vy.merchant_accounts.three_ds_configuration.create()`: **Added** + * `gr4vy.merchant_accounts.three_ds_configuration.list()`: **Added** + * `gr4vy.merchant_accounts.three_ds_configuration.update()`: **Added** + * `gr4vy.merchant_accounts.three_ds_configuration.delete()`: **Added** + * `gr4vy.transactions.capture()`: `request.idempotency_key` **Added** generatedFiles: - .gitattributes - .vscode/settings.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 62f30b80..b09334c7 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -21,13 +21,14 @@ generation: schemas: allOfMergeStrategy: shallowMerge requestBodyFieldName: "" + versioningStrategy: automatic persistentEdits: {} tests: generateTests: true generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.10.21 + version: 2.0.0 additionalDependencies: dev: freezegun: ^1.5.1 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f25b68a2..82c0a678 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.700.2 +speakeasyVersion: 1.703.0 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:09735c7344bbfe2c88071de3fd0c322db9e39150172f22cd635e4ca1e1ba79c3 - sourceBlobDigest: sha256:ce670cf308aed9548eac9c9cc345f7771875fd97b1de8b95e8ed28314767d00c + sourceRevisionDigest: sha256:1ba900c18259e5144fc1b4120948569166301a24c175d97bba17cd2d2b5a42c4 + sourceBlobDigest: sha256:75fafb86259b7513599a49bbc17f3a3f9103b8795b9c145afa46eb839dcb555e tags: - latest - - speakeasy-sdk-regen-1770143813 + - speakeasy-sdk-regen-1770229775 - 1.0.0 targets: python: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:09735c7344bbfe2c88071de3fd0c322db9e39150172f22cd635e4ca1e1ba79c3 - sourceBlobDigest: sha256:ce670cf308aed9548eac9c9cc345f7771875fd97b1de8b95e8ed28314767d00c + sourceRevisionDigest: sha256:1ba900c18259e5144fc1b4120948569166301a24c175d97bba17cd2d2b5a42c4 + sourceBlobDigest: sha256:75fafb86259b7513599a49bbc17f3a3f9103b8795b9c145afa46eb839dcb555e codeSamplesNamespace: openapi-python-code-samples - codeSamplesRevisionDigest: sha256:1976b43d4f3faf56c9f163e751fec235ae14a5144da22fae555b14b787a908f4 + codeSamplesRevisionDigest: sha256:a776c36cb4f3ddc729f1988396fba44ad3c3da77e436a54af6c7f81cf08121fd workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index cdf7ee37..760fb7ce 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ It's also possible to write a standalone Python script without needing to set up ```python #!/usr/bin/env -S uv run --script # /// script -# requires-python = ">=3.9" +# requires-python = ">=3.10" # dependencies = [ # "gr4vy", # ] @@ -378,6 +378,13 @@ except ValueError as error: * [get](docs/sdks/merchantaccountssdk/README.md#get) - Get a merchant account * [update](docs/sdks/merchantaccountssdk/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/paymentlinkssdk/README.md) * [create](docs/sdks/paymentlinkssdk/README.md#create) - Add a payment link diff --git a/RELEASES.md b/RELEASES.md index 36ccc9f8..6748cbbd 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1428,4 +1428,14 @@ Based on: ### Generated - [python v1.10.21] . ### Releases -- [PyPI v1.10.21] https://pypi.org/project/gr4vy/1.10.21 - . \ No newline at end of file +- [PyPI v1.10.21] https://pypi.org/project/gr4vy/1.10.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 +- [python v2.0.0] . +### Releases +- [PyPI v2.0.0] https://pypi.org/project/gr4vy/2.0.0 - . \ No newline at end of file diff --git a/docs/models/capturetransactionrequest.md b/docs/models/capturetransactionrequest.md index 83eb73c8..f4b7112a 100644 --- a/docs/models/capturetransactionrequest.md +++ b/docs/models/capturetransactionrequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `transaction_id` | *str* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | -| `prefer` | List[*str*] | :heavy_minus_sign: | The preferred resource type in the response. | | -| `merchant_account_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | default | -| `transaction_capture_create` | [models.TransactionCaptureCreate](../models/transactioncapturecreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `transaction_id` | *str* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | +| `prefer` | List[*str*] | :heavy_minus_sign: | The preferred resource type in the response. | | +| `merchant_account_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | default | +| `idempotency_key` | *OptionalNullable[str]* | :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 | +| `transaction_capture_create` | [models.TransactionCaptureCreate](../models/transactioncapturecreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/createthreedsconfigurationrequest.md b/docs/models/createthreedsconfigurationrequest.md new file mode 100644 index 00000000..09e8a156 --- /dev/null +++ b/docs/models/createthreedsconfigurationrequest.md @@ -0,0 +1,9 @@ +# CreateThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `merchant_account_three_ds_configuration_create` | [models.MerchantAccountThreeDSConfigurationCreate](../models/merchantaccountthreedsconfigurationcreate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/deletethreedsconfigurationrequest.md b/docs/models/deletethreedsconfigurationrequest.md new file mode 100644 index 00000000..d3b3e0a8 --- /dev/null +++ b/docs/models/deletethreedsconfigurationrequest.md @@ -0,0 +1,9 @@ +# DeleteThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `three_ds_configuration_id` | *str* | :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/editthreedsconfigurationrequest.md b/docs/models/editthreedsconfigurationrequest.md new file mode 100644 index 00000000..f33b91fb --- /dev/null +++ b/docs/models/editthreedsconfigurationrequest.md @@ -0,0 +1,10 @@ +# EditThreeDsConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `three_ds_configuration_id` | *str* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | +| `merchant_account_three_ds_configuration_update` | [models.MerchantAccountThreeDSConfigurationUpdate](../models/merchantaccountthreedsconfigurationupdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/getmerchantaccountrequest.md b/docs/models/getmerchantaccountrequest.md index a59b3311..de24c869 100644 --- a/docs/models/getmerchantaccountrequest.md +++ b/docs/models/getmerchantaccountrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | \ No newline at end of file diff --git a/docs/models/listthreedsconfigurationsrequest.md b/docs/models/listthreedsconfigurationsrequest.md new file mode 100644 index 00000000..bd038775 --- /dev/null +++ b/docs/models/listthreedsconfigurationsrequest.md @@ -0,0 +1,9 @@ +# ListThreeDsConfigurationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `currency` | *OptionalNullable[str]* | :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/merchantaccountthreedsconfiguration.md b/docs/models/merchantaccountthreedsconfiguration.md new file mode 100644 index 00000000..774bf34d --- /dev/null +++ b/docs/models/merchantaccountthreedsconfiguration.md @@ -0,0 +1,21 @@ +# MerchantAccountThreeDSConfiguration + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `merchant_acquirer_bin` | *str* | :heavy_check_mark: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchant_acquirer_id` | *str* | :heavy_check_mark: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchant_name` | *str* | :heavy_check_mark: | N/A | Acme Inc. | +| `merchant_country_code` | *str* | :heavy_check_mark: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchant_category_code` | *str* | :heavy_check_mark: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchant_url` | *str* | :heavy_check_mark: | URL to send when calling 3DS through this scheme. | https://example.com | +| `type` | *Optional[Literal["merchant-account.three-ds-configuration"]]* | :heavy_minus_sign: | Always `merchant-account.three-ds-configuration`. | merchant-account.three-ds-configuration | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the 3DS configuration | | +| `merchant_account_id` | *str* | :heavy_check_mark: | ID of the associated merchant account | | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :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 | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :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` | [models.CardScheme](../models/cardscheme.md) | :heavy_check_mark: | N/A | visa | +| `currency` | *Nullable[str]* | :heavy_check_mark: | ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. | USD | +| `metadata` | Dict[str, *str*] | :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/merchantaccountthreedsconfigurationcreate.md b/docs/models/merchantaccountthreedsconfigurationcreate.md new file mode 100644 index 00000000..daf9eec2 --- /dev/null +++ b/docs/models/merchantaccountthreedsconfigurationcreate.md @@ -0,0 +1,16 @@ +# MerchantAccountThreeDSConfigurationCreate + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchant_acquirer_bin` | *str* | :heavy_check_mark: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchant_acquirer_id` | *str* | :heavy_check_mark: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchant_name` | *str* | :heavy_check_mark: | N/A | Acme Inc. | +| `merchant_country_code` | *str* | :heavy_check_mark: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchant_category_code` | *str* | :heavy_check_mark: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchant_url` | *str* | :heavy_check_mark: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [models.CardScheme](../models/cardscheme.md) | :heavy_check_mark: | N/A | visa | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `metadata` | Dict[str, *str*] | :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/merchantaccountthreedsconfigurations.md b/docs/models/merchantaccountthreedsconfigurations.md new file mode 100644 index 00000000..1d469a44 --- /dev/null +++ b/docs/models/merchantaccountthreedsconfigurations.md @@ -0,0 +1,8 @@ +# MerchantAccountThreeDSConfigurations + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `items` | List[[models.MerchantAccountThreeDSConfiguration](../models/merchantaccountthreedsconfiguration.md)] | :heavy_check_mark: | A list of items returned for this request. | \ No newline at end of file diff --git a/docs/models/merchantaccountthreedsconfigurationupdate.md b/docs/models/merchantaccountthreedsconfigurationupdate.md new file mode 100644 index 00000000..4f287551 --- /dev/null +++ b/docs/models/merchantaccountthreedsconfigurationupdate.md @@ -0,0 +1,16 @@ +# MerchantAccountThreeDSConfigurationUpdate + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchant_acquirer_bin` | *OptionalNullable[str]* | :heavy_minus_sign: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchant_acquirer_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchant_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Acme Inc. | +| `merchant_country_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchant_category_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchant_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [OptionalNullable[models.CardScheme]](../models/cardscheme.md) | :heavy_minus_sign: | The card scheme for this 3DS configuration | visa | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `metadata` | Dict[str, *str*] | :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/responsecapturetransaction.md b/docs/models/response200capturetransaction.md similarity index 87% rename from docs/models/responsecapturetransaction.md rename to docs/models/response200capturetransaction.md index 1b288b93..72923e65 100644 --- a/docs/models/responsecapturetransaction.md +++ b/docs/models/response200capturetransaction.md @@ -1,4 +1,4 @@ -# ResponseCaptureTransaction +# Response200CaptureTransaction Successful Response diff --git a/docs/models/updatemerchantaccountrequest.md b/docs/models/updatemerchantaccountrequest.md index b9c67465..f718501f 100644 --- a/docs/models/updatemerchantaccountrequest.md +++ b/docs/models/updatemerchantaccountrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | | `merchant_account_update` | [models.MerchantAccountUpdate](../models/merchantaccountupdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdks/merchantaccountssdk/README.md b/docs/sdks/merchantaccountssdk/README.md index 6d46d510..9749df94 100644 --- a/docs/sdks/merchantaccountssdk/README.md +++ b/docs/sdks/merchantaccountssdk/README.md @@ -162,7 +162,7 @@ with Gr4vy( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -214,7 +214,7 @@ with Gr4vy( | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account | merchant-12345 | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | | `account_updater_enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the Real-Time Account Updater service is enabled for this merchant account. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `false`, the Account Updater service doesn't get called if a payment fails with expired or invalid card details. If the field is set to `true`, the service is called. Please note that for this to work the other `account_updater_* fields` must be set as well. | true | | `account_updater_request_encryption_key` | *OptionalNullable[str]* | :heavy_minus_sign: | The public key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. | key-1234 | | `account_updater_request_encryption_key_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. | key-id-1234 | diff --git a/docs/sdks/threedsconfiguration/README.md b/docs/sdks/threedsconfiguration/README.md new file mode 100644 index 00000000..2c309136 --- /dev/null +++ b/docs/sdks/threedsconfiguration/README.md @@ -0,0 +1,238 @@ +# 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 + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.merchant_accounts.three_ds_configuration.create(merchant_account_id="merchant-12345", 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": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `merchant_acquirer_bin` | *str* | :heavy_check_mark: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchant_acquirer_id` | *str* | :heavy_check_mark: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchant_name` | *str* | :heavy_check_mark: | N/A | Acme Inc. | +| `merchant_country_code` | *str* | :heavy_check_mark: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchant_category_code` | *str* | :heavy_check_mark: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchant_url` | *str* | :heavy_check_mark: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [models.CardScheme](../../models/cardscheme.md) | :heavy_check_mark: | N/A | visa | +| `metadata` | Dict[str, *str*] | :heavy_check_mark: | Any additional information about the 3DS configuration that you would like to store as key-value pairs. | | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.MerchantAccountThreeDSConfiguration](../../models/merchantaccountthreedsconfiguration.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.Error400 | 400 | application/json | +| errors.Error401 | 401 | application/json | +| errors.Error403 | 403 | application/json | +| errors.Error404 | 404 | application/json | +| errors.Error405 | 405 | application/json | +| errors.Error409 | 409 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.Error425 | 425 | application/json | +| errors.Error429 | 429 | application/json | +| errors.Error500 | 500 | application/json | +| errors.Error502 | 502 | application/json | +| errors.Error504 | 504 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## list + +List all 3DS configurations for a merchant account. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.merchant_accounts.three_ds_configuration.list(merchant_account_id="merchant-12345") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 4217 currency code (3 characters) to filter 3DS configurations. | USD | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.MerchantAccountThreeDSConfigurations](../../models/merchantaccountthreedsconfigurations.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.Error400 | 400 | application/json | +| errors.Error401 | 401 | application/json | +| errors.Error403 | 403 | application/json | +| errors.Error404 | 404 | application/json | +| errors.Error405 | 405 | application/json | +| errors.Error409 | 409 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.Error425 | 425 | application/json | +| errors.Error429 | 429 | application/json | +| errors.Error500 | 500 | application/json | +| errors.Error502 | 502 | application/json | +| errors.Error504 | 504 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## update + +Update the 3DS configuration for a merchant account. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.merchant_accounts.three_ds_configuration.update(merchant_account_id="merchant-12345", three_ds_configuration_id="1808f5e6-b49c-4db9-94fa-22371ea352f5") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `three_ds_configuration_id` | *str* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | +| `merchant_acquirer_bin` | *OptionalNullable[str]* | :heavy_minus_sign: | Acquirer BIN to use when calling 3DS through this scheme. | 516327 | +| `merchant_acquirer_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Merchant ID to use when calling 3DS through this scheme. | 123456789012345 | +| `merchant_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Acme Inc. | +| `merchant_country_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The merchant's ISO 3166-1 numeric country code. | 840 | +| `merchant_category_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Merchant category code to use when calling 3DS through this scheme. | 1234 | +| `merchant_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL to send when calling 3DS through this scheme. | https://example.com | +| `scheme` | [OptionalNullable[models.CardScheme]](../../models/cardscheme.md) | :heavy_minus_sign: | The card scheme for this 3DS configuration | visa | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. | USD | +| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Any additional information about the 3DS configuration that you would like to store as key-value pairs. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.MerchantAccountThreeDSConfiguration](../../models/merchantaccountthreedsconfiguration.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.Error400 | 400 | application/json | +| errors.Error401 | 401 | application/json | +| errors.Error403 | 403 | application/json | +| errors.Error404 | 404 | application/json | +| errors.Error405 | 405 | application/json | +| errors.Error409 | 409 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.Error425 | 425 | application/json | +| errors.Error429 | 429 | application/json | +| errors.Error500 | 500 | application/json | +| errors.Error502 | 502 | application/json | +| errors.Error504 | 504 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete a 3DS configuration for a merchant account. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + g_client.merchant_accounts.three_ds_configuration.delete(merchant_account_id="merchant-12345", three_ds_configuration_id="1808f5e6-b49c-4db9-94fa-22371ea352f5") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `merchant_account_id` | *str* | :heavy_check_mark: | The ID of the merchant account. | merchant-12345 | +| `three_ds_configuration_id` | *str* | :heavy_check_mark: | The ID of the 3DS configuration for a merchant account. | 1808f5e6-b49c-4db9-94fa-22371ea352f5 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.Error400 | 400 | application/json | +| errors.Error401 | 401 | application/json | +| errors.Error403 | 403 | application/json | +| errors.Error404 | 404 | application/json | +| errors.Error405 | 405 | application/json | +| errors.Error409 | 409 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.Error425 | 425 | application/json | +| errors.Error429 | 429 | application/json | +| errors.Error500 | 500 | application/json | +| errors.Error502 | 502 | application/json | +| errors.Error504 | 504 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 19aaa453..6273873b 100644 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -375,18 +375,19 @@ with Gr4vy( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `transaction_id` | *str* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | -| `prefer` | List[*str*] | :heavy_minus_sign: | The preferred resource type in the response. | | -| `merchant_account_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | default | -| `amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The amount to capture, in the smallest currency unit (e.g., cents). This must be less than or equal to the authorized amount, unless over-capture is available. | 1299 | -| `airline` | [OptionalNullable[models.Airline]](../../models/airline.md) | :heavy_minus_sign: | The airline data to submit to the payment service during the capture call. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `transaction_id` | *str* | :heavy_check_mark: | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 | +| `prefer` | List[*str*] | :heavy_minus_sign: | The preferred resource type in the response. | | +| `merchant_account_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | default | +| `idempotency_key` | *OptionalNullable[str]* | :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 | +| `amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The amount to capture, in the smallest currency unit (e.g., cents). This must be less than or equal to the authorized amount, unless over-capture is available. | 1299 | +| `airline` | [OptionalNullable[models.Airline]](../../models/airline.md) | :heavy_minus_sign: | The airline data to submit to the payment service during the capture call. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[models.ResponseCaptureTransaction](../../models/responsecapturetransaction.md)** +**[models.Response200CaptureTransaction](../../models/response200capturetransaction.md)** ### Errors diff --git a/pylintrc b/pylintrc index e8cd3e85..ba6a998b 100644 --- a/pylintrc +++ b/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.9 +py-version=3.10 # Discover python modules and packages in the file system subtree. recursive=no diff --git a/pyproject.toml b/pyproject.toml index 50d86b33..4e508ceb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "gr4vy" -version = "1.10.21" +version = "2.0.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Gr4vy" },] readme = "README-PYPI.md" -requires-python = ">=3.9.2" +requires-python = ">=3.10" dependencies = [ "PyJWT (>=2.10.1,<3.0.0)", "cryptography (>=45.0.7,<46.0.0)", diff --git a/src/gr4vy/_version.py b/src/gr4vy/_version.py index 82b2671e..bf64007c 100644 --- a/src/gr4vy/_version.py +++ b/src/gr4vy/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "gr4vy" -__version__: str = "1.10.21" +__version__: str = "2.0.0" __openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.801.2" -__user_agent__: str = "speakeasy-sdk/python 1.10.21 2.801.2 1.0.0 gr4vy" +__gen_version__: str = "2.803.3" +__user_agent__: str = "speakeasy-sdk/python 2.0.0 2.803.3 1.0.0 gr4vy" try: if __package__ is not None: diff --git a/src/gr4vy/merchant_accounts_sdk.py b/src/gr4vy/merchant_accounts_sdk.py index 2d392799..a9cb8aa8 100644 --- a/src/gr4vy/merchant_accounts_sdk.py +++ b/src/gr4vy/merchant_accounts_sdk.py @@ -1,8 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration from gr4vy import errors, models, utils from gr4vy._hooks import HookContext +from gr4vy.three_ds_configuration import ThreeDsConfiguration from gr4vy.types import OptionalNullable, UNSET from gr4vy.utils import get_security_from_env from gr4vy.utils.unmarshal_json_response import unmarshal_json_response @@ -11,6 +13,20 @@ class MerchantAccountsSDK(BaseSDK): + three_ds_configuration: ThreeDsConfiguration + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.three_ds_configuration = ThreeDsConfiguration( + self.sdk_configuration, parent_ref=self.parent_ref + ) + def list( self, *, @@ -752,7 +768,7 @@ def get( Get info about a merchant account in an instance. - :param merchant_account_id: The ID of the merchant account + :param merchant_account_id: The ID of the merchant account. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -894,7 +910,7 @@ async def get_async( Get info about a merchant account in an instance. - :param merchant_account_id: The ID of the merchant account + :param merchant_account_id: The ID of the merchant account. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1054,7 +1070,7 @@ def update( Update info for a merchant account in an instance. - :param merchant_account_id: The ID of the merchant account + :param merchant_account_id: The ID of the merchant account. :param account_updater_enabled: Whether the Real-Time Account Updater service is enabled for this merchant account. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `false`, the Account Updater service doesn't get called if a payment fails with expired or invalid card details. If the field is set to `true`, the service is called. Please note that for this to work the other `account_updater_* fields` must be set as well. :param account_updater_request_encryption_key: The public key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. :param account_updater_request_encryption_key_id: The ID of the key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. @@ -1255,7 +1271,7 @@ async def update_async( Update info for a merchant account in an instance. - :param merchant_account_id: The ID of the merchant account + :param merchant_account_id: The ID of the merchant account. :param account_updater_enabled: Whether the Real-Time Account Updater service is enabled for this merchant account. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `false`, the Account Updater service doesn't get called if a payment fails with expired or invalid card details. If the field is set to `true`, the service is called. Please note that for this to work the other `account_updater_* fields` must be set as well. :param account_updater_request_encryption_key: The public key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. :param account_updater_request_encryption_key_id: The ID of the key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well. diff --git a/src/gr4vy/models/__init__.py b/src/gr4vy/models/__init__.py index 066ffecd..13bab9d7 100644 --- a/src/gr4vy/models/__init__.py +++ b/src/gr4vy/models/__init__.py @@ -105,8 +105,8 @@ CaptureTransactionGlobalsTypedDict, CaptureTransactionRequest, CaptureTransactionRequestTypedDict, - ResponseCaptureTransaction, - ResponseCaptureTransactionTypedDict, + Response200CaptureTransaction, + Response200CaptureTransactionTypedDict, ) from .capturestatus import CaptureStatus from .cardpaymentmethodcreate import ( @@ -263,6 +263,10 @@ CreateReportExecutionURLRequest, CreateReportExecutionURLRequestTypedDict, ) + from .create_three_ds_configurationop import ( + CreateThreeDsConfigurationRequest, + CreateThreeDsConfigurationRequestTypedDict, + ) from .create_three_ds_scenarioop import ( CreateThreeDsScenarioGlobals, CreateThreeDsScenarioGlobalsTypedDict, @@ -348,6 +352,10 @@ DeletePaymentServiceRequest, DeletePaymentServiceRequestTypedDict, ) + from .delete_three_ds_configurationop import ( + DeleteThreeDsConfigurationRequest, + DeleteThreeDsConfigurationRequestTypedDict, + ) from .delete_three_ds_scenarioop import ( DeleteThreeDsScenarioGlobals, DeleteThreeDsScenarioGlobalsTypedDict, @@ -376,6 +384,10 @@ DlocalUPIWalletOptionsTypedDict, ) from .dlocalwalletoptions import DlocalWalletOptions, DlocalWalletOptionsTypedDict + from .edit_three_ds_configurationop import ( + EditThreeDsConfigurationRequest, + EditThreeDsConfigurationRequestTypedDict, + ) from .errordetail import ErrorDetail, ErrorDetailTypedDict from .errorlocation import ErrorLocation from .expire_payment_linkop import ( @@ -754,6 +766,10 @@ ListReportsResponse, ListReportsResponseTypedDict, ) + from .list_three_ds_configurationsop import ( + ListThreeDsConfigurationsRequest, + ListThreeDsConfigurationsRequestTypedDict, + ) from .list_transaction_actionsop import ( ListTransactionActionsGlobals, ListTransactionActionsGlobalsTypedDict, @@ -795,6 +811,22 @@ MerchantAccountCreateTypedDict, ) from .merchantaccounts import MerchantAccounts, MerchantAccountsTypedDict + from .merchantaccountthreedsconfiguration import ( + MerchantAccountThreeDSConfiguration, + MerchantAccountThreeDSConfigurationTypedDict, + ) + from .merchantaccountthreedsconfigurationcreate import ( + MerchantAccountThreeDSConfigurationCreate, + MerchantAccountThreeDSConfigurationCreateTypedDict, + ) + from .merchantaccountthreedsconfigurations import ( + MerchantAccountThreeDSConfigurations, + MerchantAccountThreeDSConfigurationsTypedDict, + ) + from .merchantaccountthreedsconfigurationupdate import ( + MerchantAccountThreeDSConfigurationUpdate, + MerchantAccountThreeDSConfigurationUpdateTypedDict, + ) from .merchantaccountupdate import ( MerchantAccountUpdate, MerchantAccountUpdateTypedDict, @@ -1453,6 +1485,8 @@ "CreateSession", "CreateSessionStatus", "CreateSessionTypedDict", + "CreateThreeDsConfigurationRequest", + "CreateThreeDsConfigurationRequestTypedDict", "CreateThreeDsScenarioGlobals", "CreateThreeDsScenarioGlobalsTypedDict", "CreateThreeDsScenarioRequest", @@ -1514,6 +1548,8 @@ "DeletePaymentServiceGlobalsTypedDict", "DeletePaymentServiceRequest", "DeletePaymentServiceRequestTypedDict", + "DeleteThreeDsConfigurationRequest", + "DeleteThreeDsConfigurationRequestTypedDict", "DeleteThreeDsScenarioGlobals", "DeleteThreeDsScenarioGlobalsTypedDict", "DeleteThreeDsScenarioRequest", @@ -1541,6 +1577,8 @@ "DlocalUPIWalletOptionsTypedDict", "DlocalWalletOptions", "DlocalWalletOptionsTypedDict", + "EditThreeDsConfigurationRequest", + "EditThreeDsConfigurationRequestTypedDict", "ErrorDetail", "ErrorDetailTypedDict", "ErrorLocation", @@ -1808,6 +1846,8 @@ "ListReportsRequestTypedDict", "ListReportsResponse", "ListReportsResponseTypedDict", + "ListThreeDsConfigurationsRequest", + "ListThreeDsConfigurationsRequestTypedDict", "ListTransactionActionsGlobals", "ListTransactionActionsGlobalsTypedDict", "ListTransactionActionsRequest", @@ -1839,6 +1879,14 @@ "MerchantAccount", "MerchantAccountCreate", "MerchantAccountCreateTypedDict", + "MerchantAccountThreeDSConfiguration", + "MerchantAccountThreeDSConfigurationCreate", + "MerchantAccountThreeDSConfigurationCreateTypedDict", + "MerchantAccountThreeDSConfigurationTypedDict", + "MerchantAccountThreeDSConfigurationUpdate", + "MerchantAccountThreeDSConfigurationUpdateTypedDict", + "MerchantAccountThreeDSConfigurations", + "MerchantAccountThreeDSConfigurationsTypedDict", "MerchantAccountTypedDict", "MerchantAccountUpdate", "MerchantAccountUpdateTypedDict", @@ -2012,10 +2060,10 @@ "RequiredFields1TypedDict", "RequiredFields2", "RequiredFields2TypedDict", + "Response200CaptureTransaction", + "Response200CaptureTransactionTypedDict", "Response200VoidTransaction", "Response200VoidTransactionTypedDict", - "ResponseCaptureTransaction", - "ResponseCaptureTransactionTypedDict", "ResponseData", "ResponseDataTypedDict", "ResumePaymentMethodNetworkTokenGlobals", @@ -2315,8 +2363,8 @@ "CaptureTransactionGlobalsTypedDict": ".capture_transactionop", "CaptureTransactionRequest": ".capture_transactionop", "CaptureTransactionRequestTypedDict": ".capture_transactionop", - "ResponseCaptureTransaction": ".capture_transactionop", - "ResponseCaptureTransactionTypedDict": ".capture_transactionop", + "Response200CaptureTransaction": ".capture_transactionop", + "Response200CaptureTransactionTypedDict": ".capture_transactionop", "CaptureStatus": ".capturestatus", "CardPaymentMethodCreate": ".cardpaymentmethodcreate", "CardPaymentMethodCreateTypedDict": ".cardpaymentmethodcreate", @@ -2418,6 +2466,8 @@ "CreateReportExecutionURLGlobalsTypedDict": ".create_report_execution_urlop", "CreateReportExecutionURLRequest": ".create_report_execution_urlop", "CreateReportExecutionURLRequestTypedDict": ".create_report_execution_urlop", + "CreateThreeDsConfigurationRequest": ".create_three_ds_configurationop", + "CreateThreeDsConfigurationRequestTypedDict": ".create_three_ds_configurationop", "CreateThreeDsScenarioGlobals": ".create_three_ds_scenarioop", "CreateThreeDsScenarioGlobalsTypedDict": ".create_three_ds_scenarioop", "CreateThreeDsScenarioRequest": ".create_three_ds_scenarioop", @@ -2483,6 +2533,8 @@ "DeletePaymentServiceGlobalsTypedDict": ".delete_payment_serviceop", "DeletePaymentServiceRequest": ".delete_payment_serviceop", "DeletePaymentServiceRequestTypedDict": ".delete_payment_serviceop", + "DeleteThreeDsConfigurationRequest": ".delete_three_ds_configurationop", + "DeleteThreeDsConfigurationRequestTypedDict": ".delete_three_ds_configurationop", "DeleteThreeDsScenarioGlobals": ".delete_three_ds_scenarioop", "DeleteThreeDsScenarioGlobalsTypedDict": ".delete_three_ds_scenarioop", "DeleteThreeDsScenarioRequest": ".delete_three_ds_scenarioop", @@ -2511,6 +2563,8 @@ "DlocalUPIWalletOptionsTypedDict": ".dlocalupiwalletoptions", "DlocalWalletOptions": ".dlocalwalletoptions", "DlocalWalletOptionsTypedDict": ".dlocalwalletoptions", + "EditThreeDsConfigurationRequest": ".edit_three_ds_configurationop", + "EditThreeDsConfigurationRequestTypedDict": ".edit_three_ds_configurationop", "ErrorDetail": ".errordetail", "ErrorDetailTypedDict": ".errordetail", "ErrorLocation": ".errorlocation", @@ -2780,6 +2834,8 @@ "ListReportsRequestTypedDict": ".list_reportsop", "ListReportsResponse": ".list_reportsop", "ListReportsResponseTypedDict": ".list_reportsop", + "ListThreeDsConfigurationsRequest": ".list_three_ds_configurationsop", + "ListThreeDsConfigurationsRequestTypedDict": ".list_three_ds_configurationsop", "ListTransactionActionsGlobals": ".list_transaction_actionsop", "ListTransactionActionsGlobalsTypedDict": ".list_transaction_actionsop", "ListTransactionActionsRequest": ".list_transaction_actionsop", @@ -2812,6 +2868,14 @@ "MerchantAccountCreateTypedDict": ".merchantaccountcreate", "MerchantAccounts": ".merchantaccounts", "MerchantAccountsTypedDict": ".merchantaccounts", + "MerchantAccountThreeDSConfiguration": ".merchantaccountthreedsconfiguration", + "MerchantAccountThreeDSConfigurationTypedDict": ".merchantaccountthreedsconfiguration", + "MerchantAccountThreeDSConfigurationCreate": ".merchantaccountthreedsconfigurationcreate", + "MerchantAccountThreeDSConfigurationCreateTypedDict": ".merchantaccountthreedsconfigurationcreate", + "MerchantAccountThreeDSConfigurations": ".merchantaccountthreedsconfigurations", + "MerchantAccountThreeDSConfigurationsTypedDict": ".merchantaccountthreedsconfigurations", + "MerchantAccountThreeDSConfigurationUpdate": ".merchantaccountthreedsconfigurationupdate", + "MerchantAccountThreeDSConfigurationUpdateTypedDict": ".merchantaccountthreedsconfigurationupdate", "MerchantAccountUpdate": ".merchantaccountupdate", "MerchantAccountUpdateTypedDict": ".merchantaccountupdate", "MerchantProfileScheme": ".merchantprofilescheme", diff --git a/src/gr4vy/models/capture_transactionop.py b/src/gr4vy/models/capture_transactionop.py index 4ee824a8..a0c13b31 100644 --- a/src/gr4vy/models/capture_transactionop.py +++ b/src/gr4vy/models/capture_transactionop.py @@ -58,6 +58,8 @@ class CaptureTransactionRequestTypedDict(TypedDict): r"""The preferred resource type in the response.""" merchant_account_id: NotRequired[str] r"""The ID of the merchant account to use for this request.""" + idempotency_key: NotRequired[Nullable[str]] + r"""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.""" class CaptureTransactionRequest(BaseModel): @@ -84,10 +86,17 @@ class CaptureTransactionRequest(BaseModel): ] = None r"""The ID of the merchant account to use for this request.""" + idempotency_key: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="idempotency-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + r"""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.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["prefer", "merchant_account_id"]) - nullable_fields = set(["prefer"]) + optional_fields = set(["prefer", "merchant_account_id", "idempotency-key"]) + nullable_fields = set(["prefer", "idempotency-key"]) serialized = handler(self) m = {} @@ -110,14 +119,14 @@ def serialize_model(self, handler): return m -ResponseCaptureTransactionTypedDict = TypeAliasType( - "ResponseCaptureTransactionTypedDict", +Response200CaptureTransactionTypedDict = TypeAliasType( + "Response200CaptureTransactionTypedDict", Union[TransactionCaptureTypedDict, TransactionTypedDict], ) r"""Successful Response""" -ResponseCaptureTransaction = TypeAliasType( - "ResponseCaptureTransaction", Union[TransactionCapture, Transaction] +Response200CaptureTransaction = TypeAliasType( + "Response200CaptureTransaction", Union[TransactionCapture, Transaction] ) r"""Successful Response""" diff --git a/src/gr4vy/models/create_three_ds_configurationop.py b/src/gr4vy/models/create_three_ds_configurationop.py new file mode 100644 index 00000000..74a96d33 --- /dev/null +++ b/src/gr4vy/models/create_three_ds_configurationop.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .merchantaccountthreedsconfigurationcreate import ( + MerchantAccountThreeDSConfigurationCreate, + MerchantAccountThreeDSConfigurationCreateTypedDict, +) +from gr4vy.types import BaseModel +from gr4vy.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class CreateThreeDsConfigurationRequestTypedDict(TypedDict): + merchant_account_id: str + r"""The ID of the merchant account.""" + merchant_account_three_ds_configuration_create: ( + MerchantAccountThreeDSConfigurationCreateTypedDict + ) + + +class CreateThreeDsConfigurationRequest(BaseModel): + merchant_account_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the merchant account.""" + + merchant_account_three_ds_configuration_create: Annotated[ + MerchantAccountThreeDSConfigurationCreate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/gr4vy/models/delete_three_ds_configurationop.py b/src/gr4vy/models/delete_three_ds_configurationop.py new file mode 100644 index 00000000..ad1a1a5d --- /dev/null +++ b/src/gr4vy/models/delete_three_ds_configurationop.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from gr4vy.types import BaseModel +from gr4vy.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteThreeDsConfigurationRequestTypedDict(TypedDict): + merchant_account_id: str + r"""The ID of the merchant account.""" + three_ds_configuration_id: str + r"""The ID of the 3DS configuration for a merchant account.""" + + +class DeleteThreeDsConfigurationRequest(BaseModel): + merchant_account_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the merchant account.""" + + three_ds_configuration_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the 3DS configuration for a merchant account.""" diff --git a/src/gr4vy/models/edit_three_ds_configurationop.py b/src/gr4vy/models/edit_three_ds_configurationop.py new file mode 100644 index 00000000..f8bdb444 --- /dev/null +++ b/src/gr4vy/models/edit_three_ds_configurationop.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .merchantaccountthreedsconfigurationupdate import ( + MerchantAccountThreeDSConfigurationUpdate, + MerchantAccountThreeDSConfigurationUpdateTypedDict, +) +from gr4vy.types import BaseModel +from gr4vy.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class EditThreeDsConfigurationRequestTypedDict(TypedDict): + merchant_account_id: str + r"""The ID of the merchant account.""" + three_ds_configuration_id: str + r"""The ID of the 3DS configuration for a merchant account.""" + merchant_account_three_ds_configuration_update: ( + MerchantAccountThreeDSConfigurationUpdateTypedDict + ) + + +class EditThreeDsConfigurationRequest(BaseModel): + merchant_account_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the merchant account.""" + + three_ds_configuration_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the 3DS configuration for a merchant account.""" + + merchant_account_three_ds_configuration_update: Annotated[ + MerchantAccountThreeDSConfigurationUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/gr4vy/models/get_merchant_accountop.py b/src/gr4vy/models/get_merchant_accountop.py index e9000f6d..e947059a 100644 --- a/src/gr4vy/models/get_merchant_accountop.py +++ b/src/gr4vy/models/get_merchant_accountop.py @@ -8,11 +8,11 @@ class GetMerchantAccountRequestTypedDict(TypedDict): merchant_account_id: str - r"""The ID of the merchant account""" + r"""The ID of the merchant account.""" class GetMerchantAccountRequest(BaseModel): merchant_account_id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The ID of the merchant account""" + r"""The ID of the merchant account.""" diff --git a/src/gr4vy/models/list_three_ds_configurationsop.py b/src/gr4vy/models/list_three_ds_configurationsop.py new file mode 100644 index 00000000..5a06b5ea --- /dev/null +++ b/src/gr4vy/models/list_three_ds_configurationsop.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from gr4vy.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListThreeDsConfigurationsRequestTypedDict(TypedDict): + merchant_account_id: str + r"""The ID of the merchant account.""" + currency: NotRequired[Nullable[str]] + r"""ISO 4217 currency code (3 characters) to filter 3DS configurations.""" + + +class ListThreeDsConfigurationsRequest(BaseModel): + merchant_account_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the merchant account.""" + + currency: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""ISO 4217 currency code (3 characters) to filter 3DS configurations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["currency"]) + nullable_fields = set(["currency"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/gr4vy/models/merchantaccountthreedsconfiguration.py b/src/gr4vy/models/merchantaccountthreedsconfiguration.py new file mode 100644 index 00000000..8d1dd25e --- /dev/null +++ b/src/gr4vy/models/merchantaccountthreedsconfiguration.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .cardscheme import CardScheme +from datetime import datetime +from gr4vy.types import BaseModel, Nullable, UNSET_SENTINEL +from gr4vy.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Dict, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class MerchantAccountThreeDSConfigurationTypedDict(TypedDict): + merchant_acquirer_bin: str + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + merchant_acquirer_id: str + r"""Merchant ID to use when calling 3DS through this scheme.""" + merchant_name: str + merchant_country_code: str + r"""The merchant's ISO 3166-1 numeric country code.""" + merchant_category_code: str + r"""Merchant category code to use when calling 3DS through this scheme.""" + merchant_url: str + r"""URL to send when calling 3DS through this scheme.""" + id: str + r"""Unique identifier for the 3DS configuration""" + merchant_account_id: str + r"""ID of the associated merchant account""" + created_at: datetime + r"""The date and time when this 3DS configuration was first created in our system.""" + updated_at: datetime + r"""The date and time when this 3DS configuration was last updated in our system.""" + scheme: CardScheme + currency: Nullable[str] + r"""ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies.""" + metadata: Dict[str, str] + r"""Additional information about the 3DS configuration, stored as key-value pairs.""" + type: Literal["merchant-account.three-ds-configuration"] + r"""Always `merchant-account.three-ds-configuration`.""" + + +class MerchantAccountThreeDSConfiguration(BaseModel): + merchant_acquirer_bin: str + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + + merchant_acquirer_id: str + r"""Merchant ID to use when calling 3DS through this scheme.""" + + merchant_name: str + + merchant_country_code: str + r"""The merchant's ISO 3166-1 numeric country code.""" + + merchant_category_code: str + r"""Merchant category code to use when calling 3DS through this scheme.""" + + merchant_url: str + r"""URL to send when calling 3DS through this scheme.""" + + id: str + r"""Unique identifier for the 3DS configuration""" + + merchant_account_id: str + r"""ID of the associated merchant account""" + + created_at: datetime + r"""The date and time when this 3DS configuration was first created in our system.""" + + updated_at: datetime + r"""The date and time when this 3DS configuration was last updated in our system.""" + + scheme: CardScheme + + currency: Nullable[str] + r"""ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies.""" + + metadata: Dict[str, str] + r"""Additional information about the 3DS configuration, stored as key-value pairs.""" + + TYPE: Annotated[ + Annotated[ + Optional[Literal["merchant-account.three-ds-configuration"]], + AfterValidator(validate_const("merchant-account.three-ds-configuration")), + ], + pydantic.Field(alias="type"), + ] = "merchant-account.three-ds-configuration" + r"""Always `merchant-account.three-ds-configuration`.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + nullable_fields = set(["currency"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/gr4vy/models/merchantaccountthreedsconfigurationcreate.py b/src/gr4vy/models/merchantaccountthreedsconfigurationcreate.py new file mode 100644 index 00000000..ac3b4a23 --- /dev/null +++ b/src/gr4vy/models/merchantaccountthreedsconfigurationcreate.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .cardscheme import CardScheme +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict +from typing_extensions import NotRequired, TypedDict + + +class MerchantAccountThreeDSConfigurationCreateTypedDict(TypedDict): + merchant_acquirer_bin: str + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + merchant_acquirer_id: str + r"""Merchant ID to use when calling 3DS through this scheme.""" + merchant_name: str + merchant_country_code: str + r"""The merchant's ISO 3166-1 numeric country code.""" + merchant_category_code: str + r"""Merchant category code to use when calling 3DS through this scheme.""" + merchant_url: str + r"""URL to send when calling 3DS through this scheme.""" + scheme: CardScheme + metadata: Dict[str, str] + r"""Any additional information about the 3DS configuration that you would like to store as key-value pairs.""" + currency: NotRequired[Nullable[str]] + r"""ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies.""" + + +class MerchantAccountThreeDSConfigurationCreate(BaseModel): + merchant_acquirer_bin: str + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + + merchant_acquirer_id: str + r"""Merchant ID to use when calling 3DS through this scheme.""" + + merchant_name: str + + merchant_country_code: str + r"""The merchant's ISO 3166-1 numeric country code.""" + + merchant_category_code: str + r"""Merchant category code to use when calling 3DS through this scheme.""" + + merchant_url: str + r"""URL to send when calling 3DS through this scheme.""" + + scheme: CardScheme + + metadata: Dict[str, str] + r"""Any additional information about the 3DS configuration that you would like to store as key-value pairs.""" + + currency: OptionalNullable[str] = UNSET + r"""ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["currency"]) + nullable_fields = set(["currency"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/gr4vy/models/merchantaccountthreedsconfigurations.py b/src/gr4vy/models/merchantaccountthreedsconfigurations.py new file mode 100644 index 00000000..2e4f669a --- /dev/null +++ b/src/gr4vy/models/merchantaccountthreedsconfigurations.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .merchantaccountthreedsconfiguration import ( + MerchantAccountThreeDSConfiguration, + MerchantAccountThreeDSConfigurationTypedDict, +) +from gr4vy.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class MerchantAccountThreeDSConfigurationsTypedDict(TypedDict): + items: List[MerchantAccountThreeDSConfigurationTypedDict] + r"""A list of items returned for this request.""" + + +class MerchantAccountThreeDSConfigurations(BaseModel): + items: List[MerchantAccountThreeDSConfiguration] + r"""A list of items returned for this request.""" diff --git a/src/gr4vy/models/merchantaccountthreedsconfigurationupdate.py b/src/gr4vy/models/merchantaccountthreedsconfigurationupdate.py new file mode 100644 index 00000000..7b540bb9 --- /dev/null +++ b/src/gr4vy/models/merchantaccountthreedsconfigurationupdate.py @@ -0,0 +1,105 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .cardscheme import CardScheme +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict +from typing_extensions import NotRequired, TypedDict + + +class MerchantAccountThreeDSConfigurationUpdateTypedDict(TypedDict): + merchant_acquirer_bin: NotRequired[Nullable[str]] + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + merchant_acquirer_id: NotRequired[Nullable[str]] + r"""Merchant ID to use when calling 3DS through this scheme.""" + merchant_name: NotRequired[Nullable[str]] + merchant_country_code: NotRequired[Nullable[str]] + r"""The merchant's ISO 3166-1 numeric country code.""" + merchant_category_code: NotRequired[Nullable[str]] + r"""Merchant category code to use when calling 3DS through this scheme.""" + merchant_url: NotRequired[Nullable[str]] + r"""URL to send when calling 3DS through this scheme.""" + scheme: NotRequired[Nullable[CardScheme]] + r"""The card scheme for this 3DS configuration""" + currency: NotRequired[Nullable[str]] + r"""ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies.""" + metadata: NotRequired[Nullable[Dict[str, str]]] + r"""Any additional information about the 3DS configuration that you would like to store as key-value pairs.""" + + +class MerchantAccountThreeDSConfigurationUpdate(BaseModel): + merchant_acquirer_bin: OptionalNullable[str] = UNSET + r"""Acquirer BIN to use when calling 3DS through this scheme.""" + + merchant_acquirer_id: OptionalNullable[str] = UNSET + r"""Merchant ID to use when calling 3DS through this scheme.""" + + merchant_name: OptionalNullable[str] = UNSET + + merchant_country_code: OptionalNullable[str] = UNSET + r"""The merchant's ISO 3166-1 numeric country code.""" + + merchant_category_code: OptionalNullable[str] = UNSET + r"""Merchant category code to use when calling 3DS through this scheme.""" + + merchant_url: OptionalNullable[str] = UNSET + r"""URL to send when calling 3DS through this scheme.""" + + scheme: OptionalNullable[CardScheme] = UNSET + r"""The card scheme for this 3DS configuration""" + + currency: OptionalNullable[str] = UNSET + r"""ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies.""" + + metadata: OptionalNullable[Dict[str, str]] = UNSET + r"""Any additional information about the 3DS configuration that you would like to store as key-value pairs.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "merchant_acquirer_bin", + "merchant_acquirer_id", + "merchant_name", + "merchant_country_code", + "merchant_category_code", + "merchant_url", + "scheme", + "currency", + "metadata", + ] + ) + nullable_fields = set( + [ + "merchant_acquirer_bin", + "merchant_acquirer_id", + "merchant_name", + "merchant_country_code", + "merchant_category_code", + "merchant_url", + "scheme", + "currency", + "metadata", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/gr4vy/models/update_merchant_accountop.py b/src/gr4vy/models/update_merchant_accountop.py index 37ccccaf..cc301186 100644 --- a/src/gr4vy/models/update_merchant_accountop.py +++ b/src/gr4vy/models/update_merchant_accountop.py @@ -9,7 +9,7 @@ class UpdateMerchantAccountRequestTypedDict(TypedDict): merchant_account_id: str - r"""The ID of the merchant account""" + r"""The ID of the merchant account.""" merchant_account_update: MerchantAccountUpdateTypedDict @@ -17,7 +17,7 @@ class UpdateMerchantAccountRequest(BaseModel): merchant_account_id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The ID of the merchant account""" + r"""The ID of the merchant account.""" merchant_account_update: Annotated[ MerchantAccountUpdate, diff --git a/src/gr4vy/three_ds_configuration.py b/src/gr4vy/three_ds_configuration.py new file mode 100644 index 00000000..1aef781c --- /dev/null +++ b/src/gr4vy/three_ds_configuration.py @@ -0,0 +1,1297 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from gr4vy import errors, models, utils +from gr4vy._hooks import HookContext +from gr4vy.types import OptionalNullable, UNSET +from gr4vy.utils import get_security_from_env +from gr4vy.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional + + +class ThreeDsConfiguration(BaseSDK): + def create( + self, + *, + merchant_account_id: str, + merchant_acquirer_bin: str, + merchant_acquirer_id: str, + merchant_name: str, + merchant_country_code: str, + merchant_category_code: str, + merchant_url: str, + scheme: models.CardScheme, + metadata: Dict[str, str], + currency: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfiguration: + r"""Create 3DS configuration for merchant + + Create a new 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param merchant_acquirer_bin: Acquirer BIN to use when calling 3DS through this scheme. + :param merchant_acquirer_id: Merchant ID to use when calling 3DS through this scheme. + :param merchant_name: + :param merchant_country_code: The merchant's ISO 3166-1 numeric country code. + :param merchant_category_code: Merchant category code to use when calling 3DS through this scheme. + :param merchant_url: URL to send when calling 3DS through this scheme. + :param scheme: + :param metadata: Any additional information about the 3DS configuration that you would like to store as key-value pairs. + :param currency: ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + merchant_account_three_ds_configuration_create=models.MerchantAccountThreeDSConfigurationCreate( + merchant_acquirer_bin=merchant_acquirer_bin, + merchant_acquirer_id=merchant_acquirer_id, + merchant_name=merchant_name, + merchant_country_code=merchant_country_code, + merchant_category_code=merchant_category_code, + merchant_url=merchant_url, + scheme=scheme, + currency=currency, + metadata=metadata, + ), + ) + + req = self._build_request( + method="POST", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.merchant_account_three_ds_configuration_create, + False, + False, + "json", + models.MerchantAccountThreeDSConfigurationCreate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfiguration, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + async def create_async( + self, + *, + merchant_account_id: str, + merchant_acquirer_bin: str, + merchant_acquirer_id: str, + merchant_name: str, + merchant_country_code: str, + merchant_category_code: str, + merchant_url: str, + scheme: models.CardScheme, + metadata: Dict[str, str], + currency: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfiguration: + r"""Create 3DS configuration for merchant + + Create a new 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param merchant_acquirer_bin: Acquirer BIN to use when calling 3DS through this scheme. + :param merchant_acquirer_id: Merchant ID to use when calling 3DS through this scheme. + :param merchant_name: + :param merchant_country_code: The merchant's ISO 3166-1 numeric country code. + :param merchant_category_code: Merchant category code to use when calling 3DS through this scheme. + :param merchant_url: URL to send when calling 3DS through this scheme. + :param scheme: + :param metadata: Any additional information about the 3DS configuration that you would like to store as key-value pairs. + :param currency: ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + merchant_account_three_ds_configuration_create=models.MerchantAccountThreeDSConfigurationCreate( + merchant_acquirer_bin=merchant_acquirer_bin, + merchant_acquirer_id=merchant_acquirer_id, + merchant_name=merchant_name, + merchant_country_code=merchant_country_code, + merchant_category_code=merchant_category_code, + merchant_url=merchant_url, + scheme=scheme, + currency=currency, + metadata=metadata, + ), + ) + + req = self._build_request_async( + method="POST", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.merchant_account_three_ds_configuration_create, + False, + False, + "json", + models.MerchantAccountThreeDSConfigurationCreate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfiguration, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + def list( + self, + *, + merchant_account_id: str, + currency: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfigurations: + r"""List 3DS configurations for merchant + + List all 3DS configurations for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param currency: ISO 4217 currency code (3 characters) to filter 3DS configurations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListThreeDsConfigurationsRequest( + merchant_account_id=merchant_account_id, + currency=currency, + ) + + req = self._build_request( + method="GET", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(200, 200, 1, 1000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_three_ds_configurations", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfigurations, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + async def list_async( + self, + *, + merchant_account_id: str, + currency: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfigurations: + r"""List 3DS configurations for merchant + + List all 3DS configurations for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param currency: ISO 4217 currency code (3 characters) to filter 3DS configurations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListThreeDsConfigurationsRequest( + merchant_account_id=merchant_account_id, + currency=currency, + ) + + req = self._build_request_async( + method="GET", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(200, 200, 1, 1000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_three_ds_configurations", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfigurations, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + def update( + self, + *, + merchant_account_id: str, + three_ds_configuration_id: str, + merchant_acquirer_bin: OptionalNullable[str] = UNSET, + merchant_acquirer_id: OptionalNullable[str] = UNSET, + merchant_name: OptionalNullable[str] = UNSET, + merchant_country_code: OptionalNullable[str] = UNSET, + merchant_category_code: OptionalNullable[str] = UNSET, + merchant_url: OptionalNullable[str] = UNSET, + scheme: OptionalNullable[models.CardScheme] = UNSET, + currency: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfiguration: + r"""Edit 3DS configuration + + Update the 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param three_ds_configuration_id: The ID of the 3DS configuration for a merchant account. + :param merchant_acquirer_bin: Acquirer BIN to use when calling 3DS through this scheme. + :param merchant_acquirer_id: Merchant ID to use when calling 3DS through this scheme. + :param merchant_name: + :param merchant_country_code: The merchant's ISO 3166-1 numeric country code. + :param merchant_category_code: Merchant category code to use when calling 3DS through this scheme. + :param merchant_url: URL to send when calling 3DS through this scheme. + :param scheme: The card scheme for this 3DS configuration + :param currency: ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + :param metadata: Any additional information about the 3DS configuration that you would like to store as key-value pairs. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.EditThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + three_ds_configuration_id=three_ds_configuration_id, + merchant_account_three_ds_configuration_update=models.MerchantAccountThreeDSConfigurationUpdate( + merchant_acquirer_bin=merchant_acquirer_bin, + merchant_acquirer_id=merchant_acquirer_id, + merchant_name=merchant_name, + merchant_country_code=merchant_country_code, + merchant_category_code=merchant_category_code, + merchant_url=merchant_url, + scheme=scheme, + currency=currency, + metadata=metadata, + ), + ) + + req = self._build_request( + method="PUT", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.merchant_account_three_ds_configuration_update, + False, + False, + "json", + models.MerchantAccountThreeDSConfigurationUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="edit_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfiguration, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + async def update_async( + self, + *, + merchant_account_id: str, + three_ds_configuration_id: str, + merchant_acquirer_bin: OptionalNullable[str] = UNSET, + merchant_acquirer_id: OptionalNullable[str] = UNSET, + merchant_name: OptionalNullable[str] = UNSET, + merchant_country_code: OptionalNullable[str] = UNSET, + merchant_category_code: OptionalNullable[str] = UNSET, + merchant_url: OptionalNullable[str] = UNSET, + scheme: OptionalNullable[models.CardScheme] = UNSET, + currency: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MerchantAccountThreeDSConfiguration: + r"""Edit 3DS configuration + + Update the 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param three_ds_configuration_id: The ID of the 3DS configuration for a merchant account. + :param merchant_acquirer_bin: Acquirer BIN to use when calling 3DS through this scheme. + :param merchant_acquirer_id: Merchant ID to use when calling 3DS through this scheme. + :param merchant_name: + :param merchant_country_code: The merchant's ISO 3166-1 numeric country code. + :param merchant_category_code: Merchant category code to use when calling 3DS through this scheme. + :param merchant_url: URL to send when calling 3DS through this scheme. + :param scheme: The card scheme for this 3DS configuration + :param currency: ISO 4217 currency code (3 characters). If left null, the configuration will apply to all currencies. + :param metadata: Any additional information about the 3DS configuration that you would like to store as key-value pairs. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.EditThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + three_ds_configuration_id=three_ds_configuration_id, + merchant_account_three_ds_configuration_update=models.MerchantAccountThreeDSConfigurationUpdate( + merchant_acquirer_bin=merchant_acquirer_bin, + merchant_acquirer_id=merchant_acquirer_id, + merchant_name=merchant_name, + merchant_country_code=merchant_country_code, + merchant_category_code=merchant_category_code, + merchant_url=merchant_url, + scheme=scheme, + currency=currency, + metadata=metadata, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.merchant_account_three_ds_configuration_update, + False, + False, + "json", + models.MerchantAccountThreeDSConfigurationUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="edit_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.MerchantAccountThreeDSConfiguration, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + def delete( + self, + *, + merchant_account_id: str, + three_ds_configuration_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete 3DS configuration for a merchant + + Delete a 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param three_ds_configuration_id: The ID of the 3DS configuration for a merchant account. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + three_ds_configuration_id=three_ds_configuration_id, + ) + + req = self._build_request( + method="DELETE", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + merchant_account_id: str, + three_ds_configuration_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete 3DS configuration for a merchant + + Delete a 3DS configuration for a merchant account. + + :param merchant_account_id: The ID of the merchant account. + :param three_ds_configuration_id: The ID of the 3DS configuration for a merchant account. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteThreeDsConfigurationRequest( + merchant_account_id=merchant_account_id, + three_ds_configuration_id=three_ds_configuration_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/merchant-accounts/{merchant_account_id}/three-ds-configurations/{three_ds_configuration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_three_ds_configuration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "422", + "425", + "429", + "4XX", + "500", + "502", + "504", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response(errors.Error400Data, http_res) + raise errors.Error400(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response(errors.Error401Data, http_res) + raise errors.Error401(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(errors.Error403Data, http_res) + raise errors.Error403(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.Error404Data, http_res) + raise errors.Error404(response_data, http_res) + if utils.match_response(http_res, "405", "application/json"): + response_data = unmarshal_json_response(errors.Error405Data, http_res) + raise errors.Error405(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response(errors.Error409Data, http_res) + raise errors.Error409(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "425", "application/json"): + response_data = unmarshal_json_response(errors.Error425Data, http_res) + raise errors.Error425(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.Error429Data, http_res) + raise errors.Error429(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response(errors.Error500Data, http_res) + raise errors.Error500(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.Error502Data, http_res) + raise errors.Error502(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response(errors.Error504Data, http_res) + raise errors.Error504(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.APIError("API error occurred", http_res, http_res_text) + + raise errors.APIError("Unexpected response received", http_res) diff --git a/src/gr4vy/transactions.py b/src/gr4vy/transactions.py index e07d70fa..e199d92b 100644 --- a/src/gr4vy/transactions.py +++ b/src/gr4vy/transactions.py @@ -2057,6 +2057,7 @@ def capture( transaction_id: str, prefer: OptionalNullable[List[str]] = UNSET, merchant_account_id: Optional[str] = None, + idempotency_key: OptionalNullable[str] = UNSET, amount: OptionalNullable[int] = UNSET, airline: OptionalNullable[ Union[models.Airline, models.AirlineTypedDict] @@ -2065,7 +2066,7 @@ def capture( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ResponseCaptureTransaction: + ) -> models.Response200CaptureTransaction: r"""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). @@ -2073,6 +2074,7 @@ def capture( :param transaction_id: The ID of the transaction :param prefer: The preferred resource type in the response. :param merchant_account_id: The ID of the merchant account to use for this request. + :param idempotency_key: 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. :param amount: The amount to capture, in the smallest currency unit (e.g., cents). This must be less than or equal to the authorized amount, unless over-capture is available. :param airline: The airline data to submit to the payment service during the capture call. :param retries: Override the default retry configuration for this method @@ -2094,6 +2096,7 @@ def capture( transaction_id=transaction_id, prefer=prefer, merchant_account_id=merchant_account_id, + idempotency_key=idempotency_key, transaction_capture_create=models.TransactionCaptureCreate( amount=amount, airline=utils.get_pydantic_model( @@ -2169,7 +2172,9 @@ def capture( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ResponseCaptureTransaction, http_res) + return unmarshal_json_response( + models.Response200CaptureTransaction, http_res + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response(errors.Error400Data, http_res) raise errors.Error400(response_data, http_res) @@ -2223,6 +2228,7 @@ async def capture_async( transaction_id: str, prefer: OptionalNullable[List[str]] = UNSET, merchant_account_id: Optional[str] = None, + idempotency_key: OptionalNullable[str] = UNSET, amount: OptionalNullable[int] = UNSET, airline: OptionalNullable[ Union[models.Airline, models.AirlineTypedDict] @@ -2231,7 +2237,7 @@ async def capture_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ResponseCaptureTransaction: + ) -> models.Response200CaptureTransaction: r"""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). @@ -2239,6 +2245,7 @@ async def capture_async( :param transaction_id: The ID of the transaction :param prefer: The preferred resource type in the response. :param merchant_account_id: The ID of the merchant account to use for this request. + :param idempotency_key: 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. :param amount: The amount to capture, in the smallest currency unit (e.g., cents). This must be less than or equal to the authorized amount, unless over-capture is available. :param airline: The airline data to submit to the payment service during the capture call. :param retries: Override the default retry configuration for this method @@ -2260,6 +2267,7 @@ async def capture_async( transaction_id=transaction_id, prefer=prefer, merchant_account_id=merchant_account_id, + idempotency_key=idempotency_key, transaction_capture_create=models.TransactionCaptureCreate( amount=amount, airline=utils.get_pydantic_model( @@ -2335,7 +2343,9 @@ async def capture_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ResponseCaptureTransaction, http_res) + return unmarshal_json_response( + models.Response200CaptureTransaction, http_res + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response(errors.Error400Data, http_res) raise errors.Error400(response_data, http_res) diff --git a/src/gr4vy/utils/__init__.py b/src/gr4vy/utils/__init__.py index f4525b20..23ac4483 100644 --- a/src/gr4vy/utils/__init__.py +++ b/src/gr4vy/utils/__init__.py @@ -11,10 +11,7 @@ async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T: """Run a synchronous function in a thread pool to avoid blocking the event loop.""" - if sys.version_info >= (3, 9): - return await asyncio.to_thread(func, *args) - loop = asyncio.get_event_loop() - return await loop.run_in_executor(None, func, *args) + return await asyncio.to_thread(func, *args) if TYPE_CHECKING: