diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index eec64eab..9ecc11d5 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: f38f0294458f2a2809b7041c8d833b69 + docChecksum: b9b181601c9beb9864255e39e1599afd docVersion: 1.0.0 - speakeasyVersion: 1.787.0 - generationVersion: 2.914.0 - releaseVersion: 2.2.2 - configChecksum: d2f104e0bad48e02aa0b83e367721c19 + speakeasyVersion: 1.788.1 + generationVersion: 2.915.1 + releaseVersion: 2.2.3 + configChecksum: 2d9e804c0a4211fd5b5748ef5b3930e5 repoURL: https://github.com/gr4vy/gr4vy-python.git installationURL: https://github.com/gr4vy/gr4vy-python.git published: true persistentEdits: - generation_id: 1cf93a03-25d3-4732-87e2-4f04891cf924 - pristine_commit_hash: b2e66213ffe2b95edf60d0e0c2ee5a5832d7b365 - pristine_tree_hash: e7c01dc40569fb75888a6f594c8abc1915c9a2f3 + generation_id: 741d399b-d6dc-4d9e-9e1b-77191757d3ab + pristine_commit_hash: 7cdd98437cf25a4e1e5d73137ad75ec7c4d85f7d + pristine_tree_hash: 05ef6efa7e9bf7f94fd1f34721f1722e8a204e09 features: python: additionalDependencies: 1.1.0 constsAndDefaults: 1.0.7 - core: 6.0.33 + core: 6.0.34 defaultEnabledRetries: 0.2.0 enumUnions: 0.1.1 envVarSecurityUsage: 0.3.3 @@ -238,6 +238,34 @@ trackedFiles: id: aad1246ffd0c last_write_checksum: sha1:7c2f0246474f724dc465b9d2ec67b08e5d9d4952 pristine_git_object: 49c59d6193958c0dc747dfe9d8a5cfac5cec8a5b + docs/models/apicommonschemascreator.md: + id: f084686ed0fb + last_write_checksum: sha1:b8e99fca68fe7138d59f51909d05904bf0e3e7b3 + pristine_git_object: c1f3d21b4c080ebb0b4ca1f5fc9aadfec8e24fc5 + docs/models/apicommonschemasmerchantaccount.md: + id: "407688441e88" + last_write_checksum: sha1:e3dd562f48388081b28ecdfd74c89877c21351d5 + pristine_git_object: a629dc8788a013798b487bb94f53642e6faae591 + docs/models/apikeypair.md: + id: aca6b01ba07b + last_write_checksum: sha1:440912cc2d902c341f68c94fef50afc1fea90f69 + pristine_git_object: 8156c5ba219732e601bb95246ccf1cfb4fb80307 + docs/models/apikeypaircreate.md: + id: 8528359e4ec5 + last_write_checksum: sha1:0c9c6e71e91acd0190bc330411803fb456447334 + pristine_git_object: 30ac672fa8984d81d58b7a0ea9514218e6df0611 + docs/models/apikeypairupdate.md: + id: 08f246a933e8 + last_write_checksum: sha1:946c4e781f0a744f9fdea91b56b1c600198688a4 + pristine_git_object: f2d30833a041436dc11d43f1626bc0eea3f40c38 + docs/models/apiroutersapikeypairsschemascreator.md: + id: cd07390ea835 + last_write_checksum: sha1:b008b2c2164dbf1d215e054d0d260952068e6d5e + pristine_git_object: a535ede2c0ad44b4cabee3544bea3f21099fe23b + docs/models/apiroutersmerchantaccountsschemasmerchantaccount.md: + id: 60990e3f4f00 + last_write_checksum: sha1:3e8ce87040ced1fa00b3c4e29a2a8209d13b570e + pristine_git_object: 3a2cc6ee053464bf03b9d2e40120dd835f7fc005 docs/models/apitypesdigitalwalletaddress.md: id: 75a708c1a902 last_write_checksum: sha1:afd23fa3a848fc637ecbcbc621f0ccad1115b410 @@ -394,6 +422,10 @@ trackedFiles: id: c5bd6fe27df2 last_write_checksum: sha1:592fa063a7f7e9b7d2a0d22ce8cc163b8f3e1945 pristine_git_object: a053e9bf678afbee6a37652c54dec6313128687c + docs/models/certificatealgorithm.md: + id: 48af6006cbed + last_write_checksum: sha1:5ae66f6a7fdab977029492602f4cd72b36f02d8a + pristine_git_object: 05db3400323dd9ae4e9819e1626731ffef2bd3f5 docs/models/chaseoptions.md: id: 52e385f89b96 last_write_checksum: sha1:254f90381cbf29fd856d915293384d2f63e8d63b @@ -442,6 +474,10 @@ trackedFiles: id: e841afec562c last_write_checksum: sha1:bfa89ed7607ba0d8d80522469d177c55d2d0f812 pristine_git_object: 0e493b5fa49ba96f9556c43f24a3074ff6010a92 + docs/models/collectionapikeypair.md: + id: a675d216a617 + last_write_checksum: sha1:34fecd902db403b5eac2a7325cde9170d899595e + pristine_git_object: 0b8a033a0d7c064747717f2e25906ab81fda6137 docs/models/completepazemobilesessionglobals.md: id: 344c55909f4d last_write_checksum: sha1:d08650aec48dbb8b41c823e4dd12734d5ee9903f @@ -630,10 +666,6 @@ trackedFiles: id: 286e840a03bb last_write_checksum: sha1:7f2aa8547b40bc5af88db529944c4f0a61c848e1 pristine_git_object: 46e252cf75a87f2aa35cdf6703eadf80217604c5 - docs/models/creator.md: - id: 9d4c4321a1a9 - last_write_checksum: sha1:a8d2526aa88c60d623e3a32da3d9b57b343195e1 - pristine_git_object: 9f83efa7d0bdace33eed0f92a1290930ceba9931 docs/models/cryptogram.md: id: 95e0c673187a last_write_checksum: sha1:66e1ac90564b05592f6bad63af42f7c46bf60e76 @@ -662,6 +694,10 @@ trackedFiles: id: 51b73d55251f last_write_checksum: sha1:ad747314fbc4f88acfbf5acd96a0c7d1fdb96ffb pristine_git_object: 5fc519dfdfaf71f96517b65c6aad8157fc2d1417 + docs/models/deleteapikeypairrequest.md: + id: 04ea35b8890f + last_write_checksum: sha1:5b3b17a85477d50284f40e13a4cd6de606660793 + pristine_git_object: 82dd653b5333c868dab172c8146e11272f4976f9 docs/models/deletebuyerglobals.md: id: b4bd631775fd last_write_checksum: sha1:8be4737c073459c370ca7afc67e284bf0376993a @@ -922,6 +958,10 @@ trackedFiles: id: 1afa3fb14066 last_write_checksum: sha1:067bfe0b28c8bcf443beae7fdba716335cab7a8e pristine_git_object: 1850b0c4c1ed4d7bf02789c48f1e590dc3cde786 + docs/models/getapikeypairrequest.md: + id: 4ef916599a11 + last_write_checksum: sha1:9cbb3b6f736242c96eefd5292fed1704d6a7ec47 + pristine_git_object: ec098d3ad377727931b5f8745a063d1f9e196274 docs/models/getbuyerglobals.md: id: 4807b45868ff last_write_checksum: sha1:4a60da1c956c982233ced133ae78004a4180f3ab @@ -1206,6 +1246,14 @@ trackedFiles: id: 3104cdfd6073 last_write_checksum: sha1:f8aa00929654f896e7c4fccc8bf32ece9eb76cac pristine_git_object: 98ae2f5868083793cdee446100907f1b92c8b2a7 + docs/models/listapikeypairsrequest.md: + id: 5c461dd89d12 + last_write_checksum: sha1:aa5f2efe4c6a7c20fdb9724b6590869253235ca5 + pristine_git_object: f2ee392e5ef49cb130bf7800eb51e6e058ecc16d + docs/models/listapikeypairsresponse.md: + id: b5ec6c3bc56c + last_write_checksum: sha1:a06fb5ae0cb03fb3ea007e58c8473111f0b7f1dd + pristine_git_object: 3fa342ffbb1c779a5c9ae4d388015af90ec9a00f docs/models/listauditlogsglobals.md: id: 62e799b6caed last_write_checksum: sha1:fc06cec2c9f3b14e391e86d7bc57c72c0071e245 @@ -1486,18 +1534,14 @@ trackedFiles: id: 44ebba151746 last_write_checksum: sha1:73b954f790bcac981542fdabf8f7bbbb4ff89cc9 pristine_git_object: c7998af826fa652d70876ab931cbcb893c08ddad - docs/models/merchantaccount.md: - id: e086409ff0fa - last_write_checksum: sha1:80ea54aa8208bf4b0a58406100ffca1fba8ef86b - pristine_git_object: 1661265b01a4b58c3d4e1b59ab0a8cde9276639a docs/models/merchantaccountcreate.md: id: a82f978b5311 last_write_checksum: sha1:f6f4d6cd9b6d760e6120b48bfa2db0032d437512 pristine_git_object: 9193d0c5e3e90fb9d45d725cba9e89d0ce398f19 docs/models/merchantaccounts.md: id: 2b8c0cb06a58 - last_write_checksum: sha1:efa315d8d287df3315adabe99c61b0370675e1c2 - pristine_git_object: 6b1087e840f2fe77db805fef5a2afba604bd0e02 + last_write_checksum: sha1:f65b7770d28a6efaa9ab1ea363fd3ac7b255cb1b + pristine_git_object: e0a2961b75ad54a205c704ecd7147107ee7e528d docs/models/merchantaccountthreedsconfiguration.md: id: 8b7af4499332 last_write_checksum: sha1:1d4eeb0e06ec667981b29435d631e4db7607b309 @@ -1910,6 +1954,10 @@ trackedFiles: id: e929e29bee74 last_write_checksum: sha1:8f0b4045e83532e0147e548c8fabe106324ced7f pristine_git_object: 62ae5cde79d785815cb7ad75fb16833cc142d048 + docs/models/permissionset.md: + id: 818916f866f8 + last_write_checksum: sha1:bdfc0899457e415391a406c0fc97846eeb89392f + pristine_git_object: 7cbcb43d12a3591e995e7046657142a892c7cb71 docs/models/plaidpaymentmethodcreate.md: id: 0f87b45637cb last_write_checksum: sha1:282a2bca19c804e28b78dfa69984af3553f3286e @@ -1944,8 +1992,8 @@ trackedFiles: pristine_git_object: 2f582028e7247589fa15ebc19c92e618b1ec269e docs/models/refund.md: id: 3be36b1a2825 - last_write_checksum: sha1:7e82f63f6a6644bdbc3cb620c02bc79aa57891a8 - pristine_git_object: 0d2df50e159f7d6f20eac5fc52f6679c64e6d6bc + last_write_checksum: sha1:8f975ae1539c5184449515d534598e165747e20b + pristine_git_object: fde301a8b05a471abd6952eeb662efec961895a9 docs/models/refunds.md: id: 56cad80f02e4 last_write_checksum: sha1:142d11ec89618ca4f0d7d8c6637dfb354d3fe6cf @@ -2082,6 +2130,10 @@ trackedFiles: id: 4d22d444dd28 last_write_checksum: sha1:d07f97342c839bd9d49c9bf442edc293d8ea2ccc pristine_git_object: 62784bbbe8065c86489707a739e5d951ebb260c7 + docs/models/role.md: + id: b694540a5b1e + last_write_checksum: sha1:0530996174d716d4cfa8eed398cc443c597d5dea + pristine_git_object: 886eb092321552d682ba3d4423a1c2801942ee4d docs/models/routetype.md: id: b1706609606d last_write_checksum: sha1:a87cf1fb7aae8ebada53fe2ad4e3e9702533317f @@ -2390,6 +2442,10 @@ trackedFiles: id: 810900bb9760 last_write_checksum: sha1:00f16eaa54b4e374332143bfb8c4f241c8a58055 pristine_git_object: eb60ee73ba71ab26c4760f6da20f584af4cab720 + docs/models/updateapikeypairrequest.md: + id: 525c09d0e1d5 + last_write_checksum: sha1:28b446e40ad7157ec66bb3a81d726babc26e9b78 + pristine_git_object: f02a62f5905f738131b49eabb440d107a30bcb5e docs/models/updatebuyerglobals.md: id: 586949a9f0fc last_write_checksum: sha1:5293c7b8fe6eb096924b01a98f342e9e982cb064 @@ -2542,6 +2598,10 @@ trackedFiles: id: 936653be5c4b last_write_checksum: sha1:459a81e6b5c16a050ff3d8bebc29c97d7eaa8c08 pristine_git_object: 628cdae9ff513096669a9d17bb6e93f5d7dd3042 + docs/sdks/apikeypairs/README.md: + id: ea1b1a49a3b2 + last_write_checksum: sha1:73da7228536a50defbd45ec30bf273675ad04876 + pristine_git_object: 89552dd59688c6fa103ef58703f6fa3dd50d5fc2 docs/sdks/auditlogs/README.md: id: 4ed8509e422e last_write_checksum: sha1:951bf6f23c26094ac2d94838ba5f9567becf4dbf @@ -2604,8 +2664,8 @@ trackedFiles: pristine_git_object: 1b2ca14485f19909d286ffa638d6fcdd333223ed docs/sdks/merchantaccountssdk/README.md: id: 39108cecfab1 - last_write_checksum: sha1:7e2eb98eeacb5e0cb87892d1507db2d4cdc84a0f - pristine_git_object: 9e993143b9d656fc74af7c7ed0f8d1f2178c02f0 + last_write_checksum: sha1:f2dce1592a26b78819c72bf5fa41cdeac7db505a + pristine_git_object: 5a38ea66513a7af38aed18736fc186e18257540f docs/sdks/networktokenscryptogram/README.md: id: 7aef02dc3c54 last_write_checksum: sha1:3ac01232944c881072602290f8de7132617e85fc @@ -2692,8 +2752,8 @@ trackedFiles: pristine_git_object: cb9c15d314c1930557401074329ed7a737147919 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:5c443a2e03001c67b670379d09f2b078886117e0 - pristine_git_object: 3a531d74cae7aa3bc02858fa4bb1b7295400c6de + last_write_checksum: sha1:593ff8d50ca1f4470879b79345c181552e10458c + pristine_git_object: f2adfd10c72029c3b1f998c9a941ec0c4ee5bd1e scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:63a92abbd1de3323613f0d4c1ae4412076577710 @@ -2720,8 +2780,8 @@ trackedFiles: pristine_git_object: f8ef109bb6a9dbe37d0a7092606176a0738986fd src/gr4vy/_version.py: id: 1b5ad1da47aa - last_write_checksum: sha1:93cecc20fcb47d3d1ae9b5aeebfd98c16c929069 - pristine_git_object: 6a9146a501f23e3948120bbd1b156b82c27783a2 + last_write_checksum: sha1:8fe3ab5a4869f3e7b8a4fda5cbb4a7e124001013 + pristine_git_object: 7192251c39c4b3b14915fc4e8fa137b91fe66fdd src/gr4vy/account_updater.py: id: 6dc8f39e2fb9 last_write_checksum: sha1:fabc79a59dd06fb927ce2d834fbafbcad5836a4b @@ -2734,6 +2794,10 @@ trackedFiles: id: d6655ce20176 last_write_checksum: sha1:51ab7e42af4e29dc0fc20fe7eb4bef9814ec3e71 pristine_git_object: 6e926adfd638558b09fd149c4f77475a88758152 + src/gr4vy/api_key_pairs.py: + id: 3454227f6677 + last_write_checksum: sha1:320d6829bfb982ca2c6f5be889e9e19bafb4b01d + pristine_git_object: dfd00d5f60d3b314babf9ad9fc417e74b5c05e11 src/gr4vy/audit_logs.py: id: ee2e02291eab last_write_checksum: sha1:65ea950ba2db1e2b2ad5f08aabe45993769620cd @@ -2872,12 +2936,12 @@ trackedFiles: pristine_git_object: 76323f5cc11918d04b7ba4e7581ddbf3008db03d src/gr4vy/merchant_accounts_sdk.py: id: 6649e2875667 - last_write_checksum: sha1:4e4196e3b71e4e4dfea00bef4d93aa53f02c7d1c - pristine_git_object: a8fe4dbb14fe921bca872721f3f9ff22fcdc60a2 + last_write_checksum: sha1:04cdebf84f52ce9d4c582b3782f177e95bfc368a + pristine_git_object: 0fcd6d0309bcdd7e19d84994159a8a9a26593ef1 src/gr4vy/models/__init__.py: id: 427cc7fddfe2 - last_write_checksum: sha1:3b886059b379fc38d5c1597c17aecf8f1952bf7d - pristine_git_object: fe6d1a7c46b0023b714f51b27954f10bce127009 + last_write_checksum: sha1:61aef05d8c077e490d21ffe58cf06912ccd47c14 + pristine_git_object: 7b6811a6591bfa0ee050224cc5d83d48d818f3ee src/gr4vy/models/accountsreceivablesreportspec.py: id: cc6a9368f988 last_write_checksum: sha1:1ce9432ce7ae682a7fff1e0fe1ddc7f82dc937e7 @@ -2986,10 +3050,38 @@ trackedFiles: id: 87ef178e6e2a last_write_checksum: sha1:0005be541a8447aeed9b82fd8f256eaaaabf7a3d pristine_git_object: 780aee3eb459740d83b7ffef6c815a1785a3f0e0 + src/gr4vy/models/api_common_schemas_creator.py: + id: 08a27b22ede8 + last_write_checksum: sha1:00fb41118b519961ec9b48566aef3be128a90beb + pristine_git_object: 84cf0c105c15a1877c8980f4b4461342c8acdc47 + src/gr4vy/models/api_common_schemas_merchantaccount.py: + id: a7c8c0aa783b + last_write_checksum: sha1:a4a32116d2fafaff76c67d4f036a82965f3ea0a6 + pristine_git_object: 2f923e472ef810a29f22236df10e042e03f42355 + src/gr4vy/models/api_routers_api_key_pairs_schemas_creator.py: + id: 1712aa09bf67 + last_write_checksum: sha1:d28ea31b8b9a9557bd22d293c34623e13269f575 + pristine_git_object: 321b724d742ebc456eb15c4c1093594393a8eab4 + src/gr4vy/models/api_routers_merchant_accounts_schemas_merchantaccount.py: + id: cee1ee8030a9 + last_write_checksum: sha1:7dd0f2aee843a34539062b50d60e30660b081304 + pristine_git_object: 91c25edc40fb128e9d54c281fd4390b606e03d02 src/gr4vy/models/api_types_digitalwalletaddress.py: id: bf2c6d0514d5 last_write_checksum: sha1:5e67014d10fd1ddd6290fc3dffddb861d1d20ff2 pristine_git_object: e34603d9fb6759b0e361a71aee2acc033a7cd52e + src/gr4vy/models/apikeypair.py: + id: ee9aa74e9446 + last_write_checksum: sha1:c8cf45a1a8cc7e0005b80ebb09a4367d4ea665df + pristine_git_object: 1cfc1b641ea03b1e74c776ec7b902f97bd8d280c + src/gr4vy/models/apikeypaircreate.py: + id: 8f5617480068 + last_write_checksum: sha1:5bfbe402e206b63d834e4efd0fac343c60d6809e + pristine_git_object: 62d47dddde6a31ea24c249b6abe2e5a6cf5046a0 + src/gr4vy/models/apikeypairupdate.py: + id: 9bdd177aecb2 + last_write_checksum: sha1:43f8e4b68fe03fc5e3a45d85703c34d8df02e349 + pristine_git_object: b8253d8fc69d396d124e467cb2a803f1c952b122 src/gr4vy/models/applepaypaymentmethodcreate.py: id: 6f8d3c72e27c last_write_checksum: sha1:c3b1e761675a41a9dcb33c56b52624016104edee @@ -3122,6 +3214,10 @@ trackedFiles: id: 65243967d320 last_write_checksum: sha1:27ab3cebcc910030f6676200e95f944772a4182c pristine_git_object: 01c678ef8dd08a4c4cf7079a6ca8daa6d0606d3f + src/gr4vy/models/certificatealgorithm.py: + id: d15a00b63a00 + last_write_checksum: sha1:b3ea21499376033e77c05ec4f460fe7f946cfca1 + pristine_git_object: c5f5299bf315dac1f2efe22825d861c9a96958f1 src/gr4vy/models/chaseoptions.py: id: 871df09f4301 last_write_checksum: sha1:a27e46b79c2df3afa1f2354589c4aa54a66adf57 @@ -3170,6 +3266,10 @@ trackedFiles: id: ada8fe08bbd0 last_write_checksum: sha1:49a6cced955db7c80c9feaa3bf94786b7d5e6ed6 pristine_git_object: 2772e0589d8cfd763ad30098680d213f0db6b211 + src/gr4vy/models/collection_apikeypair_.py: + id: 5a429482a3c6 + last_write_checksum: sha1:3561ec711b599e0d373cb98b990d407d65b96a44 + pristine_git_object: 7ae8e807c246e2973242c917956607b1e10f23a7 src/gr4vy/models/complete_paze_mobile_sessionop.py: id: 77d97525df33 last_write_checksum: sha1:085fb62fd353fdbe536ebaa614def421bc316fb2 @@ -3270,10 +3370,6 @@ trackedFiles: id: 82ae6c1a0f7a last_write_checksum: sha1:87493bad971ab5f5758b697052517ed165aaaecc pristine_git_object: 9c8157b928450ba77dacb0b2ba4392c20e57ebe1 - src/gr4vy/models/creator.py: - id: 582fbc4eda60 - last_write_checksum: sha1:7394793b75a6deb5a3e3fb8c329e95730e61aeb4 - pristine_git_object: cd30074d2804a63c3684533f25f81f695b619ccc src/gr4vy/models/cryptogram.py: id: 33634e5b83f3 last_write_checksum: sha1:19e83dc1a15e6ec4e81e9728bfbf07af17f87ec6 @@ -3302,6 +3398,10 @@ trackedFiles: id: d6ee2adaf252 last_write_checksum: sha1:7b0aeb1c677f280ecb5b049c3ee4f46914fd8636 pristine_git_object: 9c5841840d88139b9f6abaaacf3d5425cf704764 + src/gr4vy/models/delete_api_key_pairop.py: + id: 10d8a8d26637 + last_write_checksum: sha1:6fe0072494689fe0fef196588e9fecb88dc86084 + pristine_git_object: 0b93864a63858d8047799e9347e923f922536283 src/gr4vy/models/delete_buyer_shipping_detailsop.py: id: 231a96d5c5cc last_write_checksum: sha1:847c59d142f24523de2406551e6242b6a469306e @@ -3494,6 +3594,10 @@ trackedFiles: id: 8a4266631182 last_write_checksum: sha1:4e4ae82973acea327c26a3c33ba5e80485a3a6d7 pristine_git_object: 1d406e24fceedf9c659199949ae19df6fb4f8617 + src/gr4vy/models/get_api_key_pairop.py: + id: 9f77693bff53 + last_write_checksum: sha1:a612758140fbed615558f93f33d82e83680ff361 + pristine_git_object: 51eae70a38e5de22feb8f876f897ab137342306f src/gr4vy/models/get_buyer_shipping_detailsop.py: id: 104a49b79415 last_write_checksum: sha1:7b6fd33ac13b38a5bff5803395fee0d789944af6 @@ -3690,6 +3794,10 @@ trackedFiles: id: 040d40b04f0b last_write_checksum: sha1:78258b6300da7e9d0f8dceab86ac7e59d908731a pristine_git_object: 5dd67232021188b8be2e1ee00db2635079b36fc4 + src/gr4vy/models/list_api_key_pairsop.py: + id: 9f6e6bb6eedd + last_write_checksum: sha1:3b71a0a78b5e6aef4d1b0c16f8353f0e07b5b9ab + pristine_git_object: b8ba338c011b737dd223504ecfe99aba5dbe7ee6 src/gr4vy/models/list_audit_logsop.py: id: b5643c3173b5 last_write_checksum: sha1:4e9c9191799f445ba46c3f77db0ac9c64a243cf7 @@ -3802,18 +3910,14 @@ trackedFiles: id: 0f2489008cf3 last_write_checksum: sha1:2bed39828e4b2185c316fcd5fa259dd373780918 pristine_git_object: c922f1f5a50906ea113c3667384904aadfa27c36 - src/gr4vy/models/merchantaccount.py: - id: add81dd64f62 - last_write_checksum: sha1:50e0f678185ce7745efe79103369c0d1712a0b5f - pristine_git_object: b0ce7bbcb803daeb6cb097defb848bb976cbde71 src/gr4vy/models/merchantaccountcreate.py: id: 0885475f0c84 last_write_checksum: sha1:9dee3016bb0acc31b8d45cfb64d0f2d919234a9e pristine_git_object: 1cc4f846cfe179668c1740d3bb2c491501943352 src/gr4vy/models/merchantaccounts.py: id: 54ec47424955 - last_write_checksum: sha1:87efe8a0e5e30ac3480b208da645c546c2b3c130 - pristine_git_object: 016691dc4fd1d186e38354b7bf826f47cb79220b + last_write_checksum: sha1:299e0a3957e40678ef59d15a52599a311f29518b + pristine_git_object: 6c8bc8b2e6bdad1b61eb1db9f1dccaeea57e64fc src/gr4vy/models/merchantaccountthreedsconfiguration.py: id: 80000774859e last_write_checksum: sha1:10ab4831da797b1d8209670c62837d7c0a1c9485 @@ -4182,6 +4286,10 @@ trackedFiles: id: 69ba1b8bdc62 last_write_checksum: sha1:fe325d81e48ad348fd2d8c43a4955fd7ad51d0f1 pristine_git_object: 32fd236b47aa4029b809f09cfba72a3175b760c9 + src/gr4vy/models/permissionset.py: + id: 666b191a5512 + last_write_checksum: sha1:225a6a6568ce7ce086d9f63961c77f68a1578dd5 + pristine_git_object: 8ff1b3bb0bdd70b01e5b518b5f40deeaa192549d src/gr4vy/models/plaidpaymentmethodcreate.py: id: 16d9f8af22ec last_write_checksum: sha1:747b39aefcec982bb9ef4c482d159fa71e15f0cd @@ -4204,8 +4312,8 @@ trackedFiles: pristine_git_object: 0f6c37ecb659dabfa3a94e68a4245888f0095708 src/gr4vy/models/refund.py: id: 8aa63978d78c - last_write_checksum: sha1:48210c9787846da7109f872e9604969ce5a79909 - pristine_git_object: c0bdf9acf22bd31664e3494476673283918350ce + last_write_checksum: sha1:06951fa36f5d267c4b2e1cf01a0fc1f57f1d2195 + pristine_git_object: 9653c977c038b542df20572acf1456931ffda183 src/gr4vy/models/refunds.py: id: a78ea31739c4 last_write_checksum: sha1:003e76598757f529d1e691ae605eb6fea2ad954b @@ -4306,6 +4414,10 @@ trackedFiles: id: 693e4d778015 last_write_checksum: sha1:17b6048ad77323824dbc1e4fa7fd059c09047a61 pristine_git_object: 34374602cff8b4ee3781f6602f0cf58c7d3a5d1d + src/gr4vy/models/role.py: + id: c68dc475ca1a + last_write_checksum: sha1:690cc937b1b17bd6d3ba8baa66eb2a4e8d1c9279 + pristine_git_object: 9ba1f357c948a246176ac2a22871a8ff83c15434 src/gr4vy/models/security.py: id: 5eea80acf07f last_write_checksum: sha1:cfc979ef662f1ebdf09acfa358e0670e0c24ee37 @@ -4558,6 +4670,10 @@ trackedFiles: id: 7c3d4329dcb9 last_write_checksum: sha1:1b02a1ace6263d6aea8b0f26e3b503b6a81cfd36 pristine_git_object: f31a718aeb323b6c8fb4e1c5dc52d18cda7cd268 + src/gr4vy/models/update_api_key_pairop.py: + id: f502d6c9abc3 + last_write_checksum: sha1:be21c29321de6169258f98bf1a0355ba7631646b + pristine_git_object: 43a048f5073132932246c2f57a17a7ede60c3884 src/gr4vy/models/update_buyer_shipping_detailsop.py: id: fa7e1a9bddef last_write_checksum: sha1:d4c100c0721445abfd8627623a1f2b3187555b3a @@ -4700,8 +4816,8 @@ trackedFiles: pristine_git_object: bc8980a7341eed86e62659760a541cf03b28b88d src/gr4vy/sdk.py: id: 924d48ddd6b1 - last_write_checksum: sha1:d24b8bbf33c2fd6d2ce929855be9d577b6e8a43f - pristine_git_object: e2822c6203dcc22cdef3fe6aba398200343b4894 + last_write_checksum: sha1:2b2e9cd3bdec5b466174abc5d98c397e7b7a9cf3 + pristine_git_object: 52088859f6677f500ce5af3d638db9b66f3962c2 src/gr4vy/sdkconfiguration.py: id: 12e6f5d93283 last_write_checksum: sha1:b3d04005a955111373b344e02ed4504bfbdd3106 @@ -8769,15 +8885,174 @@ 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"} + list_api_key_pairs: + speakeasy-default-list-api-key-pairs: + parameters: + query: + limit: 20 + responses: + "200": + application/json: {"items": [{"type": "api-key-pair", "id": "fe26475d-ec3e-4884-9553-f7356683f7f9", "thumbprint": "6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk", "display_name": "Production key", "algorithm": "RSA", "active": true, "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00"}], "limit": 20} + "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"} + create_api_key_pair: + speakeasy-default-create-api-key-pair: + requestBody: + application/json: {"display_name": "Production key", "active": true, "role_ids": ["8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"]} + responses: + "201": + application/json: {"type": "api-key-pair", "id": "fe26475d-ec3e-4884-9553-f7356683f7f9", "thumbprint": "6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk", "display_name": "Production key", "algorithm": "ECDSA", "active": true, "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00"} + "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"} + get_api_key_pair: + speakeasy-default-get-api-key-pair: + parameters: + path: + api_key_pair_id: "fe26475d-ec3e-4884-9553-f7356683f7f9" + responses: + "200": + application/json: {"type": "api-key-pair", "id": "fe26475d-ec3e-4884-9553-f7356683f7f9", "thumbprint": "6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk", "display_name": "Production key", "algorithm": "RSA", "active": true, "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00"} + "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"} + update_api_key_pair: + speakeasy-default-update-api-key-pair: + parameters: + path: + api_key_pair_id: "fe26475d-ec3e-4884-9553-f7356683f7f9" + requestBody: + application/json: {} + responses: + "200": + application/json: {"type": "api-key-pair", "id": "fe26475d-ec3e-4884-9553-f7356683f7f9", "thumbprint": "6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk", "display_name": "Production key", "algorithm": "RSA", "active": true, "created_at": "2013-07-16T19:23:00.000+00:00", "updated_at": "2013-07-16T19:23:00.000+00:00"} + "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_api_key_pair: + speakeasy-default-delete-api-key-pair: + parameters: + path: + api_key_pair_id: "fe26475d-ec3e-4884-9553-f7356683f7f9" + 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.refunds.list()`: `response.items[]` **Changed** - * `gr4vy.transactions.refunds.create()`: `response` **Changed** - * `gr4vy.transactions.refunds.get()`: `response` **Changed** - * `gr4vy.transactions.refunds.all.create()`: `response.items[]` **Changed** - * `gr4vy.refunds.get()`: `response` **Changed** + * `gr4vy.api_key_pairs.list()`: **Added** + * `gr4vy.api_key_pairs.create()`: **Added** + * `gr4vy.api_key_pairs.get()`: **Added** + * `gr4vy.api_key_pairs.update()`: **Added** + * `gr4vy.api_key_pairs.delete()`: **Added** generatedFiles: - .gitattributes - .vscode/settings.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index bf37304c..e867584f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -29,7 +29,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 2.2.2 + version: 2.2.3 additionalDependencies: dev: freezegun: ^1.5.1 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5c49c6d2..25975c7c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.787.0 +speakeasyVersion: 1.788.1 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:a1db8c15f417c9dc5589583862fe8ebe1dd66bac25d0d138177d0d8416bcd2b5 - sourceBlobDigest: sha256:10f8f9202d53e7ee403525a2e1cd8f77461e32b414a980c09fe9cf476d499d94 + sourceRevisionDigest: sha256:8856b1b133b50597c1f5a93ce9493ace33d0e1343d2f8049ecd88c7045a0b15a + sourceBlobDigest: sha256:71ac5ae6e07f91b23c3db57f4b4843b63b63caca63ee014e8cdb59ed3ead4d85 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: python: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:a1db8c15f417c9dc5589583862fe8ebe1dd66bac25d0d138177d0d8416bcd2b5 - sourceBlobDigest: sha256:10f8f9202d53e7ee403525a2e1cd8f77461e32b414a980c09fe9cf476d499d94 + sourceRevisionDigest: sha256:8856b1b133b50597c1f5a93ce9493ace33d0e1343d2f8049ecd88c7045a0b15a + sourceBlobDigest: sha256:71ac5ae6e07f91b23c3db57f4b4843b63b63caca63ee014e8cdb59ed3ead4d85 codeSamplesNamespace: openapi-python-code-samples - codeSamplesRevisionDigest: sha256:e4cf7e376b09084fcf10617af339bc2a13792efbce7e16a7c11ed962f2237c48 + codeSamplesRevisionDigest: sha256:811dc4d3950b253ea56784d90fae039065ebe328964b2e525cdd3bed59f18126 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 85d03063..3dff92f4 100644 --- a/README.md +++ b/README.md @@ -336,6 +336,14 @@ except ValueError as error: * [create](docs/sdks/jobs/README.md#create) - Create account updater job +### [ApiKeyPairs](docs/sdks/apikeypairs/README.md) + +* [list](docs/sdks/apikeypairs/README.md#list) - List all API key pairs +* [create](docs/sdks/apikeypairs/README.md#create) - Create an API key pair +* [get](docs/sdks/apikeypairs/README.md#get) - Get an API key pair +* [update](docs/sdks/apikeypairs/README.md#update) - Update an API key pair +* [delete](docs/sdks/apikeypairs/README.md#delete) - Delete an API key pair + ### [AuditLogs](docs/sdks/auditlogs/README.md) * [list](docs/sdks/auditlogs/README.md#list) - List audit log entries @@ -603,11 +611,10 @@ import os with Gr4vy( - merchant_account_id="default", bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), ) as g_client: - res = g_client.buyers.list(cursor="ZXhhbXBsZTE", limit=20, search="John", external_identifier="buyer-12345") + res = g_client.api_key_pairs.list(limit=20) while res is not None: # Handle items diff --git a/RELEASES.md b/RELEASES.md index 1b9f5747..821a5b9c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2158,4 +2158,14 @@ Based on: ### Generated - [python v2.2.2] . ### Releases -- [PyPI v2.2.2] https://pypi.org/project/gr4vy/2.2.2 - . \ No newline at end of file +- [PyPI v2.2.2] https://pypi.org/project/gr4vy/2.2.2 - . + +## 2026-07-06 08:37:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.788.1 (2.915.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.2.3] . +### Releases +- [PyPI v2.2.3] https://pypi.org/project/gr4vy/2.2.3 - . \ No newline at end of file diff --git a/docs/models/creator.md b/docs/models/apicommonschemascreator.md similarity index 94% rename from docs/models/creator.md rename to docs/models/apicommonschemascreator.md index 9f83efa7..c1f3d21b 100644 --- a/docs/models/creator.md +++ b/docs/models/apicommonschemascreator.md @@ -1,4 +1,4 @@ -# Creator +# APICommonSchemasCreator ## Fields diff --git a/docs/models/apicommonschemasmerchantaccount.md b/docs/models/apicommonschemasmerchantaccount.md new file mode 100644 index 00000000..a629dc87 --- /dev/null +++ b/docs/models/apicommonschemasmerchantaccount.md @@ -0,0 +1,14 @@ +# APICommonSchemasMerchantAccount + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Optional[Literal["merchant-account"]]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `display_name` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `over_capture_amount` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `over_capture_percentage` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/apikeypair.md b/docs/models/apikeypair.md new file mode 100644 index 00000000..8156c5ba --- /dev/null +++ b/docs/models/apikeypair.md @@ -0,0 +1,19 @@ +# APIKeyPair + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["api-key-pair"]]* | :heavy_minus_sign: | The type of this resource. | | +| `id` | *str* | :heavy_check_mark: | The ID for the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `thumbprint` | *str* | :heavy_check_mark: | The unique thumbprint that identifies the API key pair. | 6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk | +| `display_name` | *str* | :heavy_check_mark: | The display name for the API key pair. | Production key | +| `algorithm` | [models.CertificateAlgorithm](../models/certificatealgorithm.md) | :heavy_check_mark: | N/A | | +| `active` | *bool* | :heavy_check_mark: | Whether the API key pair is active and can be used to authenticate. | true | +| `private_key` | *OptionalNullable[str]* | :heavy_minus_sign: | The PEM-encoded private key. Only returned once, in the response to creating the API key pair, and only when Gr4vy generated the key pair. Store it securely, as it cannot be retrieved later. | | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date and time when this API key pair was created. | 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 API key pair was last updated. | 2013-07-16T19:23:00.000+00:00 | +| `creator` | [OptionalNullable[models.APIRoutersAPIKeyPairsSchemasCreator]](../models/apiroutersapikeypairsschemascreator.md) | :heavy_minus_sign: | The user or API key pair that created this API key pair. | | +| `merchant_accounts` | List[[models.APICommonSchemasMerchantAccount](../models/apicommonschemasmerchantaccount.md)] | :heavy_minus_sign: | The merchant accounts this API key pair has access to. An empty list means it has access to all merchant accounts. | | +| `roles` | List[[models.Role](../models/role.md)] | :heavy_minus_sign: | The roles assigned to this API key pair. | | \ No newline at end of file diff --git a/docs/models/apikeypaircreate.md b/docs/models/apikeypaircreate.md new file mode 100644 index 00000000..30ac672f --- /dev/null +++ b/docs/models/apikeypaircreate.md @@ -0,0 +1,13 @@ +# APIKeyPairCreate + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `display_name` | *str* | :heavy_check_mark: | The display name for the API key pair. | Production key | +| `algorithm` | [Optional[models.CertificateAlgorithm]](../models/certificatealgorithm.md) | :heavy_minus_sign: | N/A | | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether the API key pair should be active and usable once created. | true | +| `role_ids` | List[*str*] | :heavy_check_mark: | The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own. | [
"8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"
] | +| `merchant_account_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to. | [
"merchant-12345"
] | +| `public_key` | *OptionalNullable[str]* | :heavy_minus_sign: | A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key. | -----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB...
-----END PUBLIC KEY----- | \ No newline at end of file diff --git a/docs/models/apikeypairupdate.md b/docs/models/apikeypairupdate.md new file mode 100644 index 00000000..f2d30833 --- /dev/null +++ b/docs/models/apikeypairupdate.md @@ -0,0 +1,11 @@ +# APIKeyPairUpdate + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name for the API key pair. | Production key | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the API key pair is active and can be used to authenticate. | true | +| `role_ids` | List[*str*] | :heavy_minus_sign: | N/A | [
"8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"
] | +| `merchant_account_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to. | [
"merchant-12345"
] | \ No newline at end of file diff --git a/docs/models/apiroutersapikeypairsschemascreator.md b/docs/models/apiroutersapikeypairsschemascreator.md new file mode 100644 index 00000000..a535ede2 --- /dev/null +++ b/docs/models/apiroutersapikeypairsschemascreator.md @@ -0,0 +1,11 @@ +# APIRoutersAPIKeyPairsSchemasCreator + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the user or API key pair that created the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `name` | *str* | :heavy_check_mark: | The name of the user or API key pair that created the API key pair. | John Doe | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | The email address of the user that created the API key pair, when it was created by a dashboard user. | john.doe@example.com | +| `thumbprint` | *OptionalNullable[str]* | :heavy_minus_sign: | The thumbprint of the API key pair that created the API key pair, when it was created by another API key. | 6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk | \ No newline at end of file diff --git a/docs/models/merchantaccount.md b/docs/models/apiroutersmerchantaccountsschemasmerchantaccount.md similarity index 99% rename from docs/models/merchantaccount.md rename to docs/models/apiroutersmerchantaccountsschemasmerchantaccount.md index 1661265b..3a2cc6ee 100644 --- a/docs/models/merchantaccount.md +++ b/docs/models/apiroutersmerchantaccountsschemasmerchantaccount.md @@ -1,4 +1,4 @@ -# MerchantAccount +# APIRoutersMerchantAccountsSchemasMerchantAccount ## Fields diff --git a/docs/models/certificatealgorithm.md b/docs/models/certificatealgorithm.md new file mode 100644 index 00000000..05db3400 --- /dev/null +++ b/docs/models/certificatealgorithm.md @@ -0,0 +1,18 @@ +# CertificateAlgorithm + +## Example Usage + +```python +from gr4vy.models import CertificateAlgorithm + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CertificateAlgorithm = "ECDSA" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"ECDSA"` +- `"RSA"` diff --git a/docs/models/collectionapikeypair.md b/docs/models/collectionapikeypair.md new file mode 100644 index 00000000..0b8a033a --- /dev/null +++ b/docs/models/collectionapikeypair.md @@ -0,0 +1,11 @@ +# CollectionAPIKeyPair + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `items` | List[[models.APIKeyPair](../models/apikeypair.md)] | :heavy_check_mark: | A list of items returned for this request. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The number of items for this page. | 20 | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | +| `previous_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the previous page of items. | Xkjss7asS | \ No newline at end of file diff --git a/docs/models/deleteapikeypairrequest.md b/docs/models/deleteapikeypairrequest.md new file mode 100644 index 00000000..82dd653b --- /dev/null +++ b/docs/models/deleteapikeypairrequest.md @@ -0,0 +1,8 @@ +# DeleteAPIKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | \ No newline at end of file diff --git a/docs/models/getapikeypairrequest.md b/docs/models/getapikeypairrequest.md new file mode 100644 index 00000000..ec098d3a --- /dev/null +++ b/docs/models/getapikeypairrequest.md @@ -0,0 +1,8 @@ +# GetAPIKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | \ No newline at end of file diff --git a/docs/models/listapikeypairsrequest.md b/docs/models/listapikeypairsrequest.md new file mode 100644 index 00000000..f2ee392e --- /dev/null +++ b/docs/models/listapikeypairsrequest.md @@ -0,0 +1,9 @@ +# ListAPIKeyPairsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of items that are returned. | 20 | \ No newline at end of file diff --git a/docs/models/listapikeypairsresponse.md b/docs/models/listapikeypairsresponse.md new file mode 100644 index 00000000..3fa342ff --- /dev/null +++ b/docs/models/listapikeypairsresponse.md @@ -0,0 +1,8 @@ +# ListAPIKeyPairsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `result` | [models.CollectionAPIKeyPair](../models/collectionapikeypair.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/merchantaccounts.md b/docs/models/merchantaccounts.md index 6b1087e8..e0a2961b 100644 --- a/docs/models/merchantaccounts.md +++ b/docs/models/merchantaccounts.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `items` | List[[models.MerchantAccount](../models/merchantaccount.md)] | :heavy_check_mark: | A list of items returned for this request. | | -| `limit` | *Optional[int]* | :heavy_minus_sign: | The number of items for this page. | 20 | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | -| `previous_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the previous page of items. | Xkjss7asS | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `items` | List[[models.APIRoutersMerchantAccountsSchemasMerchantAccount](../models/apiroutersmerchantaccountsschemasmerchantaccount.md)] | :heavy_check_mark: | A list of items returned for this request. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The number of items for this page. | 20 | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | +| `previous_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor pointing at the previous page of items. | Xkjss7asS | \ No newline at end of file diff --git a/docs/models/permissionset.md b/docs/models/permissionset.md new file mode 100644 index 00000000..7cbcb43d --- /dev/null +++ b/docs/models/permissionset.md @@ -0,0 +1,8 @@ +# PermissionSet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `allow` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/refund.md b/docs/models/refund.md index 0d2df50e..fde301a8 100644 --- a/docs/models/refund.md +++ b/docs/models/refund.md @@ -21,7 +21,7 @@ | `transaction_external_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | An external identifier that can be used to match the transaction against your own records. | transaction-12345 | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date this refund was created at. | 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 this refund was last updated at. | 2013-07-16T19:23:00.000+00:00 | -| `creator` | [OptionalNullable[models.Creator]](../models/creator.md) | :heavy_minus_sign: | The user that created this resource | {
"email_address": "jhon.doe@gr4vy.com",
"id": "07e70d14-a0c0-4ff5-bd4a-509959af0e4d",
"name": "Jhon Doe"
} | +| `creator` | [OptionalNullable[models.APICommonSchemasCreator]](../models/apicommonschemascreator.md) | :heavy_minus_sign: | The user that created this resource | {
"email_address": "jhon.doe@gr4vy.com",
"id": "07e70d14-a0c0-4ff5-bd4a-509959af0e4d",
"name": "Jhon Doe"
} | | `error_code` | *OptionalNullable[str]* | :heavy_minus_sign: | The standardized error code set by Gr4vy. | service_error | | `raw_response_code` | *OptionalNullable[str]* | :heavy_minus_sign: | This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services. | E104 | | `raw_response_description` | *OptionalNullable[str]* | :heavy_minus_sign: | This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services. | Missing redirect URL | diff --git a/docs/models/role.md b/docs/models/role.md new file mode 100644 index 00000000..886eb092 --- /dev/null +++ b/docs/models/role.md @@ -0,0 +1,12 @@ +# Role + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Optional[Literal["role"]]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `permissions` | [models.PermissionSet](../models/permissionset.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateapikeypairrequest.md b/docs/models/updateapikeypairrequest.md new file mode 100644 index 00000000..f02a62f5 --- /dev/null +++ b/docs/models/updateapikeypairrequest.md @@ -0,0 +1,9 @@ +# UpdateAPIKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `api_key_pair_update` | [models.APIKeyPairUpdate](../models/apikeypairupdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdks/apikeypairs/README.md b/docs/sdks/apikeypairs/README.md new file mode 100644 index 00000000..89552dd5 --- /dev/null +++ b/docs/sdks/apikeypairs/README.md @@ -0,0 +1,280 @@ +# ApiKeyPairs + +## Overview + +### Available Operations + +* [list](#list) - List all API key pairs +* [create](#create) - Create an API key pair +* [get](#get) - Get an API key pair +* [update](#update) - Update an API key pair +* [delete](#delete) - Delete an API key pair + +## list + +List all API key pairs. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.api_key_pairs.list(limit=20) + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of items that are returned. | 20 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.ListAPIKeyPairsResponse](../../models/listapikeypairsresponse.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 | \*/\* | + +## create + +Create a new API key pair. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.api_key_pairs.create(display_name="Production key", role_ids=[ + "8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a", + ], active=True) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `display_name` | *str* | :heavy_check_mark: | The display name for the API key pair. | Production key | +| `role_ids` | List[*str*] | :heavy_check_mark: | The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own. | [
"8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"
] | +| `algorithm` | [Optional[models.CertificateAlgorithm]](../../models/certificatealgorithm.md) | :heavy_minus_sign: | N/A | | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether the API key pair should be active and usable once created. | true | +| `merchant_account_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to. | [
"merchant-12345"
] | +| `public_key` | *OptionalNullable[str]* | :heavy_minus_sign: | A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key. | -----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB...
-----END PUBLIC KEY----- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.APIKeyPair](../../models/apikeypair.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 | \*/\* | + +## get + +Fetches an API key pair by its ID. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.api_key_pairs.get(api_key_pair_id="fe26475d-ec3e-4884-9553-f7356683f7f9") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.APIKeyPair](../../models/apikeypair.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 + +Updates an API key pair. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + res = g_client.api_key_pairs.update(api_key_pair_id="fe26475d-ec3e-4884-9553-f7356683f7f9") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name for the API key pair. | Production key | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the API key pair is active and can be used to authenticate. | true | +| `role_ids` | List[*str*] | :heavy_minus_sign: | N/A | [
"8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"
] | +| `merchant_account_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to. | [
"merchant-12345"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.APIKeyPair](../../models/apikeypair.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 + +Permanently removes an API key pair. + +### Example Usage + + +```python +from gr4vy import Gr4vy +import os + + +with Gr4vy( + bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""), +) as g_client: + + g_client.api_key_pairs.delete(api_key_pair_id="fe26475d-ec3e-4884-9553-f7356683f7f9") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `api_key_pair_id` | *str* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `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/merchantaccountssdk/README.md b/docs/sdks/merchantaccountssdk/README.md index 9e993143..5a38ea66 100644 --- a/docs/sdks/merchantaccountssdk/README.md +++ b/docs/sdks/merchantaccountssdk/README.md @@ -117,7 +117,7 @@ with Gr4vy( ### Response -**[models.MerchantAccount](../../models/merchantaccount.md)** +**[models.APIRoutersMerchantAccountsSchemasMerchantAccount](../../models/apiroutersmerchantaccountsschemasmerchantaccount.md)** ### Errors @@ -169,7 +169,7 @@ with Gr4vy( ### Response -**[models.MerchantAccount](../../models/merchantaccount.md)** +**[models.APIRoutersMerchantAccountsSchemasMerchantAccount](../../models/apiroutersmerchantaccountsschemasmerchantaccount.md)** ### Errors @@ -241,7 +241,7 @@ with Gr4vy( ### Response -**[models.MerchantAccount](../../models/merchantaccount.md)** +**[models.APIRoutersMerchantAccountsSchemasMerchantAccount](../../models/apiroutersmerchantaccountsschemasmerchantaccount.md)** ### Errors diff --git a/pyproject.toml b/pyproject.toml index 3a531d74..f2adfd10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "gr4vy" -version = "2.2.2" +version = "2.2.3" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Gr4vy" },] readme = "README-PYPI.md" diff --git a/src/gr4vy/_version.py b/src/gr4vy/_version.py index 6a9146a5..7192251c 100644 --- a/src/gr4vy/_version.py +++ b/src/gr4vy/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "gr4vy" -__version__: str = "2.2.2" +__version__: str = "2.2.3" __openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 2.2.2 2.914.0 1.0.0 gr4vy" +__gen_version__: str = "2.915.1" +__user_agent__: str = "speakeasy-sdk/python 2.2.3 2.915.1 1.0.0 gr4vy" try: if __package__ is not None: diff --git a/src/gr4vy/api_key_pairs.py b/src/gr4vy/api_key_pairs.py new file mode 100644 index 00000000..dfd00d5f --- /dev/null +++ b/src/gr4vy/api_key_pairs.py @@ -0,0 +1,1416 @@ +"""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 jsonpath import JSONPath +from typing import Any, Dict, Iterable, List, Mapping, Optional, Union + + +class APIKeyPairs(BaseSDK): + def list( + self, + *, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListAPIKeyPairsResponse]: + r"""List all API key pairs + + List all API key pairs. + + :param cursor: A pointer to the page of results to return. + :param limit: The maximum number of items that are returned. + :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.ListAPIKeyPairsRequest( + cursor=cursor, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/api-key-pairs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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_api_key_pairs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Optional[models.ListAPIKeyPairsResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + next_cursor = JSONPath("$.next_cursor").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListAPIKeyPairsResponse( + result=unmarshal_json_response(models.CollectionAPIKeyPair, http_res), + next=next_func, + ) + 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, + *, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListAPIKeyPairsResponse]: + r"""List all API key pairs + + List all API key pairs. + + :param cursor: A pointer to the page of results to return. + :param limit: The maximum number of items that are returned. + :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.ListAPIKeyPairsRequest( + cursor=cursor, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/api-key-pairs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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_api_key_pairs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Optional[models.ListAPIKeyPairsResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + next_cursor = JSONPath("$.next_cursor").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListAPIKeyPairsResponse( + result=unmarshal_json_response(models.CollectionAPIKeyPair, http_res), + next=next_func, + ) + 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 create( + self, + *, + display_name: str, + role_ids: Iterable[str], + algorithm: Optional[models.CertificateAlgorithm] = None, + active: Optional[bool] = True, + merchant_account_ids: Optional[Iterable[str]] = None, + public_key: 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.APIKeyPair: + r"""Create an API key pair + + Create a new API key pair. + + :param display_name: The display name for the API key pair. + :param role_ids: The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own. + :param algorithm: + :param active: Whether the API key pair should be active and usable once created. + :param merchant_account_ids: The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to. + :param public_key: A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key. + :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.APIKeyPairCreate( + display_name=display_name, + algorithm=algorithm, + active=active, + role_ids=utils.unmarshal(role_ids, List[str]), + merchant_account_ids=utils.unmarshal( + merchant_account_ids, Optional[List[str]] + ), + public_key=public_key, + ) + + req = self._build_request( + method="POST", + path="/api-key-pairs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + 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, False, False, "json", models.APIKeyPairCreate + ), + 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_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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, + *, + display_name: str, + role_ids: Iterable[str], + algorithm: Optional[models.CertificateAlgorithm] = None, + active: Optional[bool] = True, + merchant_account_ids: Optional[Iterable[str]] = None, + public_key: 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.APIKeyPair: + r"""Create an API key pair + + Create a new API key pair. + + :param display_name: The display name for the API key pair. + :param role_ids: The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own. + :param algorithm: + :param active: Whether the API key pair should be active and usable once created. + :param merchant_account_ids: The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to. + :param public_key: A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key. + :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.APIKeyPairCreate( + display_name=display_name, + algorithm=algorithm, + active=active, + role_ids=utils.unmarshal(role_ids, List[str]), + merchant_account_ids=utils.unmarshal( + merchant_account_ids, Optional[List[str]] + ), + public_key=public_key, + ) + + req = self._build_request_async( + method="POST", + path="/api-key-pairs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + 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, False, False, "json", models.APIKeyPairCreate + ), + 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_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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 get( + self, + *, + api_key_pair_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.APIKeyPair: + r"""Get an API key pair + + Fetches an API key pair by its ID. + + :param api_key_pair_id: The ID of the API key pair. + :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.GetAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + ) + + req = self._build_request( + method="GET", + path="/api-key-pairs/{api_key_pair_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 + 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="get_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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 get_async( + self, + *, + api_key_pair_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.APIKeyPair: + r"""Get an API key pair + + Fetches an API key pair by its ID. + + :param api_key_pair_id: The ID of the API key pair. + :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.GetAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + ) + + req = self._build_request_async( + method="GET", + path="/api-key-pairs/{api_key_pair_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 + 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="get_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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, + *, + api_key_pair_id: str, + display_name: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + role_ids: OptionalNullable[Iterable[str]] = UNSET, + merchant_account_ids: OptionalNullable[Iterable[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.APIKeyPair: + r"""Update an API key pair + + Updates an API key pair. + + :param api_key_pair_id: The ID of the API key pair. + :param display_name: The display name for the API key pair. + :param active: Whether the API key pair is active and can be used to authenticate. + :param role_ids: + :param merchant_account_ids: The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to. + :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.UpdateAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + api_key_pair_update=models.APIKeyPairUpdate( + display_name=display_name, + active=active, + role_ids=utils.unmarshal(role_ids, OptionalNullable[List[str]]), + merchant_account_ids=utils.unmarshal( + merchant_account_ids, OptionalNullable[List[str]] + ), + ), + ) + + req = self._build_request( + method="PUT", + path="/api-key-pairs/{api_key_pair_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.api_key_pair_update, + False, + False, + "json", + models.APIKeyPairUpdate, + ), + 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="update_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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, + *, + api_key_pair_id: str, + display_name: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + role_ids: OptionalNullable[Iterable[str]] = UNSET, + merchant_account_ids: OptionalNullable[Iterable[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.APIKeyPair: + r"""Update an API key pair + + Updates an API key pair. + + :param api_key_pair_id: The ID of the API key pair. + :param display_name: The display name for the API key pair. + :param active: Whether the API key pair is active and can be used to authenticate. + :param role_ids: + :param merchant_account_ids: The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to. + :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.UpdateAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + api_key_pair_update=models.APIKeyPairUpdate( + display_name=display_name, + active=active, + role_ids=utils.unmarshal(role_ids, OptionalNullable[List[str]]), + merchant_account_ids=utils.unmarshal( + merchant_account_ids, OptionalNullable[List[str]] + ), + ), + ) + + req = self._build_request_async( + method="PUT", + path="/api-key-pairs/{api_key_pair_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.api_key_pair_update, + False, + False, + "json", + models.APIKeyPairUpdate, + ), + 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="update_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.APIKeyPair, 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, + *, + api_key_pair_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 an API key pair + + Permanently removes an API key pair. + + :param api_key_pair_id: The ID of the API key pair. + :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.DeleteAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + ) + + req = self._build_request( + method="DELETE", + path="/api-key-pairs/{api_key_pair_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_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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, + *, + api_key_pair_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 an API key pair + + Permanently removes an API key pair. + + :param api_key_pair_id: The ID of the API key pair. + :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.DeleteAPIKeyPairRequest( + api_key_pair_id=api_key_pair_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/api-key-pairs/{api_key_pair_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_api_key_pair", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["API key pairs"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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/merchant_accounts_sdk.py b/src/gr4vy/merchant_accounts_sdk.py index a8fe4dbb..0fcd6d03 100644 --- a/src/gr4vy/merchant_accounts_sdk.py +++ b/src/gr4vy/merchant_accounts_sdk.py @@ -373,7 +373,7 @@ def create( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Create a merchant account Create a new merchant account in an instance. @@ -487,7 +487,9 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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) @@ -563,7 +565,7 @@ async def create_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Create a merchant account Create a new merchant account in an instance. @@ -677,7 +679,9 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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) @@ -733,7 +737,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Get a merchant account Get info about a merchant account in an instance. @@ -806,7 +810,9 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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) @@ -862,7 +868,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Get a merchant account Get info about a merchant account in an instance. @@ -935,7 +941,9 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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) @@ -1011,7 +1019,7 @@ def update( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Update a merchant account Update info for a merchant account in an instance. @@ -1131,7 +1139,9 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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) @@ -1207,7 +1217,7 @@ async def update_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.MerchantAccount: + ) -> models.APIRoutersMerchantAccountsSchemasMerchantAccount: r"""Update a merchant account Update info for a merchant account in an instance. @@ -1327,7 +1337,9 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.MerchantAccount, http_res) + return unmarshal_json_response( + models.APIRoutersMerchantAccountsSchemasMerchantAccount, 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/models/__init__.py b/src/gr4vy/models/__init__.py index fe6d1a7c..7b6811a6 100644 --- a/src/gr4vy/models/__init__.py +++ b/src/gr4vy/models/__init__.py @@ -80,10 +80,29 @@ from .airlineleg import AirlineLeg, AirlineLegTypedDict, RouteType from .airlinepassenger import AgeGroup, AirlinePassenger, AirlinePassengerTypedDict from .antifrauddecision import AntiFraudDecision + from .api_common_schemas_creator import ( + APICommonSchemasCreator, + APICommonSchemasCreatorTypedDict, + ) + from .api_common_schemas_merchantaccount import ( + APICommonSchemasMerchantAccount, + APICommonSchemasMerchantAccountTypedDict, + ) + from .api_routers_api_key_pairs_schemas_creator import ( + APIRoutersAPIKeyPairsSchemasCreator, + APIRoutersAPIKeyPairsSchemasCreatorTypedDict, + ) + from .api_routers_merchant_accounts_schemas_merchantaccount import ( + APIRoutersMerchantAccountsSchemasMerchantAccount, + APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict, + ) from .api_types_digitalwalletaddress import ( APITypesDigitalWalletAddress, APITypesDigitalWalletAddressTypedDict, ) + from .apikeypair import APIKeyPair, APIKeyPairTypedDict + from .apikeypaircreate import APIKeyPairCreate, APIKeyPairCreateTypedDict + from .apikeypairupdate import APIKeyPairUpdate, APIKeyPairUpdateTypedDict from .applepaypaymentmethodcreate import ( ApplePayPaymentMethodCreate, ApplePayPaymentMethodCreateTypedDict, @@ -160,6 +179,7 @@ CardWithURLPaymentMethodCreateTypedDict, ) from .cartitem import CartItem, CartItemTypedDict + from .certificatealgorithm import CertificateAlgorithm from .chaseoptions import ChaseOptions, ChaseOptionsTypedDict from .checkoutpayoutoptions import ( CheckoutPayoutOptions, @@ -199,6 +219,10 @@ ClickToPaySessionRequest, ClickToPaySessionRequestTypedDict, ) + from .collection_apikeypair_ import ( + CollectionAPIKeyPair, + CollectionAPIKeyPairTypedDict, + ) from .complete_paze_mobile_sessionop import ( CompletePazeMobileSessionGlobals, CompletePazeMobileSessionGlobalsTypedDict, @@ -339,7 +363,6 @@ ) from .createsession import CreateSession, CreateSessionTypedDict from .createsessionstatus import CreateSessionStatus - from .creator import Creator, CreatorTypedDict from .cryptogram import Cryptogram, CryptogramTypedDict from .cryptogramcreate import CryptogramCreate, CryptogramCreateTypedDict from .cvvresponsecode import CVVResponseCode @@ -350,6 +373,10 @@ from .cybersourceoptions import CybersourceOptions, CybersourceOptionsTypedDict from .definitionfield import DefinitionField, DefinitionFieldTypedDict from .definitionfieldformat import DefinitionFieldFormat + from .delete_api_key_pairop import ( + DeleteAPIKeyPairRequest, + DeleteAPIKeyPairRequestTypedDict, + ) from .delete_buyer_shipping_detailsop import ( DeleteBuyerShippingDetailsGlobals, DeleteBuyerShippingDetailsGlobalsTypedDict, @@ -519,6 +546,7 @@ ForterAntiFraudOptionsDiscountCouponDiscountAmount, ForterAntiFraudOptionsDiscountCouponDiscountAmountTypedDict, ) + from .get_api_key_pairop import GetAPIKeyPairRequest, GetAPIKeyPairRequestTypedDict from .get_buyer_shipping_detailsop import ( GetBuyerShippingDetailsGlobals, GetBuyerShippingDetailsGlobalsTypedDict, @@ -701,6 +729,12 @@ ListAllReportExecutionsResponse, ListAllReportExecutionsResponseTypedDict, ) + from .list_api_key_pairsop import ( + ListAPIKeyPairsRequest, + ListAPIKeyPairsRequestTypedDict, + ListAPIKeyPairsResponse, + ListAPIKeyPairsResponseTypedDict, + ) from .list_audit_logsop import ( ListAuditLogsGlobals, ListAuditLogsGlobalsTypedDict, @@ -888,7 +922,6 @@ ListTransactionsResponseTypedDict, ) from .mattildatapioptions import MattildaTapiOptions, MattildaTapiOptionsTypedDict - from .merchantaccount import MerchantAccount, MerchantAccountTypedDict from .merchantaccountcreate import ( MerchantAccountCreate, MerchantAccountCreateTypedDict, @@ -1145,6 +1178,7 @@ ) from .pazetraveldata import PazeTravelData, PazeTravelDataTypedDict from .pazewebsession import PazeWebSession, PazeWebSessionTypedDict + from .permissionset import PermissionSet, PermissionSetTypedDict from .plaidpaymentmethodcreate import ( PlaidPaymentMethodCreate, PlaidPaymentMethodCreateTypedDict, @@ -1217,6 +1251,7 @@ RiskifiedAntiFraudOptionsLineItem, RiskifiedAntiFraudOptionsLineItemTypedDict, ) + from .role import Role, RoleTypedDict from .security import Security, SecurityTypedDict from .sepabankpaymentmethodcreate import ( SEPABankPaymentMethodCreate, @@ -1377,6 +1412,10 @@ UnregisterDigitalWalletDomainRequest, UnregisterDigitalWalletDomainRequestTypedDict, ) + from .update_api_key_pairop import ( + UpdateAPIKeyPairRequest, + UpdateAPIKeyPairRequestTypedDict, + ) from .update_buyer_shipping_detailsop import ( UpdateBuyerShippingDetailsGlobals, UpdateBuyerShippingDetailsGlobalsTypedDict, @@ -1483,6 +1522,20 @@ "ACHBankPaymentMethodCreateTypedDict", "AIInsightsReportSpec", "AIInsightsReportSpecTypedDict", + "APICommonSchemasCreator", + "APICommonSchemasCreatorTypedDict", + "APICommonSchemasMerchantAccount", + "APICommonSchemasMerchantAccountTypedDict", + "APIKeyPair", + "APIKeyPairCreate", + "APIKeyPairCreateTypedDict", + "APIKeyPairTypedDict", + "APIKeyPairUpdate", + "APIKeyPairUpdateTypedDict", + "APIRoutersAPIKeyPairsSchemasCreator", + "APIRoutersAPIKeyPairsSchemasCreatorTypedDict", + "APIRoutersMerchantAccountsSchemasMerchantAccount", + "APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict", "APITypesDigitalWalletAddress", "APITypesDigitalWalletAddressTypedDict", "AVSResponseCode", @@ -1611,6 +1664,7 @@ "CardWithURLPaymentMethodCreateTypedDict", "CartItem", "CartItemTypedDict", + "CertificateAlgorithm", "ChaseOptions", "ChaseOptionsTypedDict", "CheckoutPayoutOptions", @@ -1635,6 +1689,8 @@ "ClickToPaySessionRequest", "ClickToPaySessionRequestTypedDict", "ClickToPaySessionTypedDict", + "CollectionAPIKeyPair", + "CollectionAPIKeyPairTypedDict", "CompletePazeMobileSessionGlobals", "CompletePazeMobileSessionGlobalsTypedDict", "CompletePazeMobileSessionRequest", @@ -1728,8 +1784,6 @@ "CreateTransactionRefundRequestTypedDict", "CreateTransactionRequest", "CreateTransactionRequestTypedDict", - "Creator", - "CreatorTypedDict", "Cryptogram", "CryptogramCreate", "CryptogramCreateTypedDict", @@ -1741,6 +1795,8 @@ "DefinitionField", "DefinitionFieldFormat", "DefinitionFieldTypedDict", + "DeleteAPIKeyPairRequest", + "DeleteAPIKeyPairRequestTypedDict", "DeleteBuyerGlobals", "DeleteBuyerGlobalsTypedDict", "DeleteBuyerRequest", @@ -1861,6 +1917,8 @@ "ForterAntiFraudOptionsDiscountTypedDict", "ForterAntiFraudOptionsTypedDict", "Frequency", + "GetAPIKeyPairRequest", + "GetAPIKeyPairRequestTypedDict", "GetBuyerGlobals", "GetBuyerGlobalsTypedDict", "GetBuyerRequest", @@ -1989,6 +2047,10 @@ "ItemTypedDict", "LatitudeOptions", "LatitudeOptionsTypedDict", + "ListAPIKeyPairsRequest", + "ListAPIKeyPairsRequestTypedDict", + "ListAPIKeyPairsResponse", + "ListAPIKeyPairsResponseTypedDict", "ListAllReportExecutionsGlobals", "ListAllReportExecutionsGlobalsTypedDict", "ListAllReportExecutionsRequest", @@ -2131,7 +2193,6 @@ "LocTypedDict", "MattildaTapiOptions", "MattildaTapiOptionsTypedDict", - "MerchantAccount", "MerchantAccountCreate", "MerchantAccountCreateTypedDict", "MerchantAccountThreeDSConfiguration", @@ -2142,7 +2203,6 @@ "MerchantAccountThreeDSConfigurationUpdateTypedDict", "MerchantAccountThreeDSConfigurations", "MerchantAccountThreeDSConfigurationsTypedDict", - "MerchantAccountTypedDict", "MerchantAccountUpdate", "MerchantAccountUpdateTypedDict", "MerchantAccounts", @@ -2325,6 +2385,8 @@ "PazeTravelDataTypedDict", "PazeWebSession", "PazeWebSessionTypedDict", + "PermissionSet", + "PermissionSetTypedDict", "PlaidPaymentMethodCreate", "PlaidPaymentMethodCreateTypedDict", "PowertranzOptions", @@ -2401,6 +2463,8 @@ "RiskifiedAntiFraudOptionsLineItem", "RiskifiedAntiFraudOptionsLineItemTypedDict", "RiskifiedAntiFraudOptionsTypedDict", + "Role", + "RoleTypedDict", "RouteType", "SEPABankPaymentMethodCreate", "SEPABankPaymentMethodCreateTypedDict", @@ -2541,6 +2605,8 @@ "UnregisterDigitalWalletDomainGlobalsTypedDict", "UnregisterDigitalWalletDomainRequest", "UnregisterDigitalWalletDomainRequestTypedDict", + "UpdateAPIKeyPairRequest", + "UpdateAPIKeyPairRequestTypedDict", "UpdateBuyerGlobals", "UpdateBuyerGlobalsTypedDict", "UpdateBuyerRequest", @@ -2673,8 +2739,22 @@ "AirlinePassenger": ".airlinepassenger", "AirlinePassengerTypedDict": ".airlinepassenger", "AntiFraudDecision": ".antifrauddecision", + "APICommonSchemasCreator": ".api_common_schemas_creator", + "APICommonSchemasCreatorTypedDict": ".api_common_schemas_creator", + "APICommonSchemasMerchantAccount": ".api_common_schemas_merchantaccount", + "APICommonSchemasMerchantAccountTypedDict": ".api_common_schemas_merchantaccount", + "APIRoutersAPIKeyPairsSchemasCreator": ".api_routers_api_key_pairs_schemas_creator", + "APIRoutersAPIKeyPairsSchemasCreatorTypedDict": ".api_routers_api_key_pairs_schemas_creator", + "APIRoutersMerchantAccountsSchemasMerchantAccount": ".api_routers_merchant_accounts_schemas_merchantaccount", + "APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict": ".api_routers_merchant_accounts_schemas_merchantaccount", "APITypesDigitalWalletAddress": ".api_types_digitalwalletaddress", "APITypesDigitalWalletAddressTypedDict": ".api_types_digitalwalletaddress", + "APIKeyPair": ".apikeypair", + "APIKeyPairTypedDict": ".apikeypair", + "APIKeyPairCreate": ".apikeypaircreate", + "APIKeyPairCreateTypedDict": ".apikeypaircreate", + "APIKeyPairUpdate": ".apikeypairupdate", + "APIKeyPairUpdateTypedDict": ".apikeypairupdate", "ApplePayPaymentMethodCreate": ".applepaypaymentmethodcreate", "ApplePayPaymentMethodCreateTypedDict": ".applepaypaymentmethodcreate", "ApplePaySessionRequest": ".applepaysessionrequest", @@ -2742,6 +2822,7 @@ "CardWithURLPaymentMethodCreateTypedDict": ".cardwithurlpaymentmethodcreate", "CartItem": ".cartitem", "CartItemTypedDict": ".cartitem", + "CertificateAlgorithm": ".certificatealgorithm", "ChaseOptions": ".chaseoptions", "ChaseOptionsTypedDict": ".chaseoptions", "CheckoutPayoutOptions": ".checkoutpayoutoptions", @@ -2766,6 +2847,8 @@ "ClickToPaySessionTypedDict": ".clicktopaysession", "ClickToPaySessionRequest": ".clicktopaysessionrequest", "ClickToPaySessionRequestTypedDict": ".clicktopaysessionrequest", + "CollectionAPIKeyPair": ".collection_apikeypair_", + "CollectionAPIKeyPairTypedDict": ".collection_apikeypair_", "CompletePazeMobileSessionGlobals": ".complete_paze_mobile_sessionop", "CompletePazeMobileSessionGlobalsTypedDict": ".complete_paze_mobile_sessionop", "CompletePazeMobileSessionRequest": ".complete_paze_mobile_sessionop", @@ -2861,8 +2944,6 @@ "CreateSession": ".createsession", "CreateSessionTypedDict": ".createsession", "CreateSessionStatus": ".createsessionstatus", - "Creator": ".creator", - "CreatorTypedDict": ".creator", "Cryptogram": ".cryptogram", "CryptogramTypedDict": ".cryptogram", "CryptogramCreate": ".cryptogramcreate", @@ -2875,6 +2956,8 @@ "DefinitionField": ".definitionfield", "DefinitionFieldTypedDict": ".definitionfield", "DefinitionFieldFormat": ".definitionfieldformat", + "DeleteAPIKeyPairRequest": ".delete_api_key_pairop", + "DeleteAPIKeyPairRequestTypedDict": ".delete_api_key_pairop", "DeleteBuyerShippingDetailsGlobals": ".delete_buyer_shipping_detailsop", "DeleteBuyerShippingDetailsGlobalsTypedDict": ".delete_buyer_shipping_detailsop", "DeleteBuyerShippingDetailsRequest": ".delete_buyer_shipping_detailsop", @@ -2995,6 +3078,8 @@ "ForterAntiFraudOptionsDiscountTypedDict": ".forterantifraudoptionsdiscount", "ForterAntiFraudOptionsDiscountCouponDiscountAmount": ".forterantifraudoptionsdiscountcoupondiscountamount", "ForterAntiFraudOptionsDiscountCouponDiscountAmountTypedDict": ".forterantifraudoptionsdiscountcoupondiscountamount", + "GetAPIKeyPairRequest": ".get_api_key_pairop", + "GetAPIKeyPairRequestTypedDict": ".get_api_key_pairop", "GetBuyerShippingDetailsGlobals": ".get_buyer_shipping_detailsop", "GetBuyerShippingDetailsGlobalsTypedDict": ".get_buyer_shipping_detailsop", "GetBuyerShippingDetailsRequest": ".get_buyer_shipping_detailsop", @@ -3129,6 +3214,10 @@ "ListAllReportExecutionsRequestTypedDict": ".list_all_report_executionsop", "ListAllReportExecutionsResponse": ".list_all_report_executionsop", "ListAllReportExecutionsResponseTypedDict": ".list_all_report_executionsop", + "ListAPIKeyPairsRequest": ".list_api_key_pairsop", + "ListAPIKeyPairsRequestTypedDict": ".list_api_key_pairsop", + "ListAPIKeyPairsResponse": ".list_api_key_pairsop", + "ListAPIKeyPairsResponseTypedDict": ".list_api_key_pairsop", "ListAuditLogsGlobals": ".list_audit_logsop", "ListAuditLogsGlobalsTypedDict": ".list_audit_logsop", "ListAuditLogsRequest": ".list_audit_logsop", @@ -3263,8 +3352,6 @@ "ListTransactionsResponseTypedDict": ".list_transactionsop", "MattildaTapiOptions": ".mattildatapioptions", "MattildaTapiOptionsTypedDict": ".mattildatapioptions", - "MerchantAccount": ".merchantaccount", - "MerchantAccountTypedDict": ".merchantaccount", "MerchantAccountCreate": ".merchantaccountcreate", "MerchantAccountCreateTypedDict": ".merchantaccountcreate", "MerchantAccounts": ".merchantaccounts", @@ -3469,6 +3556,8 @@ "PazeTravelDataTypedDict": ".pazetraveldata", "PazeWebSession": ".pazewebsession", "PazeWebSessionTypedDict": ".pazewebsession", + "PermissionSet": ".permissionset", + "PermissionSetTypedDict": ".permissionset", "PlaidPaymentMethodCreate": ".plaidpaymentmethodcreate", "PlaidPaymentMethodCreateTypedDict": ".plaidpaymentmethodcreate", "PowertranzOptions": ".powertranzoptions", @@ -3534,6 +3623,8 @@ "DeliveredTo": ".riskifiedantifraudoptionslineitem", "RiskifiedAntiFraudOptionsLineItem": ".riskifiedantifraudoptionslineitem", "RiskifiedAntiFraudOptionsLineItemTypedDict": ".riskifiedantifraudoptionslineitem", + "Role": ".role", + "RoleTypedDict": ".role", "Security": ".security", "SecurityTypedDict": ".security", "SEPABankPaymentMethodCreate": ".sepabankpaymentmethodcreate", @@ -3670,6 +3761,8 @@ "UnregisterDigitalWalletDomainGlobalsTypedDict": ".unregister_digital_wallet_domainop", "UnregisterDigitalWalletDomainRequest": ".unregister_digital_wallet_domainop", "UnregisterDigitalWalletDomainRequestTypedDict": ".unregister_digital_wallet_domainop", + "UpdateAPIKeyPairRequest": ".update_api_key_pairop", + "UpdateAPIKeyPairRequestTypedDict": ".update_api_key_pairop", "UpdateBuyerShippingDetailsGlobals": ".update_buyer_shipping_detailsop", "UpdateBuyerShippingDetailsGlobalsTypedDict": ".update_buyer_shipping_detailsop", "UpdateBuyerShippingDetailsRequest": ".update_buyer_shipping_detailsop", diff --git a/src/gr4vy/models/creator.py b/src/gr4vy/models/api_common_schemas_creator.py similarity index 75% rename from src/gr4vy/models/creator.py rename to src/gr4vy/models/api_common_schemas_creator.py index cd30074d..84cf0c10 100644 --- a/src/gr4vy/models/creator.py +++ b/src/gr4vy/models/api_common_schemas_creator.py @@ -5,13 +5,13 @@ from typing_extensions import TypedDict -class CreatorTypedDict(TypedDict): +class APICommonSchemasCreatorTypedDict(TypedDict): id: str name: str email_address: str -class Creator(BaseModel): +class APICommonSchemasCreator(BaseModel): id: str name: str diff --git a/src/gr4vy/models/api_common_schemas_merchantaccount.py b/src/gr4vy/models/api_common_schemas_merchantaccount.py new file mode 100644 index 00000000..2f923e47 --- /dev/null +++ b/src/gr4vy/models/api_common_schemas_merchantaccount.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from gr4vy.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class APICommonSchemasMerchantAccountTypedDict(TypedDict): + id: str + display_name: str + created_at: datetime + updated_at: datetime + type: Literal["merchant-account"] + over_capture_amount: NotRequired[Nullable[int]] + over_capture_percentage: NotRequired[Nullable[int]] + + +class APICommonSchemasMerchantAccount(BaseModel): + id: str + + display_name: str + + created_at: datetime + + updated_at: datetime + + TYPE: Annotated[ + Annotated[ + Optional[Literal["merchant-account"]], + AfterValidator(validate_const("merchant-account")), + ], + pydantic.Field(alias="type"), + ] = "merchant-account" + + over_capture_amount: OptionalNullable[int] = UNSET + + over_capture_percentage: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["type", "over_capture_amount", "over_capture_percentage"] + ) + nullable_fields = set(["over_capture_amount", "over_capture_percentage"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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 + + +try: + APICommonSchemasMerchantAccount.model_rebuild() +except NameError: + pass diff --git a/src/gr4vy/models/api_routers_api_key_pairs_schemas_creator.py b/src/gr4vy/models/api_routers_api_key_pairs_schemas_creator.py new file mode 100644 index 00000000..321b724d --- /dev/null +++ b/src/gr4vy/models/api_routers_api_key_pairs_schemas_creator.py @@ -0,0 +1,56 @@ +"""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 pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class APIRoutersAPIKeyPairsSchemasCreatorTypedDict(TypedDict): + id: str + r"""The ID of the user or API key pair that created the API key pair.""" + name: str + r"""The name of the user or API key pair that created the API key pair.""" + email_address: NotRequired[Nullable[str]] + r"""The email address of the user that created the API key pair, when it was created by a dashboard user.""" + thumbprint: NotRequired[Nullable[str]] + r"""The thumbprint of the API key pair that created the API key pair, when it was created by another API key.""" + + +class APIRoutersAPIKeyPairsSchemasCreator(BaseModel): + id: str + r"""The ID of the user or API key pair that created the API key pair.""" + + name: str + r"""The name of the user or API key pair that created the API key pair.""" + + email_address: OptionalNullable[str] = UNSET + r"""The email address of the user that created the API key pair, when it was created by a dashboard user.""" + + thumbprint: OptionalNullable[str] = UNSET + r"""The thumbprint of the API key pair that created the API key pair, when it was created by another API key.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["email_address", "thumbprint"]) + nullable_fields = set(["email_address", "thumbprint"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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/merchantaccount.py b/src/gr4vy/models/api_routers_merchant_accounts_schemas_merchantaccount.py similarity index 98% rename from src/gr4vy/models/merchantaccount.py rename to src/gr4vy/models/api_routers_merchant_accounts_schemas_merchantaccount.py index b0ce7bbc..91c25edc 100644 --- a/src/gr4vy/models/merchantaccount.py +++ b/src/gr4vy/models/api_routers_merchant_accounts_schemas_merchantaccount.py @@ -12,7 +12,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict -class MerchantAccountTypedDict(TypedDict): +class APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict(TypedDict): id: str r"""The ID for the merchant account.""" display_name: str @@ -63,7 +63,7 @@ class MerchantAccountTypedDict(TypedDict): r"""When enabled network tokens will be generated asynchronously and only used on subsequent transactions to speed up transaction processing.""" -class MerchantAccount(BaseModel): +class APIRoutersMerchantAccountsSchemasMerchantAccount(BaseModel): id: str r"""The ID for the merchant account.""" @@ -211,6 +211,6 @@ def serialize_model(self, handler): try: - MerchantAccount.model_rebuild() + APIRoutersMerchantAccountsSchemasMerchantAccount.model_rebuild() except NameError: pass diff --git a/src/gr4vy/models/apikeypair.py b/src/gr4vy/models/apikeypair.py new file mode 100644 index 00000000..1cfc1b64 --- /dev/null +++ b/src/gr4vy/models/apikeypair.py @@ -0,0 +1,123 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .api_common_schemas_merchantaccount import ( + APICommonSchemasMerchantAccount, + APICommonSchemasMerchantAccountTypedDict, +) +from .api_routers_api_key_pairs_schemas_creator import ( + APIRoutersAPIKeyPairsSchemasCreator, + APIRoutersAPIKeyPairsSchemasCreatorTypedDict, +) +from .certificatealgorithm import CertificateAlgorithm +from .role import Role, RoleTypedDict +from datetime import datetime +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from gr4vy.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class APIKeyPairTypedDict(TypedDict): + id: str + r"""The ID for the API key pair.""" + thumbprint: str + r"""The unique thumbprint that identifies the API key pair.""" + display_name: str + r"""The display name for the API key pair.""" + algorithm: CertificateAlgorithm + active: bool + r"""Whether the API key pair is active and can be used to authenticate.""" + created_at: datetime + r"""The date and time when this API key pair was created.""" + updated_at: datetime + r"""The date and time when this API key pair was last updated.""" + type: Literal["api-key-pair"] + r"""The type of this resource.""" + private_key: NotRequired[Nullable[str]] + r"""The PEM-encoded private key. Only returned once, in the response to creating the API key pair, and only when Gr4vy generated the key pair. Store it securely, as it cannot be retrieved later.""" + creator: NotRequired[Nullable[APIRoutersAPIKeyPairsSchemasCreatorTypedDict]] + r"""The user or API key pair that created this API key pair.""" + merchant_accounts: NotRequired[List[APICommonSchemasMerchantAccountTypedDict]] + r"""The merchant accounts this API key pair has access to. An empty list means it has access to all merchant accounts.""" + roles: NotRequired[List[RoleTypedDict]] + r"""The roles assigned to this API key pair.""" + + +class APIKeyPair(BaseModel): + id: str + r"""The ID for the API key pair.""" + + thumbprint: str + r"""The unique thumbprint that identifies the API key pair.""" + + display_name: str + r"""The display name for the API key pair.""" + + algorithm: CertificateAlgorithm + + active: bool + r"""Whether the API key pair is active and can be used to authenticate.""" + + created_at: datetime + r"""The date and time when this API key pair was created.""" + + updated_at: datetime + r"""The date and time when this API key pair was last updated.""" + + TYPE: Annotated[ + Annotated[ + Optional[Literal["api-key-pair"]], + AfterValidator(validate_const("api-key-pair")), + ], + pydantic.Field(alias="type"), + ] = "api-key-pair" + r"""The type of this resource.""" + + private_key: OptionalNullable[str] = UNSET + r"""The PEM-encoded private key. Only returned once, in the response to creating the API key pair, and only when Gr4vy generated the key pair. Store it securely, as it cannot be retrieved later.""" + + creator: OptionalNullable[APIRoutersAPIKeyPairsSchemasCreator] = UNSET + r"""The user or API key pair that created this API key pair.""" + + merchant_accounts: Optional[List[APICommonSchemasMerchantAccount]] = None + r"""The merchant accounts this API key pair has access to. An empty list means it has access to all merchant accounts.""" + + roles: Optional[List[Role]] = None + r"""The roles assigned to this API key pair.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["type", "private_key", "creator", "merchant_accounts", "roles"] + ) + nullable_fields = set(["private_key", "creator"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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 + + +try: + APIKeyPair.model_rebuild() +except NameError: + pass diff --git a/src/gr4vy/models/apikeypaircreate.py b/src/gr4vy/models/apikeypaircreate.py new file mode 100644 index 00000000..62d47ddd --- /dev/null +++ b/src/gr4vy/models/apikeypaircreate.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .certificatealgorithm import CertificateAlgorithm +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class APIKeyPairCreateTypedDict(TypedDict): + display_name: str + r"""The display name for the API key pair.""" + role_ids: List[str] + r"""The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own.""" + algorithm: NotRequired[CertificateAlgorithm] + active: NotRequired[bool] + r"""Whether the API key pair should be active and usable once created.""" + merchant_account_ids: NotRequired[List[str]] + r"""The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to.""" + public_key: NotRequired[Nullable[str]] + r"""A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key.""" + + +class APIKeyPairCreate(BaseModel): + display_name: str + r"""The display name for the API key pair.""" + + role_ids: List[str] + r"""The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own.""" + + algorithm: Optional[CertificateAlgorithm] = None + + active: Optional[bool] = True + r"""Whether the API key pair should be active and usable once created.""" + + merchant_account_ids: Optional[List[str]] = None + r"""The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to.""" + + public_key: OptionalNullable[str] = UNSET + r"""A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["algorithm", "active", "merchant_account_ids", "public_key"] + ) + nullable_fields = set(["public_key"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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/apikeypairupdate.py b/src/gr4vy/models/apikeypairupdate.py new file mode 100644 index 00000000..b8253d8f --- /dev/null +++ b/src/gr4vy/models/apikeypairupdate.py @@ -0,0 +1,59 @@ +"""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 pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class APIKeyPairUpdateTypedDict(TypedDict): + display_name: NotRequired[Nullable[str]] + r"""The display name for the API key pair.""" + active: NotRequired[Nullable[bool]] + r"""Whether the API key pair is active and can be used to authenticate.""" + role_ids: NotRequired[Nullable[List[str]]] + merchant_account_ids: NotRequired[Nullable[List[str]]] + r"""The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to.""" + + +class APIKeyPairUpdate(BaseModel): + display_name: OptionalNullable[str] = UNSET + r"""The display name for the API key pair.""" + + active: OptionalNullable[bool] = UNSET + r"""Whether the API key pair is active and can be used to authenticate.""" + + role_ids: OptionalNullable[List[str]] = UNSET + + merchant_account_ids: OptionalNullable[List[str]] = UNSET + r"""The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["display_name", "active", "role_ids", "merchant_account_ids"] + ) + nullable_fields = set( + ["display_name", "active", "role_ids", "merchant_account_ids"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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/certificatealgorithm.py b/src/gr4vy/models/certificatealgorithm.py new file mode 100644 index 00000000..c5f5299b --- /dev/null +++ b/src/gr4vy/models/certificatealgorithm.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from gr4vy.types import UnrecognizedStr +from typing import Literal, Union + + +CertificateAlgorithm = Union[ + Literal[ + "ECDSA", + "RSA", + ], + UnrecognizedStr, +] diff --git a/src/gr4vy/models/collection_apikeypair_.py b/src/gr4vy/models/collection_apikeypair_.py new file mode 100644 index 00000000..7ae8e807 --- /dev/null +++ b/src/gr4vy/models/collection_apikeypair_.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apikeypair import APIKeyPair, APIKeyPairTypedDict +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CollectionAPIKeyPairTypedDict(TypedDict): + items: List[APIKeyPairTypedDict] + r"""A list of items returned for this request.""" + limit: NotRequired[int] + r"""The number of items for this page.""" + next_cursor: NotRequired[Nullable[str]] + r"""The cursor pointing at the next page of items.""" + previous_cursor: NotRequired[Nullable[str]] + r"""The cursor pointing at the previous page of items.""" + + +class CollectionAPIKeyPair(BaseModel): + items: List[APIKeyPair] + r"""A list of items returned for this request.""" + + limit: Optional[int] = 20 + r"""The number of items for this page.""" + + next_cursor: OptionalNullable[str] = UNSET + r"""The cursor pointing at the next page of items.""" + + previous_cursor: OptionalNullable[str] = UNSET + r"""The cursor pointing at the previous page of items.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["limit", "next_cursor", "previous_cursor"]) + nullable_fields = set(["next_cursor", "previous_cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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/delete_api_key_pairop.py b/src/gr4vy/models/delete_api_key_pairop.py new file mode 100644 index 00000000..0b93864a --- /dev/null +++ b/src/gr4vy/models/delete_api_key_pairop.py @@ -0,0 +1,18 @@ +"""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 DeleteAPIKeyPairRequestTypedDict(TypedDict): + api_key_pair_id: str + r"""The ID of the API key pair.""" + + +class DeleteAPIKeyPairRequest(BaseModel): + api_key_pair_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the API key pair.""" diff --git a/src/gr4vy/models/get_api_key_pairop.py b/src/gr4vy/models/get_api_key_pairop.py new file mode 100644 index 00000000..51eae70a --- /dev/null +++ b/src/gr4vy/models/get_api_key_pairop.py @@ -0,0 +1,18 @@ +"""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 GetAPIKeyPairRequestTypedDict(TypedDict): + api_key_pair_id: str + r"""The ID of the API key pair.""" + + +class GetAPIKeyPairRequest(BaseModel): + api_key_pair_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the API key pair.""" diff --git a/src/gr4vy/models/list_api_key_pairsop.py b/src/gr4vy/models/list_api_key_pairsop.py new file mode 100644 index 00000000..b8ba338c --- /dev/null +++ b/src/gr4vy/models/list_api_key_pairsop.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .collection_apikeypair_ import CollectionAPIKeyPair, CollectionAPIKeyPairTypedDict +from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from gr4vy.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Callable, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListAPIKeyPairsRequestTypedDict(TypedDict): + cursor: NotRequired[Nullable[str]] + r"""A pointer to the page of results to return.""" + limit: NotRequired[int] + r"""The maximum number of items that are returned.""" + + +class ListAPIKeyPairsRequest(BaseModel): + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""A pointer to the page of results to return.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 20 + r"""The maximum number of items that are returned.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["cursor", "limit"]) + nullable_fields = set(["cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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 + + +class ListAPIKeyPairsResponseTypedDict(TypedDict): + result: CollectionAPIKeyPairTypedDict + + +class ListAPIKeyPairsResponse(BaseModel): + next: Callable[[], Optional[ListAPIKeyPairsResponse]] + + result: CollectionAPIKeyPair diff --git a/src/gr4vy/models/merchantaccounts.py b/src/gr4vy/models/merchantaccounts.py index 016691dc..6c8bc8b2 100644 --- a/src/gr4vy/models/merchantaccounts.py +++ b/src/gr4vy/models/merchantaccounts.py @@ -1,7 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .merchantaccount import MerchantAccount, MerchantAccountTypedDict +from .api_routers_merchant_accounts_schemas_merchantaccount import ( + APIRoutersMerchantAccountsSchemasMerchantAccount, + APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict, +) from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer from typing import List, Optional @@ -9,7 +12,7 @@ class MerchantAccountsTypedDict(TypedDict): - items: List[MerchantAccountTypedDict] + items: List[APIRoutersMerchantAccountsSchemasMerchantAccountTypedDict] r"""A list of items returned for this request.""" limit: NotRequired[int] r"""The number of items for this page.""" @@ -20,7 +23,7 @@ class MerchantAccountsTypedDict(TypedDict): class MerchantAccounts(BaseModel): - items: List[MerchantAccount] + items: List[APIRoutersMerchantAccountsSchemasMerchantAccount] r"""A list of items returned for this request.""" limit: Optional[int] = 20 diff --git a/src/gr4vy/models/permissionset.py b/src/gr4vy/models/permissionset.py new file mode 100644 index 00000000..8ff1b3bb --- /dev/null +++ b/src/gr4vy/models/permissionset.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from gr4vy.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class PermissionSetTypedDict(TypedDict): + allow: List[str] + + +class PermissionSet(BaseModel): + allow: List[str] diff --git a/src/gr4vy/models/refund.py b/src/gr4vy/models/refund.py index c0bdf9ac..9653c977 100644 --- a/src/gr4vy/models/refund.py +++ b/src/gr4vy/models/refund.py @@ -1,7 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .creator import Creator, CreatorTypedDict +from .api_common_schemas_creator import ( + APICommonSchemasCreator, + APICommonSchemasCreatorTypedDict, +) from .refundstatus import RefundStatus from .refundtargettype import RefundTargetType from datetime import datetime @@ -47,7 +50,7 @@ class RefundTypedDict(TypedDict): r"""An external identifier that can be used to match the refund against your own records.""" transaction_external_identifier: NotRequired[Nullable[str]] r"""An external identifier that can be used to match the transaction against your own records.""" - creator: NotRequired[Nullable[CreatorTypedDict]] + creator: NotRequired[Nullable[APICommonSchemasCreatorTypedDict]] r"""The user that created this resource""" error_code: NotRequired[Nullable[str]] r"""The standardized error code set by Gr4vy.""" @@ -116,7 +119,7 @@ class Refund(BaseModel): transaction_external_identifier: OptionalNullable[str] = UNSET r"""An external identifier that can be used to match the transaction against your own records.""" - creator: OptionalNullable[Creator] = UNSET + creator: OptionalNullable[APICommonSchemasCreator] = UNSET r"""The user that created this resource""" error_code: OptionalNullable[str] = UNSET diff --git a/src/gr4vy/models/role.py b/src/gr4vy/models/role.py new file mode 100644 index 00000000..9ba1f357 --- /dev/null +++ b/src/gr4vy/models/role.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .permissionset import PermissionSet, PermissionSetTypedDict +from gr4vy.types import BaseModel, UNSET_SENTINEL +from gr4vy.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RoleTypedDict(TypedDict): + id: str + name: str + description: str + permissions: PermissionSetTypedDict + type: Literal["role"] + + +class Role(BaseModel): + id: str + + name: str + + description: str + + permissions: PermissionSet + + TYPE: Annotated[ + Annotated[Optional[Literal["role"]], AfterValidator(validate_const("role"))], + pydantic.Field(alias="type"), + ] = "role" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + Role.model_rebuild() +except NameError: + pass diff --git a/src/gr4vy/models/update_api_key_pairop.py b/src/gr4vy/models/update_api_key_pairop.py new file mode 100644 index 00000000..43a048f5 --- /dev/null +++ b/src/gr4vy/models/update_api_key_pairop.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apikeypairupdate import APIKeyPairUpdate, APIKeyPairUpdateTypedDict +from gr4vy.types import BaseModel +from gr4vy.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateAPIKeyPairRequestTypedDict(TypedDict): + api_key_pair_id: str + r"""The ID of the API key pair.""" + api_key_pair_update: APIKeyPairUpdateTypedDict + + +class UpdateAPIKeyPairRequest(BaseModel): + api_key_pair_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the API key pair.""" + + api_key_pair_update: Annotated[ + APIKeyPairUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/gr4vy/sdk.py b/src/gr4vy/sdk.py index e2822c62..52088859 100644 --- a/src/gr4vy/sdk.py +++ b/src/gr4vy/sdk.py @@ -17,6 +17,7 @@ if TYPE_CHECKING: from gr4vy.account_updater import AccountUpdater + from gr4vy.api_key_pairs import APIKeyPairs from gr4vy.audit_logs import AuditLogs from gr4vy.buyers_sdk import BuyersSDK from gr4vy.card_scheme_definitions_sdk import CardSchemeDefinitionsSDK @@ -41,6 +42,7 @@ class Gr4vy(BaseSDK): r"""Gr4vy: The Gr4vy API.""" account_updater: "AccountUpdater" + api_key_pairs: "APIKeyPairs" buyers: "BuyersSDK" payment_methods: "PaymentMethodsSDK" gift_cards: "GiftCardsSDK" @@ -61,6 +63,7 @@ class Gr4vy(BaseSDK): payment_links: "PaymentLinksSDK" _sub_sdk_map = { "account_updater": ("gr4vy.account_updater", "AccountUpdater"), + "api_key_pairs": ("gr4vy.api_key_pairs", "APIKeyPairs"), "buyers": ("gr4vy.buyers_sdk", "BuyersSDK"), "payment_methods": ("gr4vy.payment_methods_sdk", "PaymentMethodsSDK"), "gift_cards": ("gr4vy.gift_cards_sdk", "GiftCardsSDK"),