diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4cee082d..a8f382b3 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,24 +1,24 @@ lockVersion: 2.0.0 id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119 management: - docChecksum: 367f24f9331b40827149c24c8faf725e + docChecksum: b087faf50b8fb23428b431607da6811a docVersion: 1.0.0 - speakeasyVersion: 1.787.0 - generationVersion: 2.914.0 - releaseVersion: 2.16.101 - configChecksum: e744dfd48c1e32e7c64a91f60c8885f7 + speakeasyVersion: 1.788.1 + generationVersion: 2.915.1 + releaseVersion: 2.16.102 + configChecksum: 9cd03907f36f92b02b1078383f5e6aae repoURL: https://github.com/gr4vy/gr4vy-java.git installationURL: https://github.com/gr4vy/gr4vy-java published: true persistentEdits: - generation_id: a4effbe4-f209-4948-bf7a-60396cc1cd0f - pristine_commit_hash: 936b2f42c5fab9af5423d9a917773e6661538541 - pristine_tree_hash: 1aee87c427fb6e7da2f1592347bd1de0136b81f7 + generation_id: 33bfb13b-9246-4628-a0da-538470cbafa8 + pristine_commit_hash: cf0800a4c67caa27ad274dc1f91cddaabf58bb6d + pristine_tree_hash: 49cc6608b3388586b2eb9e2390ccb959477b0e40 features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.3 - core: 3.55.29 + core: 3.55.30 flattening: 2.81.1 globalSecurity: 2.83.4 globalSecurityCallbacks: 0.1.0 @@ -56,6 +56,18 @@ trackedFiles: id: cb77b89acce9 last_write_checksum: sha1:327cf2b0ebf1980a467da39cdd3cbb34ba8a0b84 pristine_git_object: f615e05142a1f0e72c001b3aa00fb17147dac888 + docs/models/components/APIKeyPair.md: + id: 818c5775e870 + last_write_checksum: sha1:dc3d9d23ff966d69a0a8616cc5433554d9eb57a4 + pristine_git_object: ecab7c4c9f7a78ff6354c53c451b0b82a44cb006 + docs/models/components/APIKeyPairCreate.md: + id: 6fbe4a2cbbae + last_write_checksum: sha1:a44ee0801c5eb6f1a1d6aba7fe875c111e3b50ac + pristine_git_object: c118992ebaa3b056c1ec63a1b83d34a6def51eb1 + docs/models/components/APIKeyPairUpdate.md: + id: 65357fc1e4fa + last_write_checksum: sha1:560d6dfbd23b48624d5412cb1f1b49e195d4c937 + pristine_git_object: 354d8f6f2c1a358eef3d079c98650d043e6ab157 docs/models/components/AVSResponseCode.md: id: fff82744f4ef last_write_checksum: sha1:f6654ea6803cdb7445a1eb1fcc6d65f30d87c6b1 @@ -156,6 +168,22 @@ trackedFiles: id: 6d23ca5a09ff last_write_checksum: sha1:97989d9735a03e7d3d026b3847959c13101959b5 pristine_git_object: 18372db0b68312e60c9f3d02018959b6dd0327db + docs/models/components/ApiCommonSchemasCreator.md: + id: 53c170bf0aae + last_write_checksum: sha1:478e91812f8033385c64c9d507b10a7f94692a29 + pristine_git_object: d85d159ec28ae5b4a7402eb36aa2ad416f3e37df + docs/models/components/ApiCommonSchemasMerchantAccount.md: + id: b505b0a3e2ff + last_write_checksum: sha1:780f1523d9077ec95abe60c639e39a3071095963 + pristine_git_object: b28e031c36fd4a8f1de8944758ad5062e9ecfadc + docs/models/components/ApiRoutersApiKeyPairsSchemasCreator.md: + id: 3f34132c990f + last_write_checksum: sha1:59d9ee1c5a7cf30afc76fa58fe08b8ed036dcda0 + pristine_git_object: 9d7b8c3d27ebb249c7731498fee090300be8bab2 + docs/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md: + id: 56d31bf4e9b5 + last_write_checksum: sha1:56ed4deae423c240e258ffb1e19f907bcc6816bf + pristine_git_object: aee7d59499536db34cec708559569087b87c774d docs/models/components/ApiTypesDigitalWalletAddress.md: id: 672043bf0b50 last_write_checksum: sha1:a55c1f3027e8594f3436508e18e3d532f6f3d00b @@ -292,6 +320,10 @@ trackedFiles: id: 7488a245df87 last_write_checksum: sha1:a783c82981f5c18c9e2b35c4726b1473565dc676 pristine_git_object: f5dc579a5bbbf702a45f68f31c59eaade94804c2 + docs/models/components/CertificateAlgorithm.md: + id: 318d849b3d83 + last_write_checksum: sha1:40436a04ed7382b52cf92f6c923a8ba895f1c8ad + pristine_git_object: dd266c9ef133d66350977e82ea7a44caa2340358 docs/models/components/ChaseOptions.md: id: e2c1a60d6e5e last_write_checksum: sha1:366762b72eddeb6415442365255be2f7e924f808 @@ -340,6 +372,10 @@ trackedFiles: id: 94d1b9654cba last_write_checksum: sha1:f3150336a9686f0ea02eb11a24195037bdc4138d pristine_git_object: 76281ef7a46e020b86354b4a17a81ca80082988e + docs/models/components/CollectionAPIKeyPair.md: + id: 961506387ac0 + last_write_checksum: sha1:d510083acb6da21f5b2febe718f25c5ffb6f3ab0 + pristine_git_object: 86e5223ce621925897e56dee2fe790d0c114526d docs/models/components/Context.md: id: 6761e007a5d6 last_write_checksum: sha1:2a7e2b6a96bac2850000967c389510584b0060d4 @@ -352,10 +388,6 @@ trackedFiles: id: c9a59256b099 last_write_checksum: sha1:931af3b8fddaf8f9f721d64cb20e80b6bc92db04 pristine_git_object: 728aea91834e2537dad00b1c506d2ba5b93ba339 - docs/models/components/Creator.md: - id: 05ac3704e8a2 - last_write_checksum: sha1:87038ff445298b5116fface3051eba28edc3d35d - pristine_git_object: 0a065a97abbed1852a09176c46f74317d9779bde docs/models/components/Cryptogram.md: id: bc744144da6d last_write_checksum: sha1:e3faef1fe1c2e8526a698f0a2c2b50573c5f6d29 @@ -672,10 +704,6 @@ trackedFiles: id: 42697bfd046e last_write_checksum: sha1:a006228ba2ee555509629f522047bcd2da513fd4 pristine_git_object: 0ebcc1a2d8c19f3d9112245ab8d9c34c27d21ecc - docs/models/components/MerchantAccount.md: - id: 648030314b0f - last_write_checksum: sha1:c633b23c9a5972358a24ff514533fa38fca5ac0f - pristine_git_object: d3a7d6bc077141d7aa1f67ebf7f5492f07cfc213 docs/models/components/MerchantAccountCreate.md: id: 66caf1e4a763 last_write_checksum: sha1:77dfa050f5be238d2ca8dfcdbe5f6bd7b3a0d0c0 @@ -702,8 +730,8 @@ trackedFiles: pristine_git_object: ae46e16d21961b0839ae88505b575789fa427ab7 docs/models/components/MerchantAccounts.md: id: 066c94dd9676 - last_write_checksum: sha1:a8427c0a732719bdad84944f2d319f12ae72acd7 - pristine_git_object: 0af64d7341f47c2cd39e96f13ca4e3537c445cd8 + last_write_checksum: sha1:b46ebad4d3aade81cd7c2c2df953ca8cfc98748e + pristine_git_object: 6e45fc387d715eeb9f2274b38c74fb7f85b33c9c docs/models/components/MerchantProfileScheme.md: id: d8c4cdaa38cc last_write_checksum: sha1:44867292402cd33411d5fe904dc44b62ecf872fe @@ -1096,6 +1124,10 @@ trackedFiles: id: e965b9269ee0 last_write_checksum: sha1:c30b4157ced231374ded58e87ece6a766b198f60 pristine_git_object: 2bb2b4be7308e47da6858459fa6acbc8ea09ee3b + docs/models/components/PermissionSet.md: + id: 45eaf260c588 + last_write_checksum: sha1:51f52b8cc4452ecc8706528db85d1cdfa53dc923 + pristine_git_object: d02fd14a8df21e34240a76e80fcb86458fc1ea25 docs/models/components/PlaidPaymentMethodCreate.md: id: 618a7982ce28 last_write_checksum: sha1:44b01d45af2cba881f8691b92554ab34939d216b @@ -1130,8 +1162,8 @@ trackedFiles: pristine_git_object: 2ed2723504795cab239feb23bc72bea5367546e9 docs/models/components/Refund.md: id: a2190313768a - last_write_checksum: sha1:12c0e4e1e0f38ef46a04046a03e7c0f37729253f - pristine_git_object: fd10d2b2d56525657a10a03b54ef0d64de92b66a + last_write_checksum: sha1:21f9368f68fb81aec4af2cdf0fa40370a7be635a + pristine_git_object: 8f771a61af505597440c4fdaf7d97b9c6ba8314b docs/models/components/RefundStatus.md: id: 77cdfb79bfbb last_write_checksum: sha1:28de1b3565f3be33fad8e64b3e70c817beb3a803 @@ -1232,6 +1264,10 @@ trackedFiles: id: 9f110df95d4f last_write_checksum: sha1:68e93e46062efab77b22777aef6d2fe2e3e9056c pristine_git_object: 0dbaa54ee769aa6f881d61790feac72525c1c056 + docs/models/components/Role.md: + id: c89eff3746a7 + last_write_checksum: sha1:915e9a2dd7870fc5c12616a7a9016f2d6403b75b + pristine_git_object: 6c7fc9ea0d59e183b977a239a1ff4ab935443a18 docs/models/components/RouteType.md: id: 3cd7da0c5250 last_write_checksum: sha1:f4f901371e150295ec29c69ab7f36684c48f2209 @@ -1688,6 +1724,10 @@ trackedFiles: id: 16ff1eec5aac last_write_checksum: sha1:28b71392ae3f612a59a73cad543eabed834ce7be pristine_git_object: ddcc1d3331584b7a91b46348b880a42d96291c46 + docs/models/operations/CreateApiKeyPairResponse.md: + id: a898990c063c + last_write_checksum: sha1:e0b8727cdac98c5505893ff1f8d78cbeff1872f1 + pristine_git_object: c0c7b855c89ccc1fe9f58f7970106acbfc525a8f docs/models/operations/CreateApplePayDigitalWalletSessionRequest.md: id: 2b5b1a787ff8 last_write_checksum: sha1:b10f03dc5e59cf4d99c9007b3d75fe7cfb86daee @@ -1734,8 +1774,8 @@ trackedFiles: pristine_git_object: c80b37008a481dc1c03a23763ebdba2d887fb763 docs/models/operations/CreateMerchantAccountResponse.md: id: 81526f92cc76 - last_write_checksum: sha1:fdf4dd1a4aa700227658cb1d2c1a77d498718ce4 - pristine_git_object: 28b28a384558fe627cbeebf3208c67ce8cd839d3 + last_write_checksum: sha1:92c25f1d4574e6f0f23392a6de9dfb6f54c80150 + pristine_git_object: effb4de5ed10797f53aa496886e4a78337275618 docs/models/operations/CreatePaymentMethodNetworkTokenCryptogramRequest.md: id: 031447ac4b76 last_write_checksum: sha1:09a1da0339c510395be281b67c9b5875fad7adc6 @@ -1856,6 +1896,14 @@ trackedFiles: id: 325675b11e3d last_write_checksum: sha1:8db8eab466afb8d8f67079fdd1cbcb8aca35ac46 pristine_git_object: 6cf65b2b62c51ed291f0b84776af6791eab6bf48 + docs/models/operations/DeleteApiKeyPairRequest.md: + id: 05ee68ec7a5c + last_write_checksum: sha1:ba9eb99be7f01fe5c3c609b33b2973285d173506 + pristine_git_object: 856e19fcf5fd3a4f0052213fb1cd5980bdd04c92 + docs/models/operations/DeleteApiKeyPairResponse.md: + id: 3f5e7f757f4a + last_write_checksum: sha1:42ed21a002c1182fd7c4deec9d2d67f7f44a9d17 + pristine_git_object: 67d26db51afcc7dc5cb7d6fb7b13152b717ce94a docs/models/operations/DeleteBuyerRequest.md: id: f01ec09671f5 last_write_checksum: sha1:3e67b9ff0a3acc44fb4b67fd07e28dd0accf9ff0 @@ -1960,6 +2008,14 @@ trackedFiles: id: ba140f88d0b9 last_write_checksum: sha1:2f5428d2def0c4af1222e4e059490be11c53cf2c pristine_git_object: a60cc16fb4b5759e47d96ecc781a19ed62406081 + docs/models/operations/GetApiKeyPairRequest.md: + id: 2c611a23af41 + last_write_checksum: sha1:1b996743ddb472d134f5287cee2f94cb07a19c42 + pristine_git_object: 1d137c17dd3c3d68444481c377f574ad2da58d4e + docs/models/operations/GetApiKeyPairResponse.md: + id: e29b7a53f6c6 + last_write_checksum: sha1:2fcad2819fb26731f54117f77490eb2272b79226 + pristine_git_object: 9c60f7bfdf0a6d1ce08897762c62203ed5c68beb docs/models/operations/GetBuyerRequest.md: id: 71db868347a5 last_write_checksum: sha1:f36bf502d6892fee12066bc64c282bb5a9b7dc09 @@ -2006,8 +2062,8 @@ trackedFiles: pristine_git_object: b6088058b550521df92742158a74e515d42e5c4b docs/models/operations/GetMerchantAccountResponse.md: id: 925d9198a067 - last_write_checksum: sha1:08577c47c685ae52eeb551df90a10d70f4620e65 - pristine_git_object: eaa2005be484e42fd754fc8208348a020a822f2d + last_write_checksum: sha1:69d122c69e37fae95b3762394a7f974c5c45a732 + pristine_git_object: 04a4442bef498c6d5fe86c8b45ea3f9341b8f05f docs/models/operations/GetPaymentLinkRequest.md: id: 1939b0ee3de4 last_write_checksum: sha1:416d6b99b36cb841cd4f7b18f89a29f88578a006 @@ -2120,6 +2176,14 @@ trackedFiles: id: 8433858bfe2a last_write_checksum: sha1:24220f3a85c09c043208bcd8fed59766012b5a29 pristine_git_object: bc9c9aac3732d1387c3d3e22457b2fc1e1eb3375 + docs/models/operations/ListApiKeyPairsRequest.md: + id: 9441e9a7985f + last_write_checksum: sha1:9bf7ff4712493f60b5ae4a93c085c83ba46c7f42 + pristine_git_object: 47581e237730e826f7b3247242cb6b8fff7ae23a + docs/models/operations/ListApiKeyPairsResponse.md: + id: 5f7e3820afab + last_write_checksum: sha1:fd56267b7c2348bd51bb70ffd3ca14bd747b94e3 + pristine_git_object: 180a20076e9458225fd44d2880ff5f24283d4347 docs/models/operations/ListAuditLogsRequest.md: id: 3293cdfc0b1e last_write_checksum: sha1:964ca83d835fe08f087b9bfe4806781d679c08e3 @@ -2412,6 +2476,14 @@ trackedFiles: id: 4cbb68f155e8 last_write_checksum: sha1:6ed3e61f361bd08d82436e63e9172f4558b2feb1 pristine_git_object: 5b117750b2aec68c8f8aee4daadd2d9731de7323 + docs/models/operations/UpdateApiKeyPairRequest.md: + id: e9bb391332cb + last_write_checksum: sha1:13bec6cb533cdeb0e3ae88e89ef2aaf67cd02f56 + pristine_git_object: a01a43c7eef000c1a4bceef162673570e883fddc + docs/models/operations/UpdateApiKeyPairResponse.md: + id: 7e17459b5fc1 + last_write_checksum: sha1:d288d692c52ef89b843d793493c7f237d5467ab9 + pristine_git_object: 69ad924bea16d5e5c25f68c3caafe5ebb07f9ab1 docs/models/operations/UpdateBuyerRequest.md: id: bacc8641ccd4 last_write_checksum: sha1:4c01b0e0005b9d1bf7bb01bc756476cfe2e9e7ec @@ -2450,8 +2522,8 @@ trackedFiles: pristine_git_object: 1c7680d5143f105b1435b90d26f59ae2bdc607c9 docs/models/operations/UpdateMerchantAccountResponse.md: id: 8a19aa9101e6 - last_write_checksum: sha1:bcc7983eced9dd10d1fcee7d697c3017baeb905f - pristine_git_object: 9e5f6fa51079ca0cd00f46b217111113215a9c43 + last_write_checksum: sha1:fb5e41af21bfbefb4b47bd7b5c45609c0d12f31b + pristine_git_object: ea3eb750b38475a0c0c76a2ba6565e9618fa3034 docs/models/operations/UpdatePaymentMethodRequest.md: id: d609e52a1a89 last_write_checksum: sha1:c66e4effb1c7c5be822a70a840f633050b7a9b10 @@ -2516,6 +2588,10 @@ trackedFiles: id: 936653be5c4b last_write_checksum: sha1:97da642dcdafbb8a8d55336d987af073423d3643 pristine_git_object: 41ae3d5d1e9a8469de4ad1bbae726f708e743315 + docs/sdks/apikeypairs/README.md: + id: ea1b1a49a3b2 + last_write_checksum: sha1:4d8146b227a9c274823f5a0ec293f1338b22b015 + pristine_git_object: 3762a4a15abd82fe8984e75974c8a2446eca8a3c docs/sdks/auditlogs/README.md: id: 4ed8509e422e last_write_checksum: sha1:b2e2cc719f416d07b769b757c4b75d744ddfd735 @@ -2578,8 +2654,8 @@ trackedFiles: pristine_git_object: 95b4ea34d6ef0e9ece966c48de3e884a855d4a03 docs/sdks/merchantaccounts/README.md: id: 468eec4fc203 - last_write_checksum: sha1:7ad7ab6679f5a8272fcc5fb8d76b0a8b5fd15d9d - pristine_git_object: f75d33646f9792de2de76985eae481443b93f1ad + last_write_checksum: sha1:02f51cc151a8cf1362f12f2c39061dde2183d5a3 + pristine_git_object: 94703d66ae9be7311b6e9a811668b61fd138f764 docs/sdks/networktokens/README.md: id: 4c1c913867c5 last_write_checksum: sha1:4b77d8d210135c1d82e66e9f5abceb0dd4d066dd @@ -2658,8 +2734,8 @@ trackedFiles: pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:c399f2069fe7c23da4b000bf19be0e19dea825a8 - pristine_git_object: ccfcf41d4fd174be206751234ff3c8b15e6dd0e8 + last_write_checksum: sha1:500a3a959ccc352cdd7e882a089aa0d7bbabd73b + pristine_git_object: 29be94aae7367fb5f09a83294fd0de8c76bc7fb4 gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -2696,6 +2772,10 @@ trackedFiles: id: 234c521b6941 last_write_checksum: sha1:6ef88cfdfc33ec118f9cc83b188b69433ee939a3 pristine_git_object: 09ab826561c4c409dafd0d49ce1e6a255b0e2780 + src/main/java/com/gr4vy/sdk/ApiKeyPairs.java: + id: a898fb7a8d1c + last_write_checksum: sha1:bb0aba9644dff4049ab4ba2e412e9de19bd3ebc8 + pristine_git_object: 635768980becda81870f63eb28f0971be86d5736 src/main/java/com/gr4vy/sdk/AsyncAccountUpdater.java: id: 34079b56a4a6 last_write_checksum: sha1:04f37daea3a2ce9298b776199abf54faa1ee1094 @@ -2708,6 +2788,10 @@ trackedFiles: id: 42ccc0a41ddf last_write_checksum: sha1:7252df5451de1c20d538f2de57ef003c53c06b65 pristine_git_object: 6c81725a066aa13dee34e469b6e7b9c40aa8c0bd + src/main/java/com/gr4vy/sdk/AsyncApiKeyPairs.java: + id: f6681ed89de1 + last_write_checksum: sha1:aa02c70f1d0acc1715618d1db959f8f032fad607 + pristine_git_object: ea651883aab155e89927c4784290d02aee06201f src/main/java/com/gr4vy/sdk/AsyncAuditLogs.java: id: 1ea8380915d9 last_write_checksum: sha1:43cb32a95eeebe2ea946075c63a90a5757897ba0 @@ -2766,8 +2850,8 @@ trackedFiles: pristine_git_object: 16225a13ae2c2ea408f68b32ff53576e805717a8 src/main/java/com/gr4vy/sdk/AsyncGr4vy.java: id: ae8f21a7dc22 - last_write_checksum: sha1:0bd6dfe995d99fceff70dbf45a67479a07149859 - pristine_git_object: d0751378fd5921250793794defa852f5a2b3c9b2 + last_write_checksum: sha1:c5cf3f07d6e68afd6eb7d8b94085a5aedd0800e3 + pristine_git_object: 59bfd5b6111715b25f0a7cdb5d806a361b2aaeba src/main/java/com/gr4vy/sdk/AsyncJobs.java: id: a7e09fa39597 last_write_checksum: sha1:e2ccae6928270a0cc6e447460346bbf572030ac4 @@ -2906,8 +2990,8 @@ trackedFiles: pristine_git_object: c0bd05b6b21e7d3f560e27b0c3dead257db4f9ac src/main/java/com/gr4vy/sdk/Gr4vy.java: id: 239506d7cead - last_write_checksum: sha1:38b3d537bc8ebe3b693a970ab2964476ea1ec694 - pristine_git_object: f7d963e62233a1f9cafe599d3b9ce964fc30c00a + last_write_checksum: sha1:2f29ae77ade0777daf380025889f80ead0fd379f + pristine_git_object: 8f82bd1dd6c87920d81fcd8b0cd3b11cb5a50209 src/main/java/com/gr4vy/sdk/Jobs.java: id: 4d2b50329148 last_write_checksum: sha1:ee56ad840615df38deb1bef43690f81c6ea8944f @@ -2962,8 +3046,8 @@ trackedFiles: pristine_git_object: 502a7312d3dc82c102dbaf7ed5e952d0c793e26f src/main/java/com/gr4vy/sdk/SDKConfiguration.java: id: 73a7edeaca45 - last_write_checksum: sha1:66801966f78307c93f9da6af2172b3b7e91cd67f - pristine_git_object: ae73a2e67527ac7668127c60680758e84b6699e3 + last_write_checksum: sha1:816b192a7774200656a848228aa5434c3ba71547 + pristine_git_object: 86ad435c622913d693831308d86e32bf2532aa76 src/main/java/com/gr4vy/sdk/SecuritySource.java: id: 1b6add6b9b50 last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd @@ -3004,6 +3088,18 @@ trackedFiles: id: 11b412cb92a0 last_write_checksum: sha1:b7754f5c01adaed74fb5e07b39c7b59a9a0d7453 pristine_git_object: 4064ab271b9d85e870287268983ac72d32ce6515 + src/main/java/com/gr4vy/sdk/models/components/APIKeyPair.java: + id: 13872d76e930 + last_write_checksum: sha1:668a2d3b4f2b9f5e7e0c8116f7ae0b2f5d4bd65c + pristine_git_object: 0f35c16684f0506312087285a460fff2f8400dcd + src/main/java/com/gr4vy/sdk/models/components/APIKeyPairCreate.java: + id: a06a7a2d0225 + last_write_checksum: sha1:d93d16f4fda1b9993adc293931046e6001e14c01 + pristine_git_object: 25167bbf4e81962e14e86cb38ed63466202b3a7a + src/main/java/com/gr4vy/sdk/models/components/APIKeyPairUpdate.java: + id: c984e4ce4195 + last_write_checksum: sha1:15ab0cf8de067e48d82ee9623c0ed768d69647ab + pristine_git_object: 7848e7ab9485b7ce3c8905d6814badce62098b6c src/main/java/com/gr4vy/sdk/models/components/AVSResponseCode.java: id: 762c7e137576 last_write_checksum: sha1:356e3c98e617a28f6a3da434bf98faed1358279b @@ -3104,6 +3200,22 @@ trackedFiles: id: 710fe2975c48 last_write_checksum: sha1:49dc64b0d1fcc6d8b5a3a833c5cc867f9db4f2bd pristine_git_object: 89eac979cc1496c6c69e3d94927fc060d77e17a2 + src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasCreator.java: + id: ea73e2cb0f98 + last_write_checksum: sha1:e36a02ec482490f5339b85db3a2a4b9ef3ebf0be + pristine_git_object: ddced322b863bec4eb547503f572284fba2ca45b + src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasMerchantAccount.java: + id: 4e8e8a86abf1 + last_write_checksum: sha1:89a29f7936da366501a5d153c6fd18131da719e7 + pristine_git_object: f1c442e8795342866abb58ee7e15e64c45862539 + src/main/java/com/gr4vy/sdk/models/components/ApiRoutersApiKeyPairsSchemasCreator.java: + id: be634cdabf82 + last_write_checksum: sha1:1aaf8335fa9007e24090b7c23be5676838c8dce8 + pristine_git_object: d7cec970d85d17206c3b81efc8103d78c88e7faa + src/main/java/com/gr4vy/sdk/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.java: + id: c6e97fb72e0c + last_write_checksum: sha1:ac8f432da3c2746c4713c5ec65c54163b727c1be + pristine_git_object: a7a5b5ecac72d3dbda5d30f8576c8d1c617d91ec src/main/java/com/gr4vy/sdk/models/components/ApiTypesDigitalWalletAddress.java: id: 9c78a30e0dbc last_write_checksum: sha1:5043b1a799d5223b1c6f9fec7a457183a9f1af97 @@ -3240,6 +3352,10 @@ trackedFiles: id: bb251abb2fcb last_write_checksum: sha1:de745507e45880a398bbc55eb64c2b8b2e9faf3e pristine_git_object: b2dab7b1769b02c4e1698622ba577d06cf32bd8a + src/main/java/com/gr4vy/sdk/models/components/CertificateAlgorithm.java: + id: e3229b7647d1 + last_write_checksum: sha1:36dd78dbd7d05437f34c6d8e74f3e61051f9f737 + pristine_git_object: f498f0db9d1b949fdaf8015af278761cd867d2a4 src/main/java/com/gr4vy/sdk/models/components/ChaseOptions.java: id: 7fc9aaf0cdc4 last_write_checksum: sha1:b5d2b6d1f4ce51f0147bbe1f6af6247d6f270c63 @@ -3288,6 +3404,10 @@ trackedFiles: id: 8ec9425753fd last_write_checksum: sha1:bf2825d28679df61aa07ed812694a34ba756ad27 pristine_git_object: fb147468dbe51572a20db2f124dfa4074f04700c + src/main/java/com/gr4vy/sdk/models/components/CollectionAPIKeyPair.java: + id: aabfbf6df1b6 + last_write_checksum: sha1:d5a0ade4b13a7bc0c1e9fcbec687e6a44aa90a2c + pristine_git_object: 77e4ae9527c085718609d9a9e97446da0b7e05c2 src/main/java/com/gr4vy/sdk/models/components/Context.java: id: 12922a32ce3e last_write_checksum: sha1:c1b4564bb736459f4ac4a5d3e910e525cd2111b4 @@ -3300,10 +3420,6 @@ trackedFiles: id: 7c1a317d3ed8 last_write_checksum: sha1:56acace68fa744e918d6af0184a9c48e7df0d34d pristine_git_object: 30101e065715e1e07753a2f8324808be1cd181b6 - src/main/java/com/gr4vy/sdk/models/components/Creator.java: - id: 9c9b0a596118 - last_write_checksum: sha1:99455e1a3f9e2ffe0996407e1a977123c208e09b - pristine_git_object: a051b33aeb7af33c5f386335425eff0fd8cfed5b src/main/java/com/gr4vy/sdk/models/components/Cryptogram.java: id: 913ee38db004 last_write_checksum: sha1:fa26b71ce955f68a8d411d85729bacff03a01c44 @@ -3620,10 +3736,6 @@ trackedFiles: id: 7b90171ea6ef last_write_checksum: sha1:e91e2f4fdbdefbd357008cf0cf1d62b885eeeeca pristine_git_object: 7d7cabc34746674fa202ba016535ced3dfbd6971 - src/main/java/com/gr4vy/sdk/models/components/MerchantAccount.java: - id: 4de940611d0d - last_write_checksum: sha1:4f62a04650e71ecf497a9dde5d038f1258d3cd01 - pristine_git_object: 3b8eca756f34caed7e43a5555dfceb39152ea8ea src/main/java/com/gr4vy/sdk/models/components/MerchantAccountCreate.java: id: f630f5edfb5e last_write_checksum: sha1:d3b134d6da878bb99916091568f51264934036d9 @@ -3650,8 +3762,8 @@ trackedFiles: pristine_git_object: d02b2fb70f20ddfb0ea3df190ceb504290140cbc src/main/java/com/gr4vy/sdk/models/components/MerchantAccounts.java: id: e101e34f1fc8 - last_write_checksum: sha1:fb92dd91df2cc8c3c5461204ca8021427b90e295 - pristine_git_object: 348a2178079cb0958eb1abfc11e1e6108533a1ac + last_write_checksum: sha1:864e039493330357f8756683b074ad18d5577b87 + pristine_git_object: 8c524fcee2e14947bb297544e8604d4daa4ae2e6 src/main/java/com/gr4vy/sdk/models/components/MerchantProfileScheme.java: id: 549d838052a8 last_write_checksum: sha1:9d0cc3a8b40f1660d0bc08689d2f83271d88e049 @@ -4044,6 +4156,10 @@ trackedFiles: id: ab4301d801d0 last_write_checksum: sha1:16cc20fc03b2df9ccb20bf28876a5e401ffbb567 pristine_git_object: fafba1a4eaa216ed954808891ca52cffe4969f39 + src/main/java/com/gr4vy/sdk/models/components/PermissionSet.java: + id: f4a641157167 + last_write_checksum: sha1:c552c871eb568b6aad45dc73449fd0d112d8ae30 + pristine_git_object: 415f8908464a319039b1b1edccc85fb50096fe6b src/main/java/com/gr4vy/sdk/models/components/PlaidPaymentMethodCreate.java: id: 278082fd49e5 last_write_checksum: sha1:25c90fbad2fd25645c0bcf38fadf272f4aa1ac68 @@ -4078,8 +4194,8 @@ trackedFiles: pristine_git_object: be4a6acfb4db6b46dc0b22d4a45d3dfa0b345ec6 src/main/java/com/gr4vy/sdk/models/components/Refund.java: id: 4b22e399807b - last_write_checksum: sha1:4216802e68547a804aa6944f8adf8edb8d5be37c - pristine_git_object: a568113f7a68622c903a338048d491ee4143b209 + last_write_checksum: sha1:53b9d2207917491dcd78d3a2bed75d1f8a433dfa + pristine_git_object: 311639b264c92860ebf774adb5156b5f7f1ba79c src/main/java/com/gr4vy/sdk/models/components/RefundStatus.java: id: 84b5d6af33dc last_write_checksum: sha1:e837e1884e204f5ed757d6203afc9ca62e31cf63 @@ -4180,6 +4296,10 @@ trackedFiles: id: 60b6171a3a82 last_write_checksum: sha1:a704b13f466ad648890450e263e84e2ed5ecb79c pristine_git_object: dcdb5eef507452a02f0dbf471b4b631df1870ce8 + src/main/java/com/gr4vy/sdk/models/components/Role.java: + id: f98d16d11004 + last_write_checksum: sha1:77da8b2cb8352aa645dc1ed46d14cce7cc958758 + pristine_git_object: 850352d6d4db71e18d25d3cfd3448f892e753760 src/main/java/com/gr4vy/sdk/models/components/RouteType.java: id: 22af332c1ef1 last_write_checksum: sha1:be0f4ec846f87d014eb50a8e5f53bda50e850ceb @@ -4620,6 +4740,10 @@ trackedFiles: id: bafc088f16b8 last_write_checksum: sha1:82382338adb67bf7209c9d2eaa90fa61185cfc75 pristine_git_object: 5912071e102ff3f7af1e27018e0e701db31b63fa + src/main/java/com/gr4vy/sdk/models/operations//async/CreateApiKeyPairRequestBuilder.java: + id: 0daecca29402 + last_write_checksum: sha1:6b7299ac610e43714efc600e1aee345a8658eae8 + pristine_git_object: a735d5df76a3396cb413f1e7d150faffe49b839e src/main/java/com/gr4vy/sdk/models/operations//async/CreateApplePayDigitalWalletSessionRequestBuilder.java: id: 1b60786c6376 last_write_checksum: sha1:05bf4a5f4b9a6b6af3a6d1ac40b4696c09797cf1 @@ -4708,6 +4832,10 @@ trackedFiles: id: 2c615127011d last_write_checksum: sha1:d8a48e745bd6db78c0bad97c5557e1fd95a8b91e pristine_git_object: 3efac78efb541f0c982cae66150d120947565c4d + src/main/java/com/gr4vy/sdk/models/operations//async/DeleteApiKeyPairRequestBuilder.java: + id: d76d18fe8c58 + last_write_checksum: sha1:fc6836ebe1145f202bcee26ab48e9f07a7f548ed + pristine_git_object: d772e57062b3a4da0d3ab0e06d4036c8459bb692 src/main/java/com/gr4vy/sdk/models/operations//async/DeleteBuyerRequestBuilder.java: id: 2ba4f60577af last_write_checksum: sha1:42df27003ee9f012052ce0a8ead831d6dc8d6679 @@ -4760,6 +4888,10 @@ trackedFiles: id: 85957cbd68e1 last_write_checksum: sha1:29d77ec2f735e8057e53321ead4b5655a2cd5056 pristine_git_object: 4f69644254167043650f4369d38f2a0b35536de9 + src/main/java/com/gr4vy/sdk/models/operations//async/GetApiKeyPairRequestBuilder.java: + id: 00938a9d0432 + last_write_checksum: sha1:8e25816ab5beb88cead70341d94e185a7add83f7 + pristine_git_object: aa1866f979cedd45645a327a0a3737c5d6eb781d src/main/java/com/gr4vy/sdk/models/operations//async/GetBuyerRequestBuilder.java: id: e0cb8c36e634 last_write_checksum: sha1:d7621c2dde63597c2712fbe668ec64750323e788 @@ -4840,6 +4972,10 @@ trackedFiles: id: b53cf0e780e4 last_write_checksum: sha1:393de25c583bfacbc00d1e9337f90da5c3d36753 pristine_git_object: e6c62241a7b0cb394127c0431f01b9a40a2c6eb2 + src/main/java/com/gr4vy/sdk/models/operations//async/ListApiKeyPairsRequestBuilder.java: + id: 20b9a80c525a + last_write_checksum: sha1:bfb3071ba1b1fa10a218d65f7e419f90727cb691 + pristine_git_object: e87742b23b9d0b1f9a08e4eb58a94c875754d35a src/main/java/com/gr4vy/sdk/models/operations//async/ListAuditLogsRequestBuilder.java: id: dda457dcd22b last_write_checksum: sha1:d526d45be3fbb33ed51ba29f06df5dc19b961772 @@ -4972,6 +5108,10 @@ trackedFiles: id: c97c2e0a880c last_write_checksum: sha1:900a27be5c5ae72f7a5bd1823b4795337fddffb3 pristine_git_object: a83f726f5e3b7e00d1e76707b008cf91b9c6d51e + src/main/java/com/gr4vy/sdk/models/operations//async/UpdateApiKeyPairRequestBuilder.java: + id: b1a8a0bdf3d1 + last_write_checksum: sha1:e0b910926db9259fa02377f27e6e877d99f4cab7 + pristine_git_object: 0a5f22eaf0fbfa5bcac2a381128fc121bc29a525 src/main/java/com/gr4vy/sdk/models/operations//async/UpdateBuyerRequestBuilder.java: id: c926e80a7d0d last_write_checksum: sha1:86c3f2589678fc9603f2d8ebda3613a3216fcbe2 @@ -5132,6 +5272,14 @@ trackedFiles: id: f7eccd63b5dd last_write_checksum: sha1:e92fd0ea4f027edb4ddeddf9bb0d1725f7797fb6 pristine_git_object: 7edc2f4743d6f13081c2753d7bb90389d298355d + src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairRequestBuilder.java: + id: 1d5e59204a0d + last_write_checksum: sha1:5421f1ed070f50963a2908fa2fff5016a4abcb7b + pristine_git_object: 6283a189555b4e96fc654f3a3029dfd87b6b19a0 + src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairResponse.java: + id: b793f20f0a7c + last_write_checksum: sha1:38501204ef285c60a2335e687d7a16bcabd78d90 + pristine_git_object: 25a1b3264ff00eeb1c53ce8f5352228ab3be9231 src/main/java/com/gr4vy/sdk/models/operations/CreateApplePayDigitalWalletSessionRequest.java: id: 86be2a128529 last_write_checksum: sha1:6c7254e4241cc3d33b61e8ffba4d838120033e99 @@ -5206,8 +5354,8 @@ trackedFiles: pristine_git_object: b33287b568af8f79ed187cded0e205c22bfc3f47 src/main/java/com/gr4vy/sdk/models/operations/CreateMerchantAccountResponse.java: id: 711a9b343db4 - last_write_checksum: sha1:42acf9424221eedee2109a1dd7e14121c2eab5d7 - pristine_git_object: d25150d9acf05d8b79f5b2c6bc2ff35193a1f2c9 + last_write_checksum: sha1:cf5e42fc3582f3d3d911768630bb0b706cadd36d + pristine_git_object: 1c3bf8c1b1bd8400bdd35633754d1daabf1db4b8 src/main/java/com/gr4vy/sdk/models/operations/CreatePaymentMethodNetworkTokenCryptogramRequest.java: id: 66926a667dff last_write_checksum: sha1:eb93df62114e0c11e5bde7a439f8d128269ee33b @@ -5388,6 +5536,18 @@ trackedFiles: id: f2fac141a88d last_write_checksum: sha1:60c10326a253eb078b0c7a430a789707e24854b7 pristine_git_object: d0c13dd14335f437adb39d1d6964238da723b612 + src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequest.java: + id: e10e71de15f9 + last_write_checksum: sha1:467df93506a57e42e804d27d772c6da6316c956b + pristine_git_object: b1a0e641d79ac873808c17dcc93643afe7c3131d + src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequestBuilder.java: + id: 5336cff2778e + last_write_checksum: sha1:8362021d7209e2cd65436a81061d92a94e89d617 + pristine_git_object: c4735e850eb5ef726b6e18e729e74c8bd962ed19 + src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairResponse.java: + id: 29421c57a515 + last_write_checksum: sha1:691d8929af8499832043345f5e468cfec930467e + pristine_git_object: 4813edf9f769159dd42390ace27012eaad912a55 src/main/java/com/gr4vy/sdk/models/operations/DeleteBuyerRequest.java: id: 4f14c5d4d4bc last_write_checksum: sha1:6ea91361ef4be7c505732dc2f42ecc74fcfcbfcb @@ -5544,6 +5704,18 @@ trackedFiles: id: b9d293f1c86b last_write_checksum: sha1:dbe7cf69d0239fe3823be29e97d09e46e13ae6ff pristine_git_object: fba55f3290fa3728bdab99efad481b1043e1dfc8 + src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequest.java: + id: 82f35a9ddf49 + last_write_checksum: sha1:0fc34f2d80498b67828a5e2551edcccc8ab69753 + pristine_git_object: e8825a77a26486cf8cc543aafd7ecf4ef79a304d + src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequestBuilder.java: + id: 6701855f7619 + last_write_checksum: sha1:cd5a94172b12deb409d29914ed5e2a3305d3f4c3 + pristine_git_object: 41990b3968bac1595d1b50e6a86cb194962c976c + src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairResponse.java: + id: 6b35a603d502 + last_write_checksum: sha1:d3586ecace938f19715613759752b2e147491cb0 + pristine_git_object: d17cfaa845c58aeb90ff5fe632686e86f1f216c5 src/main/java/com/gr4vy/sdk/models/operations/GetBuyerRequest.java: id: d514948b152e last_write_checksum: sha1:b21f48f289f1ec4db8660cd257095368614bb498 @@ -5614,8 +5786,8 @@ trackedFiles: pristine_git_object: 24a3b68550ab8b213182a204ca084572cc21187b src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountResponse.java: id: f6797bdc1ff2 - last_write_checksum: sha1:0b688a84de01876cff3762b1d7b2ef2331d7ddc2 - pristine_git_object: 476c35b7120c67d8b04ae3810534e52756e1f93c + last_write_checksum: sha1:4f3d859c9813232388d19cdca1d0604f2bffb162 + pristine_git_object: 2d27884f0e9ebc41a2fac4662cee006f5342e556 src/main/java/com/gr4vy/sdk/models/operations/GetPaymentLinkRequest.java: id: df4c07d53e8f last_write_checksum: sha1:65117ba57bf4cf1bbe41241f8a8c5a7257aaafb8 @@ -5784,6 +5956,18 @@ trackedFiles: id: b2750870c79c last_write_checksum: sha1:c14b4da6ee90235b8295c61735053d09bf4c6bb6 pristine_git_object: 8a4e1007fd19b390aa79073867ce5249d194ccce + src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequest.java: + id: cd1266fe53ee + last_write_checksum: sha1:f68674b28abc4239082ad683b99a5064abef25cf + pristine_git_object: a5ad3567bec0265811cb8e6e32fc660399c43bfd + src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequestBuilder.java: + id: 3a6ddefbd3f9 + last_write_checksum: sha1:745adb1e23ba5db81f51fc09f50be01f11c643e9 + pristine_git_object: 93653a3432ef477427ba89430ac4a6250a504057 + src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsResponse.java: + id: 30a5d3d0ffc1 + last_write_checksum: sha1:4e54de11fc0a8e3ce9158155db79cef77305768b + pristine_git_object: 5e6f5896cbf94e0073c6dc67c6fd3c862e12f650 src/main/java/com/gr4vy/sdk/models/operations/ListAuditLogsRequest.java: id: 8d80d1ba7125 last_write_checksum: sha1:12c47a8ef7f71a80c4aac376f39a38522ad63b68 @@ -6208,6 +6392,18 @@ trackedFiles: id: 4501910d5ea5 last_write_checksum: sha1:84000729956e5805b2b9383e852a0bbed4203e59 pristine_git_object: 1da3d32fd117fd905990e2b12a3c8aa2b6debb9e + src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequest.java: + id: 162b804988f3 + last_write_checksum: sha1:6177d180004a5c4a8c172a719a2f31df9cb3da58 + pristine_git_object: db773cb7cf29f73459b96fcc27afdcc1b40ac05b + src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequestBuilder.java: + id: 981d6471ccc0 + last_write_checksum: sha1:006d0492b2158d84657644e41ede8f2abdff710f + pristine_git_object: c94f101e8fcec5810198a57f9dfd742e607e7feb + src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairResponse.java: + id: c431d71e621a + last_write_checksum: sha1:4c956b8ea90e14e29ab7ea8d9f80a4cb7646ac3b + pristine_git_object: c793056d7fa19b649e61d516ce8d549277f04869 src/main/java/com/gr4vy/sdk/models/operations/UpdateBuyerRequest.java: id: 09702fed95de last_write_checksum: sha1:76988af06f536b369c98596982c1de11a0182b14 @@ -6266,8 +6462,8 @@ trackedFiles: pristine_git_object: 29ef85e4a5223d01150ce1b97338e1a6c6f171ba src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountResponse.java: id: 088286d86b7a - last_write_checksum: sha1:8dd20eac43fb910ecef6daec5e89d91ecbac023c - pristine_git_object: d82cb46e993510aba2c2b6721bafc8f174134cac + last_write_checksum: sha1:e60229a0e4ef8e111d6df40486f5c0d0cca5d20f + pristine_git_object: a7b264923505fc283314aef473660a6d0021103c src/main/java/com/gr4vy/sdk/models/operations/UpdatePaymentMethodRequest.java: id: 733a823386e6 last_write_checksum: sha1:94937f49c164010a5d4a6c174b3db595bfc3c76a @@ -6388,6 +6584,10 @@ trackedFiles: id: 88f4b4fe456a last_write_checksum: sha1:fa687b9a16e43e51bca4132bfcde90cbe7f7af18 pristine_git_object: 86c991ed5451bd647e1a6356c5d492080f65b6d2 + src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairResponse.java: + id: 0e9d9d03839c + last_write_checksum: sha1:d4cf6fd064507af9fc918c750778f60bc10c9bf1 + pristine_git_object: eaf282c3e751319c3441fd9d4144c9032390a6a2 src/main/java/com/gr4vy/sdk/models/operations/async/CreateApplePayDigitalWalletSessionResponse.java: id: a13549de0767 last_write_checksum: sha1:663d2d0c260fdb9fba3a77ac650e1831ddccc63f @@ -6414,8 +6614,8 @@ trackedFiles: pristine_git_object: 2116840a0135327c1fe2b7d483f60004003ae981 src/main/java/com/gr4vy/sdk/models/operations/async/CreateMerchantAccountResponse.java: id: b0b3d6361f33 - last_write_checksum: sha1:30a5d32c8dc26ebbaa86132eed3680f169a58925 - pristine_git_object: c94073a5464c695e71895ddf9d1f78f6604710bf + last_write_checksum: sha1:4dd63b4127cfd1f43961857cf705023799bfbe0e + pristine_git_object: 90f292677e2ac20d15b1a2fc58862910da750e95 src/main/java/com/gr4vy/sdk/models/operations/async/CreatePaymentMethodNetworkTokenCryptogramResponse.java: id: 8686de894f9f last_write_checksum: sha1:94fa322ce9575e56eb3a343cc111dc34fab08492 @@ -6476,6 +6676,10 @@ trackedFiles: id: 4a6df29ca4a9 last_write_checksum: sha1:801949a4f78d71ca3d5272e4620c3928f96aa469 pristine_git_object: 8e07cddae861d11fa7b8c5bc65f88b29838c08a1 + src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairResponse.java: + id: 8c837cf2c6a0 + last_write_checksum: sha1:95947dd13f716f47f14b3e20736db7a2a7abc12a + pristine_git_object: 566f61b02f40e4b924b20592393cad35d4de20c0 src/main/java/com/gr4vy/sdk/models/operations/async/DeleteBuyerResponse.java: id: a1e92fbbd12a last_write_checksum: sha1:7e873779d3f3b599f12c698aaa9b6a12b18ba2f8 @@ -6528,6 +6732,10 @@ trackedFiles: id: 10881c0ca9d5 last_write_checksum: sha1:3580e3a7915fe6200139503b14685e290e1081b2 pristine_git_object: 478d01e0c593cb4851c396e5c3a98552797da445 + src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairResponse.java: + id: f7d9f430d58e + last_write_checksum: sha1:d5320022e7f097653ba04c6d0de5a6f08f416c11 + pristine_git_object: 06b65598f5d96edd42f068fceb36079965eb1ec5 src/main/java/com/gr4vy/sdk/models/operations/async/GetBuyerResponse.java: id: 4f88fd519846 last_write_checksum: sha1:3dd236e0d2df87acb808c0a522f56f83c0487639 @@ -6550,8 +6758,8 @@ trackedFiles: pristine_git_object: 4b5a2a94048ea3235715214c8c169bb882283d66 src/main/java/com/gr4vy/sdk/models/operations/async/GetMerchantAccountResponse.java: id: 33704a61cf86 - last_write_checksum: sha1:7f1d171c10ea24697c7ad3b667429f8e6c2bef3f - pristine_git_object: 7e412c26c6d266c818c8ecd6e946d9e158ab486e + last_write_checksum: sha1:f300a4abaaae0969333c13ff34409792ad4066d6 + pristine_git_object: c2d11f0360be7c0f6adfb74c0cac2151a62b7100 src/main/java/com/gr4vy/sdk/models/operations/async/GetPaymentLinkResponse.java: id: c3606fc2b9e7 last_write_checksum: sha1:9b8f3c347ef0999d67e90d8134ac603def0b123f @@ -6608,6 +6816,10 @@ trackedFiles: id: d794e5bea92c last_write_checksum: sha1:a51085bcd57aa6dafa92ac050e2c313993fb3d83 pristine_git_object: f9b9e9a982f0e1f086d9ec462015c4b73f651d36 + src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsResponse.java: + id: cfd93f733620 + last_write_checksum: sha1:429c2810e9b5a70aa406a1c64b0bdd58fe1210c8 + pristine_git_object: a1bc2cf3a0ddf865324ab3bff3643ac2c0bdabb0 src/main/java/com/gr4vy/sdk/models/operations/async/ListAuditLogsResponse.java: id: ddbae2e7fe89 last_write_checksum: sha1:90fd7bb58808491a5f11c12b3111ea1698d49c33 @@ -6740,6 +6952,10 @@ trackedFiles: id: c891d2262e19 last_write_checksum: sha1:3f4c48d8d48e5bc9fb89ad45c3dfa240ef74b00e pristine_git_object: 0e022cd8149ab9ad2ab83d2875d370d9812b2ab2 + src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairResponse.java: + id: 4f3bb7bb81ed + last_write_checksum: sha1:4ee92f0e0e2e8aaca335b13dfb052354ddaaebfe + pristine_git_object: 38db24443643a53401bb3ac2b964b9b5a5219113 src/main/java/com/gr4vy/sdk/models/operations/async/UpdateBuyerResponse.java: id: 2fd3befe9174 last_write_checksum: sha1:e7642299133d1370b69c3d5304ca41beaabb76d2 @@ -6758,8 +6974,8 @@ trackedFiles: pristine_git_object: 6ccf5034083f515ba923a1c3f588aa0f2734f55c src/main/java/com/gr4vy/sdk/models/operations/async/UpdateMerchantAccountResponse.java: id: 8f6ed02f2244 - last_write_checksum: sha1:fe056dceb63221b366b96efde773465ea368bc40 - pristine_git_object: c1ea21c1e8528d5b92638d9e9c71c5eb30a24f3e + last_write_checksum: sha1:76482a17941b3273e808f307389f9c06e27486fa + pristine_git_object: fc5461fcc5a6c1e9e3c2199a3e99e58b6084eb43 src/main/java/com/gr4vy/sdk/models/operations/async/UpdatePaymentMethodResponse.java: id: c13326667f23 last_write_checksum: sha1:5eb03df45445c0ae5b98c33db579d3638e10e0ba @@ -6824,6 +7040,10 @@ trackedFiles: id: 628227fae97f last_write_checksum: sha1:03fe069e7263fdcf9f8ded14409e051e4e72313a pristine_git_object: 5ece16aeac0a622c9651a57e72c713f9af2d1e90 + src/main/java/com/gr4vy/sdk/operations/CreateApiKeyPair.java: + id: 2130f9538a40 + last_write_checksum: sha1:e242c8248a77bd1f3bb59687153429ad283f5ff1 + pristine_git_object: 0cad75361b6ee9c507c6acab7f06a7472a58b0b5 src/main/java/com/gr4vy/sdk/operations/CreateApplePayDigitalWalletSession.java: id: 58821b850fec last_write_checksum: sha1:a862868d66ec75335c0716a42d601e7de77c95a2 @@ -6850,8 +7070,8 @@ trackedFiles: pristine_git_object: d5dfd2ef872cda9de3e567e74b32dcef3cb388e0 src/main/java/com/gr4vy/sdk/operations/CreateMerchantAccount.java: id: 7f9eddacabfe - last_write_checksum: sha1:397b4c4784411dc07a2ef401d1601d89987827c1 - pristine_git_object: 6426d3eb9e106c0eeebee388ef3c1a9139643da2 + last_write_checksum: sha1:d8dc1e91a398f5f38bebced933a15431a6ccfa95 + pristine_git_object: 18a3894e21837893d42272c93fae36cc2d781a80 src/main/java/com/gr4vy/sdk/operations/CreatePaymentMethod.java: id: f1f0eb1b6d9e last_write_checksum: sha1:ab3167106cd091a688f2df51b4454527b769be26 @@ -6912,6 +7132,10 @@ trackedFiles: id: 50262a947d0b last_write_checksum: sha1:6ab28333a9c140e2d69b38a50c2351c9f16041db pristine_git_object: 796ce9d11baf7cec58b34a98c3dff07a4d904643 + src/main/java/com/gr4vy/sdk/operations/DeleteApiKeyPair.java: + id: dbecbf7fba8e + last_write_checksum: sha1:ff38273a373dd780b06ba33309ad35b26627a7d9 + pristine_git_object: d7c9109c31c31e513163f12688dcac6f8c1232a2 src/main/java/com/gr4vy/sdk/operations/DeleteBuyer.java: id: 16e881627fee last_write_checksum: sha1:b99a185c83c9151a4191a77f49c1ee90cec39c04 @@ -6964,6 +7188,10 @@ trackedFiles: id: bb85b2894295 last_write_checksum: sha1:11f846abce0351f54df8496dca4f834c93dabb23 pristine_git_object: 8cc4806506a481524a7cc4e73c82f9710bb63896 + src/main/java/com/gr4vy/sdk/operations/GetApiKeyPair.java: + id: 601a1300406c + last_write_checksum: sha1:027cf6d94da804039dfb5eb7f864bf1d31dc1eb8 + pristine_git_object: df5a826ee8aa2beced5b9327aecd8f08a07a49b5 src/main/java/com/gr4vy/sdk/operations/GetBuyer.java: id: 66471a229a50 last_write_checksum: sha1:6eb63497501eca748d457dee2e58a9658095b415 @@ -6986,8 +7214,8 @@ trackedFiles: pristine_git_object: e88ba62d8748eed953b771f8067e9cc9ba61b354 src/main/java/com/gr4vy/sdk/operations/GetMerchantAccount.java: id: ec10bacacb19 - last_write_checksum: sha1:d39cd964a1cd7588b1ae8570cf1bb47ee731c5d3 - pristine_git_object: 20630452b6f58d8570a4d5c66fb79c8897043a35 + last_write_checksum: sha1:a778ec8a96d2bce87cfae5b824a6d21fca958f15 + pristine_git_object: 78c7a7dec97d203a304853ee5e45b737ccbb5f64 src/main/java/com/gr4vy/sdk/operations/GetPaymentLink.java: id: fc154885fb1b last_write_checksum: sha1:89619f42b2a82848b69197615e413b07897b63c0 @@ -7044,6 +7272,10 @@ trackedFiles: id: 95bbfb54325e last_write_checksum: sha1:0b416d94081977ef4b4f0a27c27ceb5c998d7eea pristine_git_object: 5f8f7ee267f1540cc7b1194b6f788e4b07a3f4f5 + src/main/java/com/gr4vy/sdk/operations/ListApiKeyPairs.java: + id: 57b9a655ae24 + last_write_checksum: sha1:7665d3a8b1112d6df7982cd086601407f023945c + pristine_git_object: b53f53d6d9a87b698da9b8145d3fe67eaabc251e src/main/java/com/gr4vy/sdk/operations/ListAuditLogs.java: id: 1d24c5ffdfb8 last_write_checksum: sha1:7d9736054aca35702187b79fd50559bcca5f9762 @@ -7180,6 +7412,10 @@ trackedFiles: id: 507fb027d7db last_write_checksum: sha1:656946203b82648bcaa761519223721c2c495212 pristine_git_object: 5582fca964a4ee8db4aa97fa3f62e64684fcc05d + src/main/java/com/gr4vy/sdk/operations/UpdateApiKeyPair.java: + id: 54e407000d42 + last_write_checksum: sha1:795255a438dc17d593263d2e328b5bd8ff3e0581 + pristine_git_object: 757081677360194c5011760583868c1207578008 src/main/java/com/gr4vy/sdk/operations/UpdateBuyer.java: id: 31607ea16333 last_write_checksum: sha1:6dd24f18af73ad6990a43d0383a72cd9391012a8 @@ -7198,8 +7434,8 @@ trackedFiles: pristine_git_object: 18db4e83dae1b4d804ef37508466a2f954921b86 src/main/java/com/gr4vy/sdk/operations/UpdateMerchantAccount.java: id: cb6cc21c5422 - last_write_checksum: sha1:f74ec6d58f0ace06b8b39f9d3371ce39d4fb18f8 - pristine_git_object: addc038fbb36ce1439700ad0ea342665abce3937 + last_write_checksum: sha1:c8a2845b087d4e5e4ab8db3bdb252d7e11a08fcf + pristine_git_object: b4237b1150b844fc329a5738e3e0047a45ea3326 src/main/java/com/gr4vy/sdk/operations/UpdatePaymentMethod.java: id: 8c2655a08ee8 last_write_checksum: sha1:6ea7e6ec2d5a21033578df17aedd65bf51ac2452 @@ -11483,15 +11719,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: | ## Java 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.apiKeyPairs.list()`: **Added** + * `gr4vy.apiKeyPairs.create()`: **Added** + * `gr4vy.apiKeyPairs.get()`: **Added** + * `gr4vy.apiKeyPairs.update()`: **Added** + * `gr4vy.apiKeyPairs.delete()`: **Added** generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 31a0cc32..0bf4885d 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 2.16.101 + version: 2.16.102 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter:5.10.0 - implementation:com.auth0:java-jwt:4.5.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5a6ea989..d9411d32 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.787.0 +speakeasyVersion: 1.788.1 sources: Gr4vy: sourceNamespace: openapi @@ -9,8 +9,8 @@ sources: - 1.0.0 openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:989cfd6e142efb191c2a3d9402df111d08d903985b70f13a458e0948f0143045 - sourceBlobDigest: sha256:8880bb8b9b1656951edbe7cd41e9c52238f4908fb6f057d0cf09c846d769f12a + sourceRevisionDigest: sha256:310a942f5d16ac470a367666003e0aeba558172a835a1bec93fc7ae4625d9422 + sourceBlobDigest: sha256:e1bb34f351859c6592469fd34bd141e500f32da4f145a30a0bfd1389aa86eaf9 tags: - latest - 1.0.0 @@ -25,10 +25,10 @@ targets: java: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:989cfd6e142efb191c2a3d9402df111d08d903985b70f13a458e0948f0143045 - sourceBlobDigest: sha256:8880bb8b9b1656951edbe7cd41e9c52238f4908fb6f057d0cf09c846d769f12a + sourceRevisionDigest: sha256:310a942f5d16ac470a367666003e0aeba558172a835a1bec93fc7ae4625d9422 + sourceBlobDigest: sha256:e1bb34f351859c6592469fd34bd141e500f32da4f145a30a0bfd1389aa86eaf9 codeSamplesNamespace: openapi-java-code-samples - codeSamplesRevisionDigest: sha256:fb97e0500f664d60b5fd57b42393d67b17fcd1ad3e12b0bb72f964aa4b9c0ae9 + codeSamplesRevisionDigest: sha256:54c24d882676d1a59d54e9f6c0a17ce40b0f7274b9cb2b53f8db4fcb0bfa8da9 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 9612e292..af6310e1 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.gr4vy:sdk:2.16.101' +implementation 'com.gr4vy:sdk:2.16.102' ``` Maven: @@ -67,7 +67,7 @@ Maven: com.gr4vy sdk - 2.16.101 + 2.16.102 ``` @@ -334,6 +334,14 @@ Async support is available for: * [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 @@ -563,8 +571,7 @@ package hello.world; import com.gr4vy.sdk.Gr4vy; import com.gr4vy.sdk.models.errors.*; -import com.gr4vy.sdk.models.operations.ListBuyersRequest; -import com.gr4vy.sdk.models.operations.ListBuyersResponse; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; import java.lang.Exception; import java.lang.Iterable; @@ -573,23 +580,17 @@ public class Application { public static void main(String[] args) throws Exception { Gr4vy sdk = Gr4vy.builder() - .merchantAccountId("default") .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build(); - ListBuyersRequest req = ListBuyersRequest.builder() - .cursor("ZXhhbXBsZTE") - .search("John") - .externalIdentifier("buyer-12345") - .build(); - - var b = sdk.buyers().list(); + var b = sdk.apiKeyPairs().list() + .limit(20L); // Iterate through all pages using a traditional for-each loop // Each iteration returns a complete page response - Iterable iterable = b.callAsIterable(); - for (ListBuyersResponse page : iterable) { + Iterable iterable = b.callAsIterable(); + for (ListApiKeyPairsResponse page : iterable) { // handle page } @@ -598,7 +599,7 @@ public class Application { // Stream through pages without unwrapping (each item is a complete page) b.callAsStream() - .forEach((ListBuyersResponse page) -> { + .forEach((ListApiKeyPairsResponse page) -> { // handle page }); @@ -612,8 +613,7 @@ package hello.world; import com.gr4vy.sdk.AsyncGr4vy; import com.gr4vy.sdk.Gr4vy; -import com.gr4vy.sdk.models.operations.ListBuyersRequest; -import com.gr4vy.sdk.models.operations.async.ListBuyersResponse; +import com.gr4vy.sdk.models.operations.async.ListApiKeyPairsResponse; import reactor.core.publisher.Flux; public class Application { @@ -621,22 +621,16 @@ public class Application { public static void main(String[] args) { AsyncGr4vy sdk = Gr4vy.builder() - .merchantAccountId("default") .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build() .async(); - ListBuyersRequest req = ListBuyersRequest.builder() - .cursor("ZXhhbXBsZTE") - .search("John") - .externalIdentifier("buyer-12345") - .build(); - - var b = sdk.buyers().list(); + var b = sdk.apiKeyPairs().list() + .limit(20L); // Example using Project Reactor (illustrative) - pages - Flux pageFlux = Flux.from(b.callAsPublisher()); + Flux pageFlux = Flux.from(b.callAsPublisher()); pageFlux.subscribe( page -> System.out.println(page), error -> error.printStackTrace(), @@ -661,8 +655,7 @@ package hello.world; import com.gr4vy.sdk.Gr4vy; import com.gr4vy.sdk.models.errors.*; -import com.gr4vy.sdk.models.operations.ListBuyersRequest; -import com.gr4vy.sdk.models.operations.ListBuyersResponse; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; import com.gr4vy.sdk.utils.BackoffStrategy; import com.gr4vy.sdk.utils.RetryConfig; import java.lang.Exception; @@ -673,18 +666,11 @@ public class Application { public static void main(String[] args) throws Exception { Gr4vy sdk = Gr4vy.builder() - .merchantAccountId("default") .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build(); - ListBuyersRequest req = ListBuyersRequest.builder() - .cursor("ZXhhbXBsZTE") - .search("John") - .externalIdentifier("buyer-12345") - .build(); - - sdk.buyers().list() + sdk.apiKeyPairs().list() .retryConfig(RetryConfig.builder() .backoff(BackoffStrategy.builder() .initialInterval(1L, TimeUnit.MILLISECONDS) @@ -695,8 +681,9 @@ public class Application { .retryConnectError(false) .build()) .build()) + .limit(20L) .callAsStream() - .forEach((ListBuyersResponse item) -> { + .forEach((ListApiKeyPairsResponse item) -> { // handle page }); @@ -710,8 +697,7 @@ package hello.world; import com.gr4vy.sdk.Gr4vy; import com.gr4vy.sdk.models.errors.*; -import com.gr4vy.sdk.models.operations.ListBuyersRequest; -import com.gr4vy.sdk.models.operations.ListBuyersResponse; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; import com.gr4vy.sdk.utils.BackoffStrategy; import com.gr4vy.sdk.utils.RetryConfig; import java.lang.Exception; @@ -732,20 +718,14 @@ public class Application { .retryConnectError(false) .build()) .build()) - .merchantAccountId("default") .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build(); - ListBuyersRequest req = ListBuyersRequest.builder() - .cursor("ZXhhbXBsZTE") - .search("John") - .externalIdentifier("buyer-12345") - .build(); - - sdk.buyers().list() + sdk.apiKeyPairs().list() + .limit(20L) .callAsStream() - .forEach((ListBuyersResponse item) -> { + .forEach((ListApiKeyPairsResponse item) -> { // handle page }); diff --git a/RELEASES.md b/RELEASES.md index aa512044..d0595acf 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1848,4 +1848,14 @@ Based on: ### Generated - [java v2.16.101] . ### Releases -- [Maven Central v2.16.101] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.101 - . \ No newline at end of file +- [Maven Central v2.16.101] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.101 - . + +## 2026-07-06 09:05:21 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.788.1 (2.915.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.16.102] . +### Releases +- [Maven Central v2.16.102] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.102 - . \ No newline at end of file diff --git a/docs/models/components/APIKeyPair.md b/docs/models/components/APIKeyPair.md new file mode 100644 index 00000000..ecab7c4c --- /dev/null +++ b/docs/models/components/APIKeyPair.md @@ -0,0 +1,19 @@ +# APIKeyPair + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Optional\* | :heavy_minus_sign: | The type of this resource. | | +| `id` | *String* | :heavy_check_mark: | The ID for the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `thumbprint` | *String* | :heavy_check_mark: | The unique thumbprint that identifies the API key pair. | 6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk | +| `displayName` | *String* | :heavy_check_mark: | The display name for the API key pair. | Production key | +| `algorithm` | [CertificateAlgorithm](../../models/components/CertificateAlgorithm.md) | :heavy_check_mark: | N/A | | +| `active` | *boolean* | :heavy_check_mark: | Whether the API key pair is active and can be used to authenticate. | true | +| `privateKey` | *JsonNullable\* | :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. | | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date and time when this API key pair was created. | 2013-07-16T19:23:00.000+00:00 | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date and time when this API key pair was last updated. | 2013-07-16T19:23:00.000+00:00 | +| `creator` | [JsonNullable\](../../models/components/ApiRoutersApiKeyPairsSchemasCreator.md) | :heavy_minus_sign: | The user or API key pair that created this API key pair. | | +| `merchantAccounts` | List\<[ApiCommonSchemasMerchantAccount](../../models/components/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\<[Role](../../models/components/Role.md)> | :heavy_minus_sign: | The roles assigned to this API key pair. | | \ No newline at end of file diff --git a/docs/models/components/APIKeyPairCreate.md b/docs/models/components/APIKeyPairCreate.md new file mode 100644 index 00000000..c118992e --- /dev/null +++ b/docs/models/components/APIKeyPairCreate.md @@ -0,0 +1,13 @@ +# APIKeyPairCreate + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `displayName` | *String* | :heavy_check_mark: | The display name for the API key pair. | Production key | +| `algorithm` | [Optional\](../../models/components/CertificateAlgorithm.md) | :heavy_minus_sign: | N/A | | +| `active` | *Optional\* | :heavy_minus_sign: | Whether the API key pair should be active and usable once created. | true | +| `roleIds` | List\<*String*> | :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"
] | +| `merchantAccountIds` | List\<*String*> | :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"
] | +| `publicKey` | *JsonNullable\* | :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/components/APIKeyPairUpdate.md b/docs/models/components/APIKeyPairUpdate.md new file mode 100644 index 00000000..354d8f6f --- /dev/null +++ b/docs/models/components/APIKeyPairUpdate.md @@ -0,0 +1,11 @@ +# APIKeyPairUpdate + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `displayName` | *JsonNullable\* | :heavy_minus_sign: | The display name for the API key pair. | Production key | +| `active` | *JsonNullable\* | :heavy_minus_sign: | Whether the API key pair is active and can be used to authenticate. | true | +| `roleIds` | List\<*String*> | :heavy_minus_sign: | N/A | [
"8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a"
] | +| `merchantAccountIds` | List\<*String*> | :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/components/Creator.md b/docs/models/components/ApiCommonSchemasCreator.md similarity index 94% rename from docs/models/components/Creator.md rename to docs/models/components/ApiCommonSchemasCreator.md index 0a065a97..d85d159e 100644 --- a/docs/models/components/Creator.md +++ b/docs/models/components/ApiCommonSchemasCreator.md @@ -1,4 +1,4 @@ -# Creator +# ApiCommonSchemasCreator ## Fields diff --git a/docs/models/components/ApiCommonSchemasMerchantAccount.md b/docs/models/components/ApiCommonSchemasMerchantAccount.md new file mode 100644 index 00000000..b28e031c --- /dev/null +++ b/docs/models/components/ApiCommonSchemasMerchantAccount.md @@ -0,0 +1,14 @@ +# ApiCommonSchemasMerchantAccount + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `type` | *Optional\* | :heavy_minus_sign: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `displayName` | *String* | :heavy_check_mark: | N/A | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | N/A | +| `overCaptureAmount` | *JsonNullable\* | :heavy_minus_sign: | N/A | +| `overCapturePercentage` | *JsonNullable\* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/ApiRoutersApiKeyPairsSchemasCreator.md b/docs/models/components/ApiRoutersApiKeyPairsSchemasCreator.md new file mode 100644 index 00000000..9d7b8c3d --- /dev/null +++ b/docs/models/components/ApiRoutersApiKeyPairsSchemasCreator.md @@ -0,0 +1,11 @@ +# ApiRoutersApiKeyPairsSchemasCreator + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the user or API key pair that created the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `name` | *String* | :heavy_check_mark: | The name of the user or API key pair that created the API key pair. | John Doe | +| `emailAddress` | *JsonNullable\* | :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` | *JsonNullable\* | :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/components/MerchantAccount.md b/docs/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md similarity index 99% rename from docs/models/components/MerchantAccount.md rename to docs/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md index d3a7d6bc..aee7d594 100644 --- a/docs/models/components/MerchantAccount.md +++ b/docs/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md @@ -1,4 +1,4 @@ -# MerchantAccount +# ApiRoutersMerchantAccountsSchemasMerchantAccount ## Fields diff --git a/docs/models/components/CertificateAlgorithm.md b/docs/models/components/CertificateAlgorithm.md new file mode 100644 index 00000000..dd266c9e --- /dev/null +++ b/docs/models/components/CertificateAlgorithm.md @@ -0,0 +1,20 @@ +# CertificateAlgorithm + +## Example Usage + +```java +import com.gr4vy.sdk.models.components.CertificateAlgorithm; + +CertificateAlgorithm value = CertificateAlgorithm.ECDSA; + +// Open enum: use .of() to create instances from custom string values +CertificateAlgorithm custom = CertificateAlgorithm.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ------- | ------- | +| `ECDSA` | ECDSA | +| `RSA` | RSA | \ No newline at end of file diff --git a/docs/models/components/CollectionAPIKeyPair.md b/docs/models/components/CollectionAPIKeyPair.md new file mode 100644 index 00000000..86e5223c --- /dev/null +++ b/docs/models/components/CollectionAPIKeyPair.md @@ -0,0 +1,11 @@ +# CollectionAPIKeyPair + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `items` | List\<[APIKeyPair](../../models/components/APIKeyPair.md)> | :heavy_check_mark: | A list of items returned for this request. | | +| `limit` | *Optional\* | :heavy_minus_sign: | The number of items for this page. | 20 | +| `nextCursor` | *JsonNullable\* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | +| `previousCursor` | *JsonNullable\* | :heavy_minus_sign: | The cursor pointing at the previous page of items. | Xkjss7asS | \ No newline at end of file diff --git a/docs/models/components/MerchantAccounts.md b/docs/models/components/MerchantAccounts.md index 0af64d73..6e45fc38 100644 --- a/docs/models/components/MerchantAccounts.md +++ b/docs/models/components/MerchantAccounts.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `items` | List\<[MerchantAccount](../../models/components/MerchantAccount.md)> | :heavy_check_mark: | A list of items returned for this request. | | -| `limit` | *Optional\* | :heavy_minus_sign: | The number of items for this page. | 20 | -| `nextCursor` | *JsonNullable\* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | -| `previousCursor` | *JsonNullable\* | :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\<[ApiRoutersMerchantAccountsSchemasMerchantAccount](../../models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md)> | :heavy_check_mark: | A list of items returned for this request. | | +| `limit` | *Optional\* | :heavy_minus_sign: | The number of items for this page. | 20 | +| `nextCursor` | *JsonNullable\* | :heavy_minus_sign: | The cursor pointing at the next page of items. | ZXhhbXBsZTE | +| `previousCursor` | *JsonNullable\* | :heavy_minus_sign: | The cursor pointing at the previous page of items. | Xkjss7asS | \ No newline at end of file diff --git a/docs/models/components/PermissionSet.md b/docs/models/components/PermissionSet.md new file mode 100644 index 00000000..d02fd14a --- /dev/null +++ b/docs/models/components/PermissionSet.md @@ -0,0 +1,8 @@ +# PermissionSet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `allow` | List\<*String*> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/Refund.md b/docs/models/components/Refund.md index fd10d2b2..8f771a61 100644 --- a/docs/models/components/Refund.md +++ b/docs/models/components/Refund.md @@ -21,7 +21,7 @@ | `transactionExternalIdentifier` | *JsonNullable\* | :heavy_minus_sign: | An external identifier that can be used to match the transaction against your own records. | transaction-12345 | | `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date this refund was created at. | 2013-07-16T19:23:00.000+00:00 | | `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date this refund was last updated at. | 2013-07-16T19:23:00.000+00:00 | -| `creator` | [JsonNullable\](../../models/components/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` | [JsonNullable\](../../models/components/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"
} | | `errorCode` | *JsonNullable\* | :heavy_minus_sign: | The standardized error code set by Gr4vy. | service_error | | `rawResponseCode` | *JsonNullable\* | :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 | | `rawResponseDescription` | *JsonNullable\* | :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/components/Role.md b/docs/models/components/Role.md new file mode 100644 index 00000000..6c7fc9ea --- /dev/null +++ b/docs/models/components/Role.md @@ -0,0 +1,12 @@ +# Role + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `type` | *Optional\* | :heavy_minus_sign: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `description` | *String* | :heavy_check_mark: | N/A | +| `permissions` | [PermissionSet](../../models/components/PermissionSet.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreateApiKeyPairResponse.md b/docs/models/operations/CreateApiKeyPairResponse.md new file mode 100644 index 00000000..c0c7b855 --- /dev/null +++ b/docs/models/operations/CreateApiKeyPairResponse.md @@ -0,0 +1,11 @@ +# CreateApiKeyPairResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiKeyPair` | [Optional\](../../models/components/APIKeyPair.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/CreateMerchantAccountResponse.md b/docs/models/operations/CreateMerchantAccountResponse.md index 28b28a38..effb4de5 100644 --- a/docs/models/operations/CreateMerchantAccountResponse.md +++ b/docs/models/operations/CreateMerchantAccountResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `merchantAccount` | [Optional\](../../models/components/MerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiRoutersMerchantAccountsSchemasMerchantAccount` | [Optional\](../../models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/DeleteApiKeyPairRequest.md b/docs/models/operations/DeleteApiKeyPairRequest.md new file mode 100644 index 00000000..856e19fc --- /dev/null +++ b/docs/models/operations/DeleteApiKeyPairRequest.md @@ -0,0 +1,8 @@ +# DeleteApiKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `apiKeyPairId` | *String* | :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/operations/DeleteApiKeyPairResponse.md b/docs/models/operations/DeleteApiKeyPairResponse.md new file mode 100644 index 00000000..67d26db5 --- /dev/null +++ b/docs/models/operations/DeleteApiKeyPairResponse.md @@ -0,0 +1,10 @@ +# DeleteApiKeyPairResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetApiKeyPairRequest.md b/docs/models/operations/GetApiKeyPairRequest.md new file mode 100644 index 00000000..1d137c17 --- /dev/null +++ b/docs/models/operations/GetApiKeyPairRequest.md @@ -0,0 +1,8 @@ +# GetApiKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `apiKeyPairId` | *String* | :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/operations/GetApiKeyPairResponse.md b/docs/models/operations/GetApiKeyPairResponse.md new file mode 100644 index 00000000..9c60f7bf --- /dev/null +++ b/docs/models/operations/GetApiKeyPairResponse.md @@ -0,0 +1,11 @@ +# GetApiKeyPairResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiKeyPair` | [Optional\](../../models/components/APIKeyPair.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/GetMerchantAccountResponse.md b/docs/models/operations/GetMerchantAccountResponse.md index eaa2005b..04a4442b 100644 --- a/docs/models/operations/GetMerchantAccountResponse.md +++ b/docs/models/operations/GetMerchantAccountResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `merchantAccount` | [Optional\](../../models/components/MerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiRoutersMerchantAccountsSchemasMerchantAccount` | [Optional\](../../models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/ListApiKeyPairsRequest.md b/docs/models/operations/ListApiKeyPairsRequest.md new file mode 100644 index 00000000..47581e23 --- /dev/null +++ b/docs/models/operations/ListApiKeyPairsRequest.md @@ -0,0 +1,9 @@ +# ListApiKeyPairsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | +| `limit` | *Optional\* | :heavy_minus_sign: | The maximum number of items that are returned. | 20 | \ No newline at end of file diff --git a/docs/models/operations/ListApiKeyPairsResponse.md b/docs/models/operations/ListApiKeyPairsResponse.md new file mode 100644 index 00000000..180a2007 --- /dev/null +++ b/docs/models/operations/ListApiKeyPairsResponse.md @@ -0,0 +1,11 @@ +# ListApiKeyPairsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `collectionAPIKeyPair` | [Optional\](../../models/components/CollectionAPIKeyPair.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/UpdateApiKeyPairRequest.md b/docs/models/operations/UpdateApiKeyPairRequest.md new file mode 100644 index 00000000..a01a43c7 --- /dev/null +++ b/docs/models/operations/UpdateApiKeyPairRequest.md @@ -0,0 +1,9 @@ +# UpdateApiKeyPairRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `apiKeyPairId` | *String* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `apiKeyPairUpdate` | [APIKeyPairUpdate](../../models/components/APIKeyPairUpdate.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/UpdateApiKeyPairResponse.md b/docs/models/operations/UpdateApiKeyPairResponse.md new file mode 100644 index 00000000..69ad924b --- /dev/null +++ b/docs/models/operations/UpdateApiKeyPairResponse.md @@ -0,0 +1,11 @@ +# UpdateApiKeyPairResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiKeyPair` | [Optional\](../../models/components/APIKeyPair.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/models/operations/UpdateMerchantAccountResponse.md b/docs/models/operations/UpdateMerchantAccountResponse.md index 9e5f6fa5..ea3eb750 100644 --- a/docs/models/operations/UpdateMerchantAccountResponse.md +++ b/docs/models/operations/UpdateMerchantAccountResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `merchantAccount` | [Optional\](../../models/components/MerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `apiRoutersMerchantAccountsSchemasMerchantAccount` | [Optional\](../../models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.md) | :heavy_minus_sign: | Successful Response | \ 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..3762a4a1 --- /dev/null +++ b/docs/sdks/apikeypairs/README.md @@ -0,0 +1,333 @@ +# 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 + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + + sdk.apiKeyPairs().list() + .limit(20L) + .callAsStream() + .forEach((ListApiKeyPairsResponse item) -> { + // handle page + }); + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | +| `limit` | *Optional\* | :heavy_minus_sign: | The maximum number of items that are returned. | 20 | + +### Response + +**[ListApiKeyPairsResponse](../../models/operations/ListApiKeyPairsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## create + +Create a new API key pair. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.CreateApiKeyPairResponse; +import java.lang.Exception; +import java.util.List; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + APIKeyPairCreate req = APIKeyPairCreate.builder() + .displayName("Production key") + .roleIds(List.of( + "8f4b8c1a-1b2c-4d3e-9f5a-6b7c8d9e0f1a")) + .build(); + + CreateApiKeyPairResponse res = sdk.apiKeyPairs().create() + .request(req) + .call(); + + if (res.apiKeyPair().isPresent()) { + System.out.println(res.apiKeyPair().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `request` | [APIKeyPairCreate](../../models/shared/APIKeyPairCreate.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateApiKeyPairResponse](../../models/operations/CreateApiKeyPairResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## get + +Fetches an API key pair by its ID. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.GetApiKeyPairResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + GetApiKeyPairResponse res = sdk.apiKeyPairs().get() + .apiKeyPairId("fe26475d-ec3e-4884-9553-f7356683f7f9") + .call(); + + if (res.apiKeyPair().isPresent()) { + System.out.println(res.apiKeyPair().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `apiKeyPairId` | *String* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | + +### Response + +**[GetApiKeyPairResponse](../../models/operations/GetApiKeyPairResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## update + +Updates an API key pair. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + UpdateApiKeyPairResponse res = sdk.apiKeyPairs().update() + .apiKeyPairId("fe26475d-ec3e-4884-9553-f7356683f7f9") + .apiKeyPairUpdate(APIKeyPairUpdate.builder() + .build()) + .call(); + + if (res.apiKeyPair().isPresent()) { + System.out.println(res.apiKeyPair().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `apiKeyPairId` | *String* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | +| `apiKeyPairUpdate` | [APIKeyPairUpdate](../../models/components/APIKeyPairUpdate.md) | :heavy_check_mark: | N/A | | + +### Response + +**[UpdateApiKeyPairResponse](../../models/operations/UpdateApiKeyPairResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## delete + +Permanently removes an API key pair. + +### Example Usage + + +```java +package hello.world; + +import com.gr4vy.sdk.Gr4vy; +import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws Exception { + + Gr4vy sdk = Gr4vy.builder() + .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) + .build(); + + DeleteApiKeyPairResponse res = sdk.apiKeyPairs().delete() + .apiKeyPairId("fe26475d-ec3e-4884-9553-f7356683f7f9") + .call(); + + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `apiKeyPairId` | *String* | :heavy_check_mark: | The ID of the API key pair. | fe26475d-ec3e-4884-9553-f7356683f7f9 | + +### Response + +**[DeleteApiKeyPairResponse](../../models/operations/DeleteApiKeyPairResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/Error400 | 400 | application/json | +| models/errors/Error401 | 401 | application/json | +| models/errors/Error403 | 403 | application/json | +| models/errors/Error404 | 404 | application/json | +| models/errors/Error405 | 405 | application/json | +| models/errors/Error409 | 409 | application/json | +| models/errors/HTTPValidationError | 422 | application/json | +| models/errors/Error425 | 425 | application/json | +| models/errors/Error429 | 429 | application/json | +| models/errors/Error500 | 500 | application/json | +| models/errors/Error502 | 502 | application/json | +| models/errors/Error504 | 504 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/merchantaccounts/README.md b/docs/sdks/merchantaccounts/README.md index f75d3364..94703d66 100644 --- a/docs/sdks/merchantaccounts/README.md +++ b/docs/sdks/merchantaccounts/README.md @@ -111,8 +111,8 @@ public class Application { .request(req) .call(); - if (res.merchantAccount().isPresent()) { - System.out.println(res.merchantAccount().get()); + if (res.apiRoutersMerchantAccountsSchemasMerchantAccount().isPresent()) { + System.out.println(res.apiRoutersMerchantAccountsSchemasMerchantAccount().get()); } } } @@ -173,8 +173,8 @@ public class Application { .merchantAccountId("merchant-12345") .call(); - if (res.merchantAccount().isPresent()) { - System.out.println(res.merchantAccount().get()); + if (res.apiRoutersMerchantAccountsSchemasMerchantAccount().isPresent()) { + System.out.println(res.apiRoutersMerchantAccountsSchemasMerchantAccount().get()); } } } @@ -240,8 +240,8 @@ public class Application { .build()) .call(); - if (res.merchantAccount().isPresent()) { - System.out.println(res.merchantAccount().get()); + if (res.apiRoutersMerchantAccountsSchemasMerchantAccount().isPresent()) { + System.out.println(res.apiRoutersMerchantAccountsSchemasMerchantAccount().get()); } } } diff --git a/gradle.properties b/gradle.properties index ccfcf41d..29be94aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.gr4vy artifactId=sdk -version=2.16.101 +version=2.16.102 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/gr4vy/sdk/ApiKeyPairs.java b/src/main/java/com/gr4vy/sdk/ApiKeyPairs.java new file mode 100644 index 00000000..63576898 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/ApiKeyPairs.java @@ -0,0 +1,239 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.models.operations.CreateApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.CreateApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.GetApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.GetApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.GetApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsRequest; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsRequestBuilder; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairResponse; +import com.gr4vy.sdk.operations.CreateApiKeyPair; +import com.gr4vy.sdk.operations.DeleteApiKeyPair; +import com.gr4vy.sdk.operations.GetApiKeyPair; +import com.gr4vy.sdk.operations.ListApiKeyPairs; +import com.gr4vy.sdk.operations.UpdateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ApiKeyPairs { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncApiKeyPairs asyncSDK; + + ApiKeyPairs(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncApiKeyPairs(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncApiKeyPairs async() { + return asyncSDK; + } + + /** + * List all API key pairs + * + *

List all API key pairs. + * + * @return The call builder + */ + public ListApiKeyPairsRequestBuilder list() { + return new ListApiKeyPairsRequestBuilder(sdkConfiguration); + } + + /** + * List all API key pairs + * + *

List all API key pairs. + * + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public ListApiKeyPairsResponse listDirect() { + return list(JsonNullable.undefined(), Optional.empty(), Optional.empty()); + } + + /** + * 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 options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public ListApiKeyPairsResponse list( + JsonNullable cursor, Optional limit, + Optional options) { + ListApiKeyPairsRequest request = + ListApiKeyPairsRequest + .builder() + .cursor(cursor) + .limit(limit) + .build(); + RequestOperation operation + = new ListApiKeyPairs.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Create an API key pair + * + *

Create a new API key pair. + * + * @return The call builder + */ + public CreateApiKeyPairRequestBuilder create() { + return new CreateApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Create an API key pair + * + *

Create a new API key pair. + * + * @param request The request object containing all the parameters for the API call. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public CreateApiKeyPairResponse create(APIKeyPairCreate request) { + RequestOperation operation + = new CreateApiKeyPair.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @return The call builder + */ + public GetApiKeyPairRequestBuilder get() { + return new GetApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @param apiKeyPairId The ID of the API key pair. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public GetApiKeyPairResponse get(String apiKeyPairId) { + return get(apiKeyPairId, Optional.empty()); + } + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @param apiKeyPairId The ID of the API key pair. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public GetApiKeyPairResponse get(String apiKeyPairId, Optional options) { + GetApiKeyPairRequest request = + GetApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .build(); + RequestOperation operation + = new GetApiKeyPair.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Update an API key pair + * + *

Updates an API key pair. + * + * @return The call builder + */ + public UpdateApiKeyPairRequestBuilder update() { + return new UpdateApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Update an API key pair + * + *

Updates an API key pair. + * + * @param apiKeyPairId The ID of the API key pair. + * @param apiKeyPairUpdate + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public UpdateApiKeyPairResponse update(String apiKeyPairId, APIKeyPairUpdate apiKeyPairUpdate) { + UpdateApiKeyPairRequest request = + UpdateApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .apiKeyPairUpdate(apiKeyPairUpdate) + .build(); + RequestOperation operation + = new UpdateApiKeyPair.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Delete an API key pair + * + *

Permanently removes an API key pair. + * + * @return The call builder + */ + public DeleteApiKeyPairRequestBuilder delete() { + return new DeleteApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Delete an API key pair + * + *

Permanently removes an API key pair. + * + * @param apiKeyPairId The ID of the API key pair. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public DeleteApiKeyPairResponse delete(String apiKeyPairId) { + DeleteApiKeyPairRequest request = + DeleteApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .build(); + RequestOperation operation + = new DeleteApiKeyPair.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/gr4vy/sdk/AsyncApiKeyPairs.java b/src/main/java/com/gr4vy/sdk/AsyncApiKeyPairs.java new file mode 100644 index 00000000..ea651883 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/AsyncApiKeyPairs.java @@ -0,0 +1,247 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.GetApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsRequest; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.async.CreateApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.async.CreateApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.async.DeleteApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.async.DeleteApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.async.GetApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.async.GetApiKeyPairResponse; +import com.gr4vy.sdk.models.operations.async.ListApiKeyPairsRequestBuilder; +import com.gr4vy.sdk.models.operations.async.ListApiKeyPairsResponse; +import com.gr4vy.sdk.models.operations.async.UpdateApiKeyPairRequestBuilder; +import com.gr4vy.sdk.models.operations.async.UpdateApiKeyPairResponse; +import com.gr4vy.sdk.operations.CreateApiKeyPair; +import com.gr4vy.sdk.operations.DeleteApiKeyPair; +import com.gr4vy.sdk.operations.GetApiKeyPair; +import com.gr4vy.sdk.operations.ListApiKeyPairs; +import com.gr4vy.sdk.operations.UpdateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AsyncApiKeyPairs { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final ApiKeyPairs syncSDK; + + AsyncApiKeyPairs(ApiKeyPairs syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public ApiKeyPairs sync() { + return syncSDK; + } + + + /** + * List all API key pairs + * + *

List all API key pairs. + * + * @return The async call builder + */ + public ListApiKeyPairsRequestBuilder list() { + return new ListApiKeyPairsRequestBuilder(sdkConfiguration); + } + + /** + * List all API key pairs + * + *

List all API key pairs. + * + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture listDirect() { + return list(JsonNullable.undefined(), Optional.empty(), Optional.empty()); + } + + /** + * 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 options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list( + JsonNullable cursor, Optional limit, + Optional options) { + ListApiKeyPairsRequest request = + ListApiKeyPairsRequest + .builder() + .cursor(cursor) + .limit(limit) + .build(); + AsyncRequestOperation operation + = new ListApiKeyPairs.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Create an API key pair + * + *

Create a new API key pair. + * + * @return The async call builder + */ + public CreateApiKeyPairRequestBuilder create() { + return new CreateApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Create an API key pair + * + *

Create a new API key pair. + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(APIKeyPairCreate request) { + AsyncRequestOperation operation + = new CreateApiKeyPair.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @return The async call builder + */ + public GetApiKeyPairRequestBuilder get() { + return new GetApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @param apiKeyPairId The ID of the API key pair. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(String apiKeyPairId) { + return get(apiKeyPairId, Optional.empty()); + } + + /** + * Get an API key pair + * + *

Fetches an API key pair by its ID. + * + * @param apiKeyPairId The ID of the API key pair. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(String apiKeyPairId, Optional options) { + GetApiKeyPairRequest request = + GetApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .build(); + AsyncRequestOperation operation + = new GetApiKeyPair.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update an API key pair + * + *

Updates an API key pair. + * + * @return The async call builder + */ + public UpdateApiKeyPairRequestBuilder update() { + return new UpdateApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Update an API key pair + * + *

Updates an API key pair. + * + * @param apiKeyPairId The ID of the API key pair. + * @param apiKeyPairUpdate + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(String apiKeyPairId, APIKeyPairUpdate apiKeyPairUpdate) { + UpdateApiKeyPairRequest request = + UpdateApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .apiKeyPairUpdate(apiKeyPairUpdate) + .build(); + AsyncRequestOperation operation + = new UpdateApiKeyPair.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete an API key pair + * + *

Permanently removes an API key pair. + * + * @return The async call builder + */ + public DeleteApiKeyPairRequestBuilder delete() { + return new DeleteApiKeyPairRequestBuilder(sdkConfiguration); + } + + /** + * Delete an API key pair + * + *

Permanently removes an API key pair. + * + * @param apiKeyPairId The ID of the API key pair. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(String apiKeyPairId) { + DeleteApiKeyPairRequest request = + DeleteApiKeyPairRequest + .builder() + .apiKeyPairId(apiKeyPairId) + .build(); + AsyncRequestOperation operation + = new DeleteApiKeyPair.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/gr4vy/sdk/AsyncGr4vy.java b/src/main/java/com/gr4vy/sdk/AsyncGr4vy.java index d0751378..59bfd5b6 100644 --- a/src/main/java/com/gr4vy/sdk/AsyncGr4vy.java +++ b/src/main/java/com/gr4vy/sdk/AsyncGr4vy.java @@ -13,6 +13,8 @@ public class AsyncGr4vy { private final AsyncAccountUpdater accountUpdater; + private final AsyncApiKeyPairs apiKeyPairs; + private final AsyncBuyers buyers; private final AsyncPaymentMethods paymentMethods; @@ -53,6 +55,10 @@ public AsyncAccountUpdater accountUpdater() { return accountUpdater; } + public AsyncApiKeyPairs apiKeyPairs() { + return apiKeyPairs; + } + public AsyncBuyers buyers() { return buyers; } @@ -132,6 +138,7 @@ public AsyncPaymentLinks paymentLinks() { this.syncSDK = syncSDK; this.sdkConfiguration = sdkConfiguration; this.accountUpdater = new AsyncAccountUpdater(syncSDK.accountUpdater(), sdkConfiguration); + this.apiKeyPairs = new AsyncApiKeyPairs(syncSDK.apiKeyPairs(), sdkConfiguration); this.buyers = new AsyncBuyers(syncSDK.buyers(), sdkConfiguration); this.paymentMethods = new AsyncPaymentMethods(syncSDK.paymentMethods(), sdkConfiguration); this.giftCards = new AsyncGiftCards(syncSDK.giftCards(), sdkConfiguration); diff --git a/src/main/java/com/gr4vy/sdk/Gr4vy.java b/src/main/java/com/gr4vy/sdk/Gr4vy.java index f7d963e6..8f82bd1d 100644 --- a/src/main/java/com/gr4vy/sdk/Gr4vy.java +++ b/src/main/java/com/gr4vy/sdk/Gr4vy.java @@ -55,6 +55,9 @@ public String server() { private final AccountUpdater accountUpdater; + private final ApiKeyPairs apiKeyPairs; + + private final Buyers buyers; @@ -114,6 +117,11 @@ public AccountUpdater accountUpdater() { } + public ApiKeyPairs apiKeyPairs() { + return apiKeyPairs; + } + + public Buyers buyers() { return buyers; } @@ -374,6 +382,7 @@ public static Builder builder() { private Gr4vy(SDKConfiguration sdkConfiguration) { sdkConfiguration.initialize(); this.accountUpdater = new AccountUpdater(sdkConfiguration); + this.apiKeyPairs = new ApiKeyPairs(sdkConfiguration); this.buyers = new Buyers(sdkConfiguration); this.paymentMethods = new PaymentMethods(sdkConfiguration); this.giftCards = new GiftCards(sdkConfiguration); diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java index ae73a2e6..86ad435c 100644 --- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java +++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java @@ -22,8 +22,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "1.0.0"; - public static final String SDK_VERSION = "2.16.101"; - public static final String GEN_VERSION = "2.914.0"; + public static final String SDK_VERSION = "2.16.102"; + public static final String GEN_VERSION = "2.915.1"; private static final String BASE_PACKAGE = "com.gr4vy.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/gr4vy/sdk/models/components/APIKeyPair.java b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPair.java new file mode 100644 index 00000000..0f35c166 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPair.java @@ -0,0 +1,637 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class APIKeyPair { + /** + * The type of this resource. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The ID for the API key pair. + */ + @JsonProperty("id") + private String id; + + /** + * The unique thumbprint that identifies the API key pair. + */ + @JsonProperty("thumbprint") + private String thumbprint; + + /** + * The display name for the API key pair. + */ + @JsonProperty("display_name") + private String displayName; + + + @JsonProperty("algorithm") + private CertificateAlgorithm algorithm; + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + @JsonProperty("active") + private boolean active; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_key") + private JsonNullable privateKey; + + /** + * The date and time when this API key pair was created. + */ + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + /** + * The date and time when this API key pair was last updated. + */ + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + /** + * The user or API key pair that created this API key pair. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("creator") + private JsonNullable creator; + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_accounts") + private Optional> merchantAccounts; + + /** + * The roles assigned to this API key pair. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("roles") + private Optional> roles; + + @JsonCreator + public APIKeyPair( + @JsonProperty("id") String id, + @JsonProperty("thumbprint") String thumbprint, + @JsonProperty("display_name") String displayName, + @JsonProperty("algorithm") CertificateAlgorithm algorithm, + @JsonProperty("active") boolean active, + @JsonProperty("private_key") JsonNullable privateKey, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("creator") JsonNullable creator, + @JsonProperty("merchant_accounts") Optional> merchantAccounts, + @JsonProperty("roles") Optional> roles) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(thumbprint, "thumbprint"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(algorithm, "algorithm"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(privateKey, "privateKey"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(creator, "creator"); + Utils.checkNotNull(merchantAccounts, "merchantAccounts"); + Utils.checkNotNull(roles, "roles"); + this.type = Builder._SINGLETON_VALUE_Type.value(); + this.id = id; + this.thumbprint = thumbprint; + this.displayName = displayName; + this.algorithm = algorithm; + this.active = active; + this.privateKey = privateKey; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.creator = creator; + this.merchantAccounts = merchantAccounts; + this.roles = roles; + } + + public APIKeyPair( + String id, + String thumbprint, + String displayName, + CertificateAlgorithm algorithm, + boolean active, + OffsetDateTime createdAt, + OffsetDateTime updatedAt) { + this(id, thumbprint, displayName, + algorithm, active, JsonNullable.undefined(), + createdAt, updatedAt, JsonNullable.undefined(), + Optional.empty(), Optional.empty()); + } + + /** + * The type of this resource. + */ + @JsonIgnore + public Optional type() { + return type; + } + + /** + * The ID for the API key pair. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * The unique thumbprint that identifies the API key pair. + */ + @JsonIgnore + public String thumbprint() { + return thumbprint; + } + + /** + * The display name for the API key pair. + */ + @JsonIgnore + public String displayName() { + return displayName; + } + + @JsonIgnore + public CertificateAlgorithm algorithm() { + return algorithm; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + @JsonIgnore + public boolean active() { + return active; + } + + /** + * 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. + */ + @JsonIgnore + public JsonNullable privateKey() { + return privateKey; + } + + /** + * The date and time when this API key pair was created. + */ + @JsonIgnore + public OffsetDateTime createdAt() { + return createdAt; + } + + /** + * The date and time when this API key pair was last updated. + */ + @JsonIgnore + public OffsetDateTime updatedAt() { + return updatedAt; + } + + /** + * The user or API key pair that created this API key pair. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable creator() { + return (JsonNullable) creator; + } + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> merchantAccounts() { + return (Optional>) merchantAccounts; + } + + /** + * The roles assigned to this API key pair. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> roles() { + return (Optional>) roles; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID for the API key pair. + */ + public APIKeyPair withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The unique thumbprint that identifies the API key pair. + */ + public APIKeyPair withThumbprint(String thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = thumbprint; + return this; + } + + /** + * The display name for the API key pair. + */ + public APIKeyPair withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public APIKeyPair withAlgorithm(CertificateAlgorithm algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = algorithm; + return this; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public APIKeyPair withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + /** + * 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. + */ + public APIKeyPair withPrivateKey(String privateKey) { + Utils.checkNotNull(privateKey, "privateKey"); + this.privateKey = JsonNullable.of(privateKey); + return this; + } + + /** + * 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. + */ + public APIKeyPair withPrivateKey(JsonNullable privateKey) { + Utils.checkNotNull(privateKey, "privateKey"); + this.privateKey = privateKey; + return this; + } + + /** + * The date and time when this API key pair was created. + */ + public APIKeyPair withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this API key pair was last updated. + */ + public APIKeyPair withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * The user or API key pair that created this API key pair. + */ + public APIKeyPair withCreator(ApiRoutersApiKeyPairsSchemasCreator creator) { + Utils.checkNotNull(creator, "creator"); + this.creator = JsonNullable.of(creator); + return this; + } + + /** + * The user or API key pair that created this API key pair. + */ + public APIKeyPair withCreator(JsonNullable creator) { + Utils.checkNotNull(creator, "creator"); + this.creator = creator; + return this; + } + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + public APIKeyPair withMerchantAccounts(List merchantAccounts) { + Utils.checkNotNull(merchantAccounts, "merchantAccounts"); + this.merchantAccounts = Optional.ofNullable(merchantAccounts); + return this; + } + + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + public APIKeyPair withMerchantAccounts(Optional> merchantAccounts) { + Utils.checkNotNull(merchantAccounts, "merchantAccounts"); + this.merchantAccounts = merchantAccounts; + return this; + } + + /** + * The roles assigned to this API key pair. + */ + public APIKeyPair withRoles(List roles) { + Utils.checkNotNull(roles, "roles"); + this.roles = Optional.ofNullable(roles); + return this; + } + + + /** + * The roles assigned to this API key pair. + */ + public APIKeyPair withRoles(Optional> roles) { + Utils.checkNotNull(roles, "roles"); + this.roles = roles; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKeyPair other = (APIKeyPair) o; + return + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.thumbprint, other.thumbprint) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.algorithm, other.algorithm) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.privateKey, other.privateKey) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.creator, other.creator) && + Utils.enhancedDeepEquals(this.merchantAccounts, other.merchantAccounts) && + Utils.enhancedDeepEquals(this.roles, other.roles); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type, id, thumbprint, + displayName, algorithm, active, + privateKey, createdAt, updatedAt, + creator, merchantAccounts, roles); + } + + @Override + public String toString() { + return Utils.toString(APIKeyPair.class, + "type", type, + "id", id, + "thumbprint", thumbprint, + "displayName", displayName, + "algorithm", algorithm, + "active", active, + "privateKey", privateKey, + "createdAt", createdAt, + "updatedAt", updatedAt, + "creator", creator, + "merchantAccounts", merchantAccounts, + "roles", roles); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private String thumbprint; + + private String displayName; + + private CertificateAlgorithm algorithm; + + private Boolean active; + + private JsonNullable privateKey = JsonNullable.undefined(); + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private JsonNullable creator = JsonNullable.undefined(); + + private Optional> merchantAccounts = Optional.empty(); + + private Optional> roles = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID for the API key pair. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The unique thumbprint that identifies the API key pair. + */ + public Builder thumbprint(String thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = thumbprint; + return this; + } + + + /** + * The display name for the API key pair. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + public Builder algorithm(CertificateAlgorithm algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = algorithm; + return this; + } + + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + + /** + * 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. + */ + public Builder privateKey(String privateKey) { + Utils.checkNotNull(privateKey, "privateKey"); + this.privateKey = JsonNullable.of(privateKey); + return this; + } + + /** + * 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. + */ + public Builder privateKey(JsonNullable privateKey) { + Utils.checkNotNull(privateKey, "privateKey"); + this.privateKey = privateKey; + return this; + } + + + /** + * The date and time when this API key pair was created. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * The date and time when this API key pair was last updated. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + /** + * The user or API key pair that created this API key pair. + */ + public Builder creator(ApiRoutersApiKeyPairsSchemasCreator creator) { + Utils.checkNotNull(creator, "creator"); + this.creator = JsonNullable.of(creator); + return this; + } + + /** + * The user or API key pair that created this API key pair. + */ + public Builder creator(JsonNullable creator) { + Utils.checkNotNull(creator, "creator"); + this.creator = creator; + return this; + } + + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + public Builder merchantAccounts(List merchantAccounts) { + Utils.checkNotNull(merchantAccounts, "merchantAccounts"); + this.merchantAccounts = Optional.ofNullable(merchantAccounts); + return this; + } + + /** + * The merchant accounts this API key pair has access to. An empty list means it has access to all + * merchant accounts. + */ + public Builder merchantAccounts(Optional> merchantAccounts) { + Utils.checkNotNull(merchantAccounts, "merchantAccounts"); + this.merchantAccounts = merchantAccounts; + return this; + } + + + /** + * The roles assigned to this API key pair. + */ + public Builder roles(List roles) { + Utils.checkNotNull(roles, "roles"); + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + * The roles assigned to this API key pair. + */ + public Builder roles(Optional> roles) { + Utils.checkNotNull(roles, "roles"); + this.roles = roles; + return this; + } + + public APIKeyPair build() { + + return new APIKeyPair( + id, thumbprint, displayName, + algorithm, active, privateKey, + createdAt, updatedAt, creator, + merchantAccounts, roles); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"api-key-pair\"", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairCreate.java b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairCreate.java new file mode 100644 index 00000000..25167bbf --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairCreate.java @@ -0,0 +1,408 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class APIKeyPairCreate { + /** + * The display name for the API key pair. + */ + @JsonProperty("display_name") + private String displayName; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("algorithm") + private Optional algorithm; + + /** + * Whether the API key pair should be active and usable once created. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("active") + private Optional active; + + /** + * 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. + */ + @JsonProperty("role_ids") + private List roleIds; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_account_ids") + private Optional> merchantAccountIds; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_key") + private JsonNullable publicKey; + + @JsonCreator + public APIKeyPairCreate( + @JsonProperty("display_name") String displayName, + @JsonProperty("algorithm") Optional algorithm, + @JsonProperty("active") Optional active, + @JsonProperty("role_ids") List roleIds, + @JsonProperty("merchant_account_ids") Optional> merchantAccountIds, + @JsonProperty("public_key") JsonNullable publicKey) { + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(algorithm, "algorithm"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(roleIds, "roleIds"); + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + Utils.checkNotNull(publicKey, "publicKey"); + this.displayName = displayName; + this.algorithm = algorithm; + this.active = active; + this.roleIds = roleIds; + this.merchantAccountIds = merchantAccountIds; + this.publicKey = publicKey; + } + + public APIKeyPairCreate( + String displayName, + List roleIds) { + this(displayName, Optional.empty(), Optional.empty(), + roleIds, Optional.empty(), JsonNullable.undefined()); + } + + /** + * The display name for the API key pair. + */ + @JsonIgnore + public String displayName() { + return displayName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional algorithm() { + return (Optional) algorithm; + } + + /** + * Whether the API key pair should be active and usable once created. + */ + @JsonIgnore + public Optional active() { + return active; + } + + /** + * 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. + */ + @JsonIgnore + public List roleIds() { + return roleIds; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> merchantAccountIds() { + return (Optional>) merchantAccountIds; + } + + /** + * 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. + */ + @JsonIgnore + public JsonNullable publicKey() { + return publicKey; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The display name for the API key pair. + */ + public APIKeyPairCreate withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public APIKeyPairCreate withAlgorithm(CertificateAlgorithm algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = Optional.ofNullable(algorithm); + return this; + } + + + public APIKeyPairCreate withAlgorithm(Optional algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = algorithm; + return this; + } + + /** + * Whether the API key pair should be active and usable once created. + */ + public APIKeyPairCreate withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = Optional.ofNullable(active); + return this; + } + + + /** + * Whether the API key pair should be active and usable once created. + */ + public APIKeyPairCreate withActive(Optional active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + /** + * 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. + */ + public APIKeyPairCreate withRoleIds(List roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = roleIds; + return this; + } + + /** + * 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 APIKeyPairCreate withMerchantAccountIds(List merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = Optional.ofNullable(merchantAccountIds); + return this; + } + + + /** + * 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 APIKeyPairCreate withMerchantAccountIds(Optional> merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = merchantAccountIds; + return this; + } + + /** + * 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. + */ + public APIKeyPairCreate withPublicKey(String publicKey) { + Utils.checkNotNull(publicKey, "publicKey"); + this.publicKey = JsonNullable.of(publicKey); + return this; + } + + /** + * 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. + */ + public APIKeyPairCreate withPublicKey(JsonNullable publicKey) { + Utils.checkNotNull(publicKey, "publicKey"); + this.publicKey = publicKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKeyPairCreate other = (APIKeyPairCreate) o; + return + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.algorithm, other.algorithm) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.roleIds, other.roleIds) && + Utils.enhancedDeepEquals(this.merchantAccountIds, other.merchantAccountIds) && + Utils.enhancedDeepEquals(this.publicKey, other.publicKey); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayName, algorithm, active, + roleIds, merchantAccountIds, publicKey); + } + + @Override + public String toString() { + return Utils.toString(APIKeyPairCreate.class, + "displayName", displayName, + "algorithm", algorithm, + "active", active, + "roleIds", roleIds, + "merchantAccountIds", merchantAccountIds, + "publicKey", publicKey); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String displayName; + + private Optional algorithm = Optional.empty(); + + private Optional active; + + private List roleIds; + + private Optional> merchantAccountIds = Optional.empty(); + + private JsonNullable publicKey = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The display name for the API key pair. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + public Builder algorithm(CertificateAlgorithm algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = Optional.ofNullable(algorithm); + return this; + } + + public Builder algorithm(Optional algorithm) { + Utils.checkNotNull(algorithm, "algorithm"); + this.algorithm = algorithm; + return this; + } + + + /** + * Whether the API key pair should be active and usable once created. + */ + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = Optional.ofNullable(active); + return this; + } + + /** + * Whether the API key pair should be active and usable once created. + */ + public Builder active(Optional active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + + /** + * 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. + */ + public Builder roleIds(List roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = roleIds; + return this; + } + + + /** + * 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 Builder merchantAccountIds(List merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = Optional.ofNullable(merchantAccountIds); + return this; + } + + /** + * 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 Builder merchantAccountIds(Optional> merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = merchantAccountIds; + return this; + } + + + /** + * 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. + */ + public Builder publicKey(String publicKey) { + Utils.checkNotNull(publicKey, "publicKey"); + this.publicKey = JsonNullable.of(publicKey); + return this; + } + + /** + * 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. + */ + public Builder publicKey(JsonNullable publicKey) { + Utils.checkNotNull(publicKey, "publicKey"); + this.publicKey = publicKey; + return this; + } + + public APIKeyPairCreate build() { + if (active == null) { + active = _SINGLETON_VALUE_Active.value(); + } + + return new APIKeyPairCreate( + displayName, algorithm, active, + roleIds, merchantAccountIds, publicKey); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Active = + new LazySingletonValue<>( + "active", + "true", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairUpdate.java b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairUpdate.java new file mode 100644 index 00000000..7848e7ab --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/APIKeyPairUpdate.java @@ -0,0 +1,301 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class APIKeyPairUpdate { + /** + * The display name for the API key pair. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_name") + private JsonNullable displayName; + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("active") + private JsonNullable active; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("role_ids") + private JsonNullable> roleIds; + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchant_account_ids") + private JsonNullable> merchantAccountIds; + + @JsonCreator + public APIKeyPairUpdate( + @JsonProperty("display_name") JsonNullable displayName, + @JsonProperty("active") JsonNullable active, + @JsonProperty("role_ids") JsonNullable> roleIds, + @JsonProperty("merchant_account_ids") JsonNullable> merchantAccountIds) { + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(roleIds, "roleIds"); + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.displayName = displayName; + this.active = active; + this.roleIds = roleIds; + this.merchantAccountIds = merchantAccountIds; + } + + public APIKeyPairUpdate() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined()); + } + + /** + * The display name for the API key pair. + */ + @JsonIgnore + public JsonNullable displayName() { + return displayName; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + @JsonIgnore + public JsonNullable active() { + return active; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> roleIds() { + return (JsonNullable>) roleIds; + } + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> merchantAccountIds() { + return (JsonNullable>) merchantAccountIds; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The display name for the API key pair. + */ + public APIKeyPairUpdate withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name for the API key pair. + */ + public APIKeyPairUpdate withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public APIKeyPairUpdate withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = JsonNullable.of(active); + return this; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public APIKeyPairUpdate withActive(JsonNullable active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public APIKeyPairUpdate withRoleIds(List roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = JsonNullable.of(roleIds); + return this; + } + + public APIKeyPairUpdate withRoleIds(JsonNullable> roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = roleIds; + return this; + } + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + public APIKeyPairUpdate withMerchantAccountIds(List merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = JsonNullable.of(merchantAccountIds); + return this; + } + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + public APIKeyPairUpdate withMerchantAccountIds(JsonNullable> merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = merchantAccountIds; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKeyPairUpdate other = (APIKeyPairUpdate) o; + return + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.roleIds, other.roleIds) && + Utils.enhancedDeepEquals(this.merchantAccountIds, other.merchantAccountIds); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayName, active, roleIds, + merchantAccountIds); + } + + @Override + public String toString() { + return Utils.toString(APIKeyPairUpdate.class, + "displayName", displayName, + "active", active, + "roleIds", roleIds, + "merchantAccountIds", merchantAccountIds); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable displayName = JsonNullable.undefined(); + + private JsonNullable active = JsonNullable.undefined(); + + private JsonNullable> roleIds = JsonNullable.undefined(); + + private JsonNullable> merchantAccountIds = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The display name for the API key pair. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name for the API key pair. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = JsonNullable.of(active); + return this; + } + + /** + * Whether the API key pair is active and can be used to authenticate. + */ + public Builder active(JsonNullable active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + + public Builder roleIds(List roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = JsonNullable.of(roleIds); + return this; + } + + public Builder roleIds(JsonNullable> roleIds) { + Utils.checkNotNull(roleIds, "roleIds"); + this.roleIds = roleIds; + return this; + } + + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + public Builder merchantAccountIds(List merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = JsonNullable.of(merchantAccountIds); + return this; + } + + /** + * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign + * merchant accounts it has access to. + */ + public Builder merchantAccountIds(JsonNullable> merchantAccountIds) { + Utils.checkNotNull(merchantAccountIds, "merchantAccountIds"); + this.merchantAccountIds = merchantAccountIds; + return this; + } + + public APIKeyPairUpdate build() { + + return new APIKeyPairUpdate( + displayName, active, roleIds, + merchantAccountIds); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/Creator.java b/src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasCreator.java similarity index 86% rename from src/main/java/com/gr4vy/sdk/models/components/Creator.java rename to src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasCreator.java index a051b33a..ddced322 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/Creator.java +++ b/src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasCreator.java @@ -11,7 +11,7 @@ import java.lang.String; -public class Creator { +public class ApiCommonSchemasCreator { @JsonProperty("id") private String id; @@ -25,7 +25,7 @@ public class Creator { private String emailAddress; @JsonCreator - public Creator( + public ApiCommonSchemasCreator( @JsonProperty("id") String id, @JsonProperty("name") String name, @JsonProperty("email_address") String emailAddress) { @@ -57,19 +57,19 @@ public static Builder builder() { } - public Creator withId(String id) { + public ApiCommonSchemasCreator withId(String id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } - public Creator withName(String name) { + public ApiCommonSchemasCreator withName(String name) { Utils.checkNotNull(name, "name"); this.name = name; return this; } - public Creator withEmailAddress(String emailAddress) { + public ApiCommonSchemasCreator withEmailAddress(String emailAddress) { Utils.checkNotNull(emailAddress, "emailAddress"); this.emailAddress = emailAddress; return this; @@ -83,7 +83,7 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Creator other = (Creator) o; + ApiCommonSchemasCreator other = (ApiCommonSchemasCreator) o; return Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.name, other.name) && @@ -98,7 +98,7 @@ public int hashCode() { @Override public String toString() { - return Utils.toString(Creator.class, + return Utils.toString(ApiCommonSchemasCreator.class, "id", id, "name", name, "emailAddress", emailAddress); @@ -138,9 +138,9 @@ public Builder emailAddress(String emailAddress) { return this; } - public Creator build() { + public ApiCommonSchemasCreator build() { - return new Creator( + return new ApiCommonSchemasCreator( id, name, emailAddress); } diff --git a/src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasMerchantAccount.java b/src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasMerchantAccount.java new file mode 100644 index 00000000..f1c442e8 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/ApiCommonSchemasMerchantAccount.java @@ -0,0 +1,300 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ApiCommonSchemasMerchantAccount { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + + @JsonProperty("id") + private String id; + + + @JsonProperty("display_name") + private String displayName; + + + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("over_capture_amount") + private JsonNullable overCaptureAmount; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("over_capture_percentage") + private JsonNullable overCapturePercentage; + + @JsonCreator + public ApiCommonSchemasMerchantAccount( + @JsonProperty("id") String id, + @JsonProperty("display_name") String displayName, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("over_capture_amount") JsonNullable overCaptureAmount, + @JsonProperty("over_capture_percentage") JsonNullable overCapturePercentage) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); + Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); + this.type = Builder._SINGLETON_VALUE_Type.value(); + this.id = id; + this.displayName = displayName; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.overCaptureAmount = overCaptureAmount; + this.overCapturePercentage = overCapturePercentage; + } + + public ApiCommonSchemasMerchantAccount( + String id, + String displayName, + OffsetDateTime createdAt, + OffsetDateTime updatedAt) { + this(id, displayName, createdAt, + updatedAt, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public Optional type() { + return type; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String displayName() { + return displayName; + } + + @JsonIgnore + public OffsetDateTime createdAt() { + return createdAt; + } + + @JsonIgnore + public OffsetDateTime updatedAt() { + return updatedAt; + } + + @JsonIgnore + public JsonNullable overCaptureAmount() { + return overCaptureAmount; + } + + @JsonIgnore + public JsonNullable overCapturePercentage() { + return overCapturePercentage; + } + + public static Builder builder() { + return new Builder(); + } + + + public ApiCommonSchemasMerchantAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public ApiCommonSchemasMerchantAccount withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public ApiCommonSchemasMerchantAccount withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public ApiCommonSchemasMerchantAccount withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public ApiCommonSchemasMerchantAccount withOverCaptureAmount(long overCaptureAmount) { + Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); + this.overCaptureAmount = JsonNullable.of(overCaptureAmount); + return this; + } + + public ApiCommonSchemasMerchantAccount withOverCaptureAmount(JsonNullable overCaptureAmount) { + Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); + this.overCaptureAmount = overCaptureAmount; + return this; + } + + public ApiCommonSchemasMerchantAccount withOverCapturePercentage(long overCapturePercentage) { + Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); + this.overCapturePercentage = JsonNullable.of(overCapturePercentage); + return this; + } + + public ApiCommonSchemasMerchantAccount withOverCapturePercentage(JsonNullable overCapturePercentage) { + Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); + this.overCapturePercentage = overCapturePercentage; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiCommonSchemasMerchantAccount other = (ApiCommonSchemasMerchantAccount) o; + return + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.overCaptureAmount, other.overCaptureAmount) && + Utils.enhancedDeepEquals(this.overCapturePercentage, other.overCapturePercentage); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type, id, displayName, + createdAt, updatedAt, overCaptureAmount, + overCapturePercentage); + } + + @Override + public String toString() { + return Utils.toString(ApiCommonSchemasMerchantAccount.class, + "type", type, + "id", id, + "displayName", displayName, + "createdAt", createdAt, + "updatedAt", updatedAt, + "overCaptureAmount", overCaptureAmount, + "overCapturePercentage", overCapturePercentage); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private String displayName; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private JsonNullable overCaptureAmount = JsonNullable.undefined(); + + private JsonNullable overCapturePercentage = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + public Builder overCaptureAmount(long overCaptureAmount) { + Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); + this.overCaptureAmount = JsonNullable.of(overCaptureAmount); + return this; + } + + public Builder overCaptureAmount(JsonNullable overCaptureAmount) { + Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); + this.overCaptureAmount = overCaptureAmount; + return this; + } + + + public Builder overCapturePercentage(long overCapturePercentage) { + Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); + this.overCapturePercentage = JsonNullable.of(overCapturePercentage); + return this; + } + + public Builder overCapturePercentage(JsonNullable overCapturePercentage) { + Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); + this.overCapturePercentage = overCapturePercentage; + return this; + } + + public ApiCommonSchemasMerchantAccount build() { + + return new ApiCommonSchemasMerchantAccount( + id, displayName, createdAt, + updatedAt, overCaptureAmount, overCapturePercentage); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"merchant-account\"", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/ApiRoutersApiKeyPairsSchemasCreator.java b/src/main/java/com/gr4vy/sdk/models/components/ApiRoutersApiKeyPairsSchemasCreator.java new file mode 100644 index 00000000..d7cec970 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/ApiRoutersApiKeyPairsSchemasCreator.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ApiRoutersApiKeyPairsSchemasCreator { + /** + * The ID of the user or API key pair that created the API key pair. + */ + @JsonProperty("id") + private String id; + + /** + * The name of the user or API key pair that created the API key pair. + */ + @JsonProperty("name") + private String name; + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private JsonNullable emailAddress; + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("thumbprint") + private JsonNullable thumbprint; + + @JsonCreator + public ApiRoutersApiKeyPairsSchemasCreator( + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("email_address") JsonNullable emailAddress, + @JsonProperty("thumbprint") JsonNullable thumbprint) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(thumbprint, "thumbprint"); + this.id = id; + this.name = name; + this.emailAddress = emailAddress; + this.thumbprint = thumbprint; + } + + public ApiRoutersApiKeyPairsSchemasCreator( + String id, + String name) { + this(id, name, JsonNullable.undefined(), + JsonNullable.undefined()); + } + + /** + * The ID of the user or API key pair that created the API key pair. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * The name of the user or API key pair that created the API key pair. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + @JsonIgnore + public JsonNullable emailAddress() { + return emailAddress; + } + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + @JsonIgnore + public JsonNullable thumbprint() { + return thumbprint; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the user or API key pair that created the API key pair. + */ + public ApiRoutersApiKeyPairsSchemasCreator withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the user or API key pair that created the API key pair. + */ + public ApiRoutersApiKeyPairsSchemasCreator withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + public ApiRoutersApiKeyPairsSchemasCreator withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + public ApiRoutersApiKeyPairsSchemasCreator withEmailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + public ApiRoutersApiKeyPairsSchemasCreator withThumbprint(String thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = JsonNullable.of(thumbprint); + return this; + } + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + public ApiRoutersApiKeyPairsSchemasCreator withThumbprint(JsonNullable thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = thumbprint; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiRoutersApiKeyPairsSchemasCreator other = (ApiRoutersApiKeyPairsSchemasCreator) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.emailAddress, other.emailAddress) && + Utils.enhancedDeepEquals(this.thumbprint, other.thumbprint); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, name, emailAddress, + thumbprint); + } + + @Override + public String toString() { + return Utils.toString(ApiRoutersApiKeyPairsSchemasCreator.class, + "id", id, + "name", name, + "emailAddress", emailAddress, + "thumbprint", thumbprint); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private String name; + + private JsonNullable emailAddress = JsonNullable.undefined(); + + private JsonNullable thumbprint = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the user or API key pair that created the API key pair. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The name of the user or API key pair that created the API key pair. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * The email address of the user that created the API key pair, when it was created by a dashboard + * user. + */ + public Builder emailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + public Builder thumbprint(String thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = JsonNullable.of(thumbprint); + return this; + } + + /** + * The thumbprint of the API key pair that created the API key pair, when it was created by another API + * key. + */ + public Builder thumbprint(JsonNullable thumbprint) { + Utils.checkNotNull(thumbprint, "thumbprint"); + this.thumbprint = thumbprint; + return this; + } + + public ApiRoutersApiKeyPairsSchemasCreator build() { + + return new ApiRoutersApiKeyPairsSchemasCreator( + id, name, emailAddress, + thumbprint); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccount.java b/src/main/java/com/gr4vy/sdk/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.java similarity index 92% rename from src/main/java/com/gr4vy/sdk/models/components/MerchantAccount.java rename to src/main/java/com/gr4vy/sdk/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.java index 3b8eca75..a7a5b5ec 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccount.java +++ b/src/main/java/com/gr4vy/sdk/models/components/ApiRoutersMerchantAccountsSchemasMerchantAccount.java @@ -22,7 +22,7 @@ import org.openapitools.jackson.nullable.JsonNullable; -public class MerchantAccount { +public class ApiRoutersMerchantAccountsSchemasMerchantAccount { /** * Always `merchant-account`. */ @@ -219,7 +219,7 @@ public class MerchantAccount { private OffsetDateTime updatedAt; @JsonCreator - public MerchantAccount( + public ApiRoutersMerchantAccountsSchemasMerchantAccount( @JsonProperty("id") String id, @JsonProperty("display_name") String displayName, @JsonProperty("loon_client_key") JsonNullable loonClientKey, @@ -292,7 +292,7 @@ public MerchantAccount( this.updatedAt = updatedAt; } - public MerchantAccount( + public ApiRoutersMerchantAccountsSchemasMerchantAccount( String id, String displayName, boolean accountUpdaterEnabled, @@ -541,7 +541,7 @@ public static Builder builder() { /** * The ID for the merchant account. */ - public MerchantAccount withId(String id) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withId(String id) { Utils.checkNotNull(id, "id"); this.id = id; return this; @@ -550,7 +550,7 @@ public MerchantAccount withId(String id) { /** * The display name for the buyer. */ - public MerchantAccount withDisplayName(String displayName) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withDisplayName(String displayName) { Utils.checkNotNull(displayName, "displayName"); this.displayName = displayName; return this; @@ -561,7 +561,7 @@ public MerchantAccount withDisplayName(String displayName) { * use and if the field is not set or if it's set to null, the Account Updater service doesn't get * configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well. */ - public MerchantAccount withLoonClientKey(String loonClientKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonClientKey(String loonClientKey) { Utils.checkNotNull(loonClientKey, "loonClientKey"); this.loonClientKey = JsonNullable.of(loonClientKey); return this; @@ -572,7 +572,7 @@ public MerchantAccount withLoonClientKey(String loonClientKey) { * use and if the field is not set or if it's set to null, the Account Updater service doesn't get * configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well. */ - public MerchantAccount withLoonClientKey(JsonNullable loonClientKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonClientKey(JsonNullable loonClientKey) { Utils.checkNotNull(loonClientKey, "loonClientKey"); this.loonClientKey = loonClientKey; return this; @@ -583,7 +583,7 @@ public MerchantAccount withLoonClientKey(JsonNullable loonClientKey) { * use and if the field is not set or if it's set to null, the Account Updater service doesn't get * configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well. */ - public MerchantAccount withLoonSecretKey(String loonSecretKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonSecretKey(String loonSecretKey) { Utils.checkNotNull(loonSecretKey, "loonSecretKey"); this.loonSecretKey = JsonNullable.of(loonSecretKey); return this; @@ -594,7 +594,7 @@ public MerchantAccount withLoonSecretKey(String loonSecretKey) { * use and if the field is not set or if it's set to null, the Account Updater service doesn't get * configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well. */ - public MerchantAccount withLoonSecretKey(JsonNullable loonSecretKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonSecretKey(JsonNullable loonSecretKey) { Utils.checkNotNull(loonSecretKey, "loonSecretKey"); this.loonSecretKey = loonSecretKey; return this; @@ -606,7 +606,7 @@ public MerchantAccount withLoonSecretKey(JsonNullable loonSecretKey) { * service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set * to null as well. */ - public MerchantAccount withLoonAcceptedSchemes(List loonAcceptedSchemes) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonAcceptedSchemes(List loonAcceptedSchemes) { Utils.checkNotNull(loonAcceptedSchemes, "loonAcceptedSchemes"); this.loonAcceptedSchemes = JsonNullable.of(loonAcceptedSchemes); return this; @@ -618,7 +618,7 @@ public MerchantAccount withLoonAcceptedSchemes(List loonAcceptedSche * service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set * to null as well. */ - public MerchantAccount withLoonAcceptedSchemes(JsonNullable> loonAcceptedSchemes) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withLoonAcceptedSchemes(JsonNullable> loonAcceptedSchemes) { Utils.checkNotNull(loonAcceptedSchemes, "loonAcceptedSchemes"); this.loonAcceptedSchemes = loonAcceptedSchemes; return this; @@ -631,7 +631,7 @@ public MerchantAccount withLoonAcceptedSchemes(JsonNullableIf the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterRequestEncryptionKey(String accountUpdaterRequestEncryptionKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterRequestEncryptionKey(String accountUpdaterRequestEncryptionKey) { Utils.checkNotNull(accountUpdaterRequestEncryptionKey, "accountUpdaterRequestEncryptionKey"); this.accountUpdaterRequestEncryptionKey = JsonNullable.of(accountUpdaterRequestEncryptionKey); return this; @@ -644,7 +644,7 @@ public MerchantAccount withAccountUpdaterRequestEncryptionKey(String accountUpda * *

If the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterRequestEncryptionKey(JsonNullable accountUpdaterRequestEncryptionKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterRequestEncryptionKey(JsonNullable accountUpdaterRequestEncryptionKey) { Utils.checkNotNull(accountUpdaterRequestEncryptionKey, "accountUpdaterRequestEncryptionKey"); this.accountUpdaterRequestEncryptionKey = accountUpdaterRequestEncryptionKey; return this; @@ -657,7 +657,7 @@ public MerchantAccount withAccountUpdaterRequestEncryptionKey(JsonNullableIf the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterRequestEncryptionKeyId(String accountUpdaterRequestEncryptionKeyId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterRequestEncryptionKeyId(String accountUpdaterRequestEncryptionKeyId) { Utils.checkNotNull(accountUpdaterRequestEncryptionKeyId, "accountUpdaterRequestEncryptionKeyId"); this.accountUpdaterRequestEncryptionKeyId = JsonNullable.of(accountUpdaterRequestEncryptionKeyId); return this; @@ -670,7 +670,7 @@ public MerchantAccount withAccountUpdaterRequestEncryptionKeyId(String accountUp * *

If the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterRequestEncryptionKeyId(JsonNullable accountUpdaterRequestEncryptionKeyId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterRequestEncryptionKeyId(JsonNullable accountUpdaterRequestEncryptionKeyId) { Utils.checkNotNull(accountUpdaterRequestEncryptionKeyId, "accountUpdaterRequestEncryptionKeyId"); this.accountUpdaterRequestEncryptionKeyId = accountUpdaterRequestEncryptionKeyId; return this; @@ -683,7 +683,7 @@ public MerchantAccount withAccountUpdaterRequestEncryptionKeyId(JsonNullableIf the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterResponseDecryptionKey(String accountUpdaterResponseDecryptionKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterResponseDecryptionKey(String accountUpdaterResponseDecryptionKey) { Utils.checkNotNull(accountUpdaterResponseDecryptionKey, "accountUpdaterResponseDecryptionKey"); this.accountUpdaterResponseDecryptionKey = JsonNullable.of(accountUpdaterResponseDecryptionKey); return this; @@ -696,7 +696,7 @@ public MerchantAccount withAccountUpdaterResponseDecryptionKey(String accountUpd * *

If the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterResponseDecryptionKey(JsonNullable accountUpdaterResponseDecryptionKey) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterResponseDecryptionKey(JsonNullable accountUpdaterResponseDecryptionKey) { Utils.checkNotNull(accountUpdaterResponseDecryptionKey, "accountUpdaterResponseDecryptionKey"); this.accountUpdaterResponseDecryptionKey = accountUpdaterResponseDecryptionKey; return this; @@ -709,7 +709,7 @@ public MerchantAccount withAccountUpdaterResponseDecryptionKey(JsonNullableIf the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterResponseDecryptionKeyId(String accountUpdaterResponseDecryptionKeyId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterResponseDecryptionKeyId(String accountUpdaterResponseDecryptionKeyId) { Utils.checkNotNull(accountUpdaterResponseDecryptionKeyId, "accountUpdaterResponseDecryptionKeyId"); this.accountUpdaterResponseDecryptionKeyId = JsonNullable.of(accountUpdaterResponseDecryptionKeyId); return this; @@ -722,7 +722,7 @@ public MerchantAccount withAccountUpdaterResponseDecryptionKeyId(String accountU * *

If the field is set, the other `account_updater_*` fields must be set as well. */ - public MerchantAccount withAccountUpdaterResponseDecryptionKeyId(JsonNullable accountUpdaterResponseDecryptionKeyId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterResponseDecryptionKeyId(JsonNullable accountUpdaterResponseDecryptionKeyId) { Utils.checkNotNull(accountUpdaterResponseDecryptionKeyId, "accountUpdaterResponseDecryptionKeyId"); this.accountUpdaterResponseDecryptionKeyId = accountUpdaterResponseDecryptionKeyId; return this; @@ -737,7 +737,7 @@ public MerchantAccount withAccountUpdaterResponseDecryptionKeyId(JsonNullableIf the field is set to `true`, the service is called. Please note that for this to work the other * `account_updater_* fields` must be set as well. */ - public MerchantAccount withAccountUpdaterEnabled(boolean accountUpdaterEnabled) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAccountUpdaterEnabled(boolean accountUpdaterEnabled) { Utils.checkNotNull(accountUpdaterEnabled, "accountUpdaterEnabled"); this.accountUpdaterEnabled = accountUpdaterEnabled; return this; @@ -747,7 +747,7 @@ public MerchantAccount withAccountUpdaterEnabled(boolean accountUpdaterEnabled) * The maximum monetary amount allowed for over-capture, in the smallest currency unit, for example * `1299` cents to allow for an over-capture of `$12.99`. */ - public MerchantAccount withOverCaptureAmount(long overCaptureAmount) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withOverCaptureAmount(long overCaptureAmount) { Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); this.overCaptureAmount = JsonNullable.of(overCaptureAmount); return this; @@ -757,7 +757,7 @@ public MerchantAccount withOverCaptureAmount(long overCaptureAmount) { * The maximum monetary amount allowed for over-capture, in the smallest currency unit, for example * `1299` cents to allow for an over-capture of `$12.99`. */ - public MerchantAccount withOverCaptureAmount(JsonNullable overCaptureAmount) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withOverCaptureAmount(JsonNullable overCaptureAmount) { Utils.checkNotNull(overCaptureAmount, "overCaptureAmount"); this.overCaptureAmount = overCaptureAmount; return this; @@ -767,7 +767,7 @@ public MerchantAccount withOverCaptureAmount(JsonNullable overCaptureAmoun * The maximum percentage allowed for over-capture, for example `25` to allow for an over-capture of * `25%` of the original transaction amount. */ - public MerchantAccount withOverCapturePercentage(long overCapturePercentage) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withOverCapturePercentage(long overCapturePercentage) { Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); this.overCapturePercentage = JsonNullable.of(overCapturePercentage); return this; @@ -777,7 +777,7 @@ public MerchantAccount withOverCapturePercentage(long overCapturePercentage) { * The maximum percentage allowed for over-capture, for example `25` to allow for an over-capture of * `25%` of the original transaction amount. */ - public MerchantAccount withOverCapturePercentage(JsonNullable overCapturePercentage) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withOverCapturePercentage(JsonNullable overCapturePercentage) { Utils.checkNotNull(overCapturePercentage, "overCapturePercentage"); this.overCapturePercentage = overCapturePercentage; return this; @@ -786,7 +786,7 @@ public MerchantAccount withOverCapturePercentage(JsonNullable overCaptureP /** * Requestor ID provided for Visa after onboarding to use Network Tokens. */ - public MerchantAccount withVisaNetworkTokensRequestorId(String visaNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withVisaNetworkTokensRequestorId(String visaNetworkTokensRequestorId) { Utils.checkNotNull(visaNetworkTokensRequestorId, "visaNetworkTokensRequestorId"); this.visaNetworkTokensRequestorId = JsonNullable.of(visaNetworkTokensRequestorId); return this; @@ -795,7 +795,7 @@ public MerchantAccount withVisaNetworkTokensRequestorId(String visaNetworkTokens /** * Requestor ID provided for Visa after onboarding to use Network Tokens. */ - public MerchantAccount withVisaNetworkTokensRequestorId(JsonNullable visaNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withVisaNetworkTokensRequestorId(JsonNullable visaNetworkTokensRequestorId) { Utils.checkNotNull(visaNetworkTokensRequestorId, "visaNetworkTokensRequestorId"); this.visaNetworkTokensRequestorId = visaNetworkTokensRequestorId; return this; @@ -804,7 +804,7 @@ public MerchantAccount withVisaNetworkTokensRequestorId(JsonNullable vis /** * Application ID provided for Visa after onboarding to use Network Tokens. */ - public MerchantAccount withVisaNetworkTokensAppId(String visaNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withVisaNetworkTokensAppId(String visaNetworkTokensAppId) { Utils.checkNotNull(visaNetworkTokensAppId, "visaNetworkTokensAppId"); this.visaNetworkTokensAppId = JsonNullable.of(visaNetworkTokensAppId); return this; @@ -813,7 +813,7 @@ public MerchantAccount withVisaNetworkTokensAppId(String visaNetworkTokensAppId) /** * Application ID provided for Visa after onboarding to use Network Tokens. */ - public MerchantAccount withVisaNetworkTokensAppId(JsonNullable visaNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withVisaNetworkTokensAppId(JsonNullable visaNetworkTokensAppId) { Utils.checkNotNull(visaNetworkTokensAppId, "visaNetworkTokensAppId"); this.visaNetworkTokensAppId = visaNetworkTokensAppId; return this; @@ -822,7 +822,7 @@ public MerchantAccount withVisaNetworkTokensAppId(JsonNullable visaNetwo /** * Requestor ID provided for American Express after onboarding to use Network Tokens. */ - public MerchantAccount withAmexNetworkTokensRequestorId(String amexNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAmexNetworkTokensRequestorId(String amexNetworkTokensRequestorId) { Utils.checkNotNull(amexNetworkTokensRequestorId, "amexNetworkTokensRequestorId"); this.amexNetworkTokensRequestorId = JsonNullable.of(amexNetworkTokensRequestorId); return this; @@ -831,7 +831,7 @@ public MerchantAccount withAmexNetworkTokensRequestorId(String amexNetworkTokens /** * Requestor ID provided for American Express after onboarding to use Network Tokens. */ - public MerchantAccount withAmexNetworkTokensRequestorId(JsonNullable amexNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAmexNetworkTokensRequestorId(JsonNullable amexNetworkTokensRequestorId) { Utils.checkNotNull(amexNetworkTokensRequestorId, "amexNetworkTokensRequestorId"); this.amexNetworkTokensRequestorId = amexNetworkTokensRequestorId; return this; @@ -840,7 +840,7 @@ public MerchantAccount withAmexNetworkTokensRequestorId(JsonNullable ame /** * Application ID provided for American Express after onboarding to use Network Tokens. */ - public MerchantAccount withAmexNetworkTokensAppId(String amexNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAmexNetworkTokensAppId(String amexNetworkTokensAppId) { Utils.checkNotNull(amexNetworkTokensAppId, "amexNetworkTokensAppId"); this.amexNetworkTokensAppId = JsonNullable.of(amexNetworkTokensAppId); return this; @@ -849,7 +849,7 @@ public MerchantAccount withAmexNetworkTokensAppId(String amexNetworkTokensAppId) /** * Application ID provided for American Express after onboarding to use Network Tokens. */ - public MerchantAccount withAmexNetworkTokensAppId(JsonNullable amexNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAmexNetworkTokensAppId(JsonNullable amexNetworkTokensAppId) { Utils.checkNotNull(amexNetworkTokensAppId, "amexNetworkTokensAppId"); this.amexNetworkTokensAppId = amexNetworkTokensAppId; return this; @@ -858,7 +858,7 @@ public MerchantAccount withAmexNetworkTokensAppId(JsonNullable amexNetwo /** * Requestor ID provided for Mastercard after onboarding to use Network Tokens. */ - public MerchantAccount withMastercardNetworkTokensRequestorId(String mastercardNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withMastercardNetworkTokensRequestorId(String mastercardNetworkTokensRequestorId) { Utils.checkNotNull(mastercardNetworkTokensRequestorId, "mastercardNetworkTokensRequestorId"); this.mastercardNetworkTokensRequestorId = JsonNullable.of(mastercardNetworkTokensRequestorId); return this; @@ -867,7 +867,7 @@ public MerchantAccount withMastercardNetworkTokensRequestorId(String mastercardN /** * Requestor ID provided for Mastercard after onboarding to use Network Tokens. */ - public MerchantAccount withMastercardNetworkTokensRequestorId(JsonNullable mastercardNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withMastercardNetworkTokensRequestorId(JsonNullable mastercardNetworkTokensRequestorId) { Utils.checkNotNull(mastercardNetworkTokensRequestorId, "mastercardNetworkTokensRequestorId"); this.mastercardNetworkTokensRequestorId = mastercardNetworkTokensRequestorId; return this; @@ -876,7 +876,7 @@ public MerchantAccount withMastercardNetworkTokensRequestorId(JsonNullable mastercardNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withMastercardNetworkTokensAppId(JsonNullable mastercardNetworkTokensAppId) { Utils.checkNotNull(mastercardNetworkTokensAppId, "mastercardNetworkTokensAppId"); this.mastercardNetworkTokensAppId = mastercardNetworkTokensAppId; return this; @@ -894,7 +894,7 @@ public MerchantAccount withMastercardNetworkTokensAppId(JsonNullable mas /** * Requestor ID provided for Discover after onboarding to use Network Tokens. */ - public MerchantAccount withDiscoverNetworkTokensRequestorId(String discoverNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withDiscoverNetworkTokensRequestorId(String discoverNetworkTokensRequestorId) { Utils.checkNotNull(discoverNetworkTokensRequestorId, "discoverNetworkTokensRequestorId"); this.discoverNetworkTokensRequestorId = JsonNullable.of(discoverNetworkTokensRequestorId); return this; @@ -903,7 +903,7 @@ public MerchantAccount withDiscoverNetworkTokensRequestorId(String discoverNetwo /** * Requestor ID provided for Discover after onboarding to use Network Tokens. */ - public MerchantAccount withDiscoverNetworkTokensRequestorId(JsonNullable discoverNetworkTokensRequestorId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withDiscoverNetworkTokensRequestorId(JsonNullable discoverNetworkTokensRequestorId) { Utils.checkNotNull(discoverNetworkTokensRequestorId, "discoverNetworkTokensRequestorId"); this.discoverNetworkTokensRequestorId = discoverNetworkTokensRequestorId; return this; @@ -912,7 +912,7 @@ public MerchantAccount withDiscoverNetworkTokensRequestorId(JsonNullable /** * Application ID provided for Discover after onboarding to use Network Tokens. */ - public MerchantAccount withDiscoverNetworkTokensAppId(String discoverNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withDiscoverNetworkTokensAppId(String discoverNetworkTokensAppId) { Utils.checkNotNull(discoverNetworkTokensAppId, "discoverNetworkTokensAppId"); this.discoverNetworkTokensAppId = JsonNullable.of(discoverNetworkTokensAppId); return this; @@ -921,7 +921,7 @@ public MerchantAccount withDiscoverNetworkTokensAppId(String discoverNetworkToke /** * Application ID provided for Discover after onboarding to use Network Tokens. */ - public MerchantAccount withDiscoverNetworkTokensAppId(JsonNullable discoverNetworkTokensAppId) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withDiscoverNetworkTokensAppId(JsonNullable discoverNetworkTokensAppId) { Utils.checkNotNull(discoverNetworkTokensAppId, "discoverNetworkTokensAppId"); this.discoverNetworkTokensAppId = discoverNetworkTokensAppId; return this; @@ -931,7 +931,7 @@ public MerchantAccount withDiscoverNetworkTokensAppId(JsonNullable disco * When enabled network tokens will be generated asynchronously and only used on subsequent * transactions to speed up transaction processing. */ - public MerchantAccount withAsyncNetworkTokensEnabled(boolean asyncNetworkTokensEnabled) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAsyncNetworkTokensEnabled(boolean asyncNetworkTokensEnabled) { Utils.checkNotNull(asyncNetworkTokensEnabled, "asyncNetworkTokensEnabled"); this.asyncNetworkTokensEnabled = Optional.ofNullable(asyncNetworkTokensEnabled); return this; @@ -942,7 +942,7 @@ public MerchantAccount withAsyncNetworkTokensEnabled(boolean asyncNetworkTokensE * When enabled network tokens will be generated asynchronously and only used on subsequent * transactions to speed up transaction processing. */ - public MerchantAccount withAsyncNetworkTokensEnabled(Optional asyncNetworkTokensEnabled) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withAsyncNetworkTokensEnabled(Optional asyncNetworkTokensEnabled) { Utils.checkNotNull(asyncNetworkTokensEnabled, "asyncNetworkTokensEnabled"); this.asyncNetworkTokensEnabled = asyncNetworkTokensEnabled; return this; @@ -951,7 +951,7 @@ public MerchantAccount withAsyncNetworkTokensEnabled(Optional asyncNetw /** * The date this merchant account was created at. */ - public MerchantAccount withCreatedAt(OffsetDateTime createdAt) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withCreatedAt(OffsetDateTime createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; @@ -960,7 +960,7 @@ public MerchantAccount withCreatedAt(OffsetDateTime createdAt) { /** * The date this merchant account was last updated at. */ - public MerchantAccount withUpdatedAt(OffsetDateTime updatedAt) { + public ApiRoutersMerchantAccountsSchemasMerchantAccount withUpdatedAt(OffsetDateTime updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; @@ -974,7 +974,7 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MerchantAccount other = (MerchantAccount) o; + ApiRoutersMerchantAccountsSchemasMerchantAccount other = (ApiRoutersMerchantAccountsSchemasMerchantAccount) o; return Utils.enhancedDeepEquals(this.type, other.type) && Utils.enhancedDeepEquals(this.id, other.id) && @@ -1017,7 +1017,7 @@ public int hashCode() { @Override public String toString() { - return Utils.toString(MerchantAccount.class, + return Utils.toString(ApiRoutersMerchantAccountsSchemasMerchantAccount.class, "type", type, "id", id, "displayName", displayName, @@ -1547,12 +1547,12 @@ public Builder updatedAt(OffsetDateTime updatedAt) { return this; } - public MerchantAccount build() { + public ApiRoutersMerchantAccountsSchemasMerchantAccount build() { if (asyncNetworkTokensEnabled == null) { asyncNetworkTokensEnabled = _SINGLETON_VALUE_AsyncNetworkTokensEnabled.value(); } - return new MerchantAccount( + return new ApiRoutersMerchantAccountsSchemasMerchantAccount( id, displayName, loonClientKey, loonSecretKey, loonAcceptedSchemes, accountUpdaterRequestEncryptionKey, accountUpdaterRequestEncryptionKeyId, accountUpdaterResponseDecryptionKey, accountUpdaterResponseDecryptionKeyId, diff --git a/src/main/java/com/gr4vy/sdk/models/components/CertificateAlgorithm.java b/src/main/java/com/gr4vy/sdk/models/components/CertificateAlgorithm.java new file mode 100644 index 00000000..f498f0db --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/CertificateAlgorithm.java @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +public class CertificateAlgorithm { + + public static final CertificateAlgorithm ECDSA = new CertificateAlgorithm("ECDSA"); + public static final CertificateAlgorithm RSA = new CertificateAlgorithm("RSA"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private CertificateAlgorithm(String value) { + this.value = value; + } + + /** + * Returns a CertificateAlgorithm with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as CertificateAlgorithm + */ + @JsonCreator + public static CertificateAlgorithm of(String value) { + synchronized (CertificateAlgorithm.class) { + return values.computeIfAbsent(value, v -> new CertificateAlgorithm(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CertificateAlgorithm other = (CertificateAlgorithm) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "CertificateAlgorithm [value=" + value + "]"; + } + + // return an array just like an enum + public static CertificateAlgorithm[] values() { + synchronized (CertificateAlgorithm.class) { + return values.values().toArray(new CertificateAlgorithm[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("ECDSA", ECDSA); + map.put("RSA", RSA); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("ECDSA", CertificateAlgorithmEnum.ECDSA); + map.put("RSA", CertificateAlgorithmEnum.RSA); + return map; + } + + + public enum CertificateAlgorithmEnum { + + ECDSA("ECDSA"), + RSA("RSA"),; + + private final String value; + + private CertificateAlgorithmEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/gr4vy/sdk/models/components/CollectionAPIKeyPair.java b/src/main/java/com/gr4vy/sdk/models/components/CollectionAPIKeyPair.java new file mode 100644 index 00000000..77e4ae95 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/CollectionAPIKeyPair.java @@ -0,0 +1,304 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CollectionAPIKeyPair { + /** + * A list of items returned for this request. + */ + @JsonProperty("items") + private List items; + + /** + * The number of items for this page. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("limit") + private Optional limit; + + /** + * The cursor pointing at the next page of items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("next_cursor") + private JsonNullable nextCursor; + + /** + * The cursor pointing at the previous page of items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("previous_cursor") + private JsonNullable previousCursor; + + @JsonCreator + public CollectionAPIKeyPair( + @JsonProperty("items") List items, + @JsonProperty("limit") Optional limit, + @JsonProperty("next_cursor") JsonNullable nextCursor, + @JsonProperty("previous_cursor") JsonNullable previousCursor) { + Utils.checkNotNull(items, "items"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(nextCursor, "nextCursor"); + Utils.checkNotNull(previousCursor, "previousCursor"); + this.items = items; + this.limit = limit; + this.nextCursor = nextCursor; + this.previousCursor = previousCursor; + } + + public CollectionAPIKeyPair( + List items) { + this(items, Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined()); + } + + /** + * A list of items returned for this request. + */ + @JsonIgnore + public List items() { + return items; + } + + /** + * The number of items for this page. + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + /** + * The cursor pointing at the next page of items. + */ + @JsonIgnore + public JsonNullable nextCursor() { + return nextCursor; + } + + /** + * The cursor pointing at the previous page of items. + */ + @JsonIgnore + public JsonNullable previousCursor() { + return previousCursor; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A list of items returned for this request. + */ + public CollectionAPIKeyPair withItems(List items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * The number of items for this page. + */ + public CollectionAPIKeyPair withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + + /** + * The number of items for this page. + */ + public CollectionAPIKeyPair withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * The cursor pointing at the next page of items. + */ + public CollectionAPIKeyPair withNextCursor(String nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = JsonNullable.of(nextCursor); + return this; + } + + /** + * The cursor pointing at the next page of items. + */ + public CollectionAPIKeyPair withNextCursor(JsonNullable nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = nextCursor; + return this; + } + + /** + * The cursor pointing at the previous page of items. + */ + public CollectionAPIKeyPair withPreviousCursor(String previousCursor) { + Utils.checkNotNull(previousCursor, "previousCursor"); + this.previousCursor = JsonNullable.of(previousCursor); + return this; + } + + /** + * The cursor pointing at the previous page of items. + */ + public CollectionAPIKeyPair withPreviousCursor(JsonNullable previousCursor) { + Utils.checkNotNull(previousCursor, "previousCursor"); + this.previousCursor = previousCursor; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollectionAPIKeyPair other = (CollectionAPIKeyPair) o; + return + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.nextCursor, other.nextCursor) && + Utils.enhancedDeepEquals(this.previousCursor, other.previousCursor); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + items, limit, nextCursor, + previousCursor); + } + + @Override + public String toString() { + return Utils.toString(CollectionAPIKeyPair.class, + "items", items, + "limit", limit, + "nextCursor", nextCursor, + "previousCursor", previousCursor); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private List items; + + private Optional limit; + + private JsonNullable nextCursor = JsonNullable.undefined(); + + private JsonNullable previousCursor = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A list of items returned for this request. + */ + public Builder items(List items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + + /** + * The number of items for this page. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * The number of items for this page. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + /** + * The cursor pointing at the next page of items. + */ + public Builder nextCursor(String nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = JsonNullable.of(nextCursor); + return this; + } + + /** + * The cursor pointing at the next page of items. + */ + public Builder nextCursor(JsonNullable nextCursor) { + Utils.checkNotNull(nextCursor, "nextCursor"); + this.nextCursor = nextCursor; + return this; + } + + + /** + * The cursor pointing at the previous page of items. + */ + public Builder previousCursor(String previousCursor) { + Utils.checkNotNull(previousCursor, "previousCursor"); + this.previousCursor = JsonNullable.of(previousCursor); + return this; + } + + /** + * The cursor pointing at the previous page of items. + */ + public Builder previousCursor(JsonNullable previousCursor) { + Utils.checkNotNull(previousCursor, "previousCursor"); + this.previousCursor = previousCursor; + return this; + } + + public CollectionAPIKeyPair build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + return new CollectionAPIKeyPair( + items, limit, nextCursor, + previousCursor); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccounts.java b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccounts.java index 348a2178..8c524fce 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/MerchantAccounts.java +++ b/src/main/java/com/gr4vy/sdk/models/components/MerchantAccounts.java @@ -24,7 +24,7 @@ public class MerchantAccounts { * A list of items returned for this request. */ @JsonProperty("items") - private List items; + private List items; /** * The number of items for this page. @@ -49,7 +49,7 @@ public class MerchantAccounts { @JsonCreator public MerchantAccounts( - @JsonProperty("items") List items, + @JsonProperty("items") List items, @JsonProperty("limit") Optional limit, @JsonProperty("next_cursor") JsonNullable nextCursor, @JsonProperty("previous_cursor") JsonNullable previousCursor) { @@ -64,7 +64,7 @@ public MerchantAccounts( } public MerchantAccounts( - List items) { + List items) { this(items, Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); } @@ -73,7 +73,7 @@ public MerchantAccounts( * A list of items returned for this request. */ @JsonIgnore - public List items() { + public List items() { return items; } @@ -109,7 +109,7 @@ public static Builder builder() { /** * A list of items returned for this request. */ - public MerchantAccounts withItems(List items) { + public MerchantAccounts withItems(List items) { Utils.checkNotNull(items, "items"); this.items = items; return this; @@ -205,7 +205,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private List items; + private List items; private Optional limit; @@ -221,7 +221,7 @@ private Builder() { /** * A list of items returned for this request. */ - public Builder items(List items) { + public Builder items(List items) { Utils.checkNotNull(items, "items"); this.items = items; return this; diff --git a/src/main/java/com/gr4vy/sdk/models/components/PermissionSet.java b/src/main/java/com/gr4vy/sdk/models/components/PermissionSet.java new file mode 100644 index 00000000..415f8908 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/PermissionSet.java @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.List; + + +public class PermissionSet { + + @JsonProperty("allow") + private List allow; + + @JsonCreator + public PermissionSet( + @JsonProperty("allow") List allow) { + Utils.checkNotNull(allow, "allow"); + this.allow = allow; + } + + @JsonIgnore + public List allow() { + return allow; + } + + public static Builder builder() { + return new Builder(); + } + + + public PermissionSet withAllow(List allow) { + Utils.checkNotNull(allow, "allow"); + this.allow = allow; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PermissionSet other = (PermissionSet) o; + return + Utils.enhancedDeepEquals(this.allow, other.allow); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + allow); + } + + @Override + public String toString() { + return Utils.toString(PermissionSet.class, + "allow", allow); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private List allow; + + private Builder() { + // force use of static builder() method + } + + + public Builder allow(List allow) { + Utils.checkNotNull(allow, "allow"); + this.allow = allow; + return this; + } + + public PermissionSet build() { + + return new PermissionSet( + allow); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/Refund.java b/src/main/java/com/gr4vy/sdk/models/components/Refund.java index a568113f..311639b2 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/Refund.java +++ b/src/main/java/com/gr4vy/sdk/models/components/Refund.java @@ -130,7 +130,7 @@ public class Refund { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("creator") - private JsonNullable creator; + private JsonNullable creator; /** * The standardized error code set by Gr4vy. @@ -192,7 +192,7 @@ public Refund( @JsonProperty("transaction_external_identifier") JsonNullable transactionExternalIdentifier, @JsonProperty("created_at") OffsetDateTime createdAt, @JsonProperty("updated_at") OffsetDateTime updatedAt, - @JsonProperty("creator") JsonNullable creator, + @JsonProperty("creator") JsonNullable creator, @JsonProperty("error_code") JsonNullable errorCode, @JsonProperty("raw_response_code") JsonNullable rawResponseCode, @JsonProperty("raw_response_description") JsonNullable rawResponseDescription, @@ -400,8 +400,8 @@ public OffsetDateTime updatedAt() { */ @SuppressWarnings("unchecked") @JsonIgnore - public JsonNullable creator() { - return (JsonNullable) creator; + public JsonNullable creator() { + return (JsonNullable) creator; } /** @@ -642,7 +642,7 @@ public Refund withUpdatedAt(OffsetDateTime updatedAt) { /** * The user that created this resource */ - public Refund withCreator(Creator creator) { + public Refund withCreator(ApiCommonSchemasCreator creator) { Utils.checkNotNull(creator, "creator"); this.creator = JsonNullable.of(creator); return this; @@ -651,7 +651,7 @@ public Refund withCreator(Creator creator) { /** * The user that created this resource */ - public Refund withCreator(JsonNullable creator) { + public Refund withCreator(JsonNullable creator) { Utils.checkNotNull(creator, "creator"); this.creator = creator; return this; @@ -870,7 +870,7 @@ public final static class Builder { private OffsetDateTime updatedAt; - private JsonNullable creator = JsonNullable.undefined(); + private JsonNullable creator = JsonNullable.undefined(); private JsonNullable errorCode = JsonNullable.undefined(); @@ -1087,7 +1087,7 @@ public Builder updatedAt(OffsetDateTime updatedAt) { /** * The user that created this resource */ - public Builder creator(Creator creator) { + public Builder creator(ApiCommonSchemasCreator creator) { Utils.checkNotNull(creator, "creator"); this.creator = JsonNullable.of(creator); return this; @@ -1096,7 +1096,7 @@ public Builder creator(Creator creator) { /** * The user that created this resource */ - public Builder creator(JsonNullable creator) { + public Builder creator(JsonNullable creator) { Utils.checkNotNull(creator, "creator"); this.creator = creator; return this; diff --git a/src/main/java/com/gr4vy/sdk/models/components/Role.java b/src/main/java/com/gr4vy/sdk/models/components/Role.java new file mode 100644 index 00000000..850352d6 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/Role.java @@ -0,0 +1,203 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class Role { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + + @JsonProperty("id") + private String id; + + + @JsonProperty("name") + private String name; + + + @JsonProperty("description") + private String description; + + + @JsonProperty("permissions") + private PermissionSet permissions; + + @JsonCreator + public Role( + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("description") String description, + @JsonProperty("permissions") PermissionSet permissions) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(permissions, "permissions"); + this.type = Builder._SINGLETON_VALUE_Type.value(); + this.id = id; + this.name = name; + this.description = description; + this.permissions = permissions; + } + + @JsonIgnore + public Optional type() { + return type; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String description() { + return description; + } + + @JsonIgnore + public PermissionSet permissions() { + return permissions; + } + + public static Builder builder() { + return new Builder(); + } + + + public Role withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Role withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Role withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + public Role withPermissions(PermissionSet permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = permissions; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Role other = (Role) o; + return + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.permissions, other.permissions); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type, id, name, + description, permissions); + } + + @Override + public String toString() { + return Utils.toString(Role.class, + "type", type, + "id", id, + "name", name, + "description", description, + "permissions", permissions); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private String name; + + private String description; + + private PermissionSet permissions; + + private Builder() { + // force use of static builder() method + } + + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + public Builder permissions(PermissionSet permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = permissions; + return this; + } + + public Role build() { + + return new Role( + id, name, description, + permissions); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"role\"", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..6283a189 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.operations.CreateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; + +public class CreateApiKeyPairRequestBuilder { + + private APIKeyPairCreate request; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public CreateApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CreateApiKeyPairRequestBuilder request(APIKeyPairCreate request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateApiKeyPairResponse call() { + + RequestOperation operation + = new CreateApiKeyPair.Sync(sdkConfiguration, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairResponse.java new file mode 100644 index 00000000..25a1b326 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateApiKeyPairResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public CreateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public CreateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CreateApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public CreateApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public CreateApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateApiKeyPairResponse other = (CreateApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(CreateApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public CreateApiKeyPairResponse build() { + + return new CreateApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/CreateMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/CreateMerchantAccountResponse.java index d25150d9..1c3bf8c1 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/CreateMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/CreateMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.Response; import com.gr4vy.sdk.utils.Utils; import java.io.InputStream; @@ -36,22 +36,22 @@ public class CreateMerchantAccountResponse implements Response { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public CreateMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public CreateMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public CreateMerchantAccountResponse withRawResponse(HttpResponse r /** * Successful Response */ - public CreateMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public CreateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public CreateMerchantAccountResponse withMerchantAccount(MerchantAccount merchan /** * Successful Response */ - public CreateMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public CreateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public CreateMerchantAccountResponse build() { return new CreateMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequest.java new file mode 100644 index 00000000..b1a0e641 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequest.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class DeleteApiKeyPairRequest { + /** + * The ID of the API key pair. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_key_pair_id") + private String apiKeyPairId; + + @JsonCreator + public DeleteApiKeyPairRequest( + String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + } + + /** + * The ID of the API key pair. + */ + @JsonIgnore + public String apiKeyPairId() { + return apiKeyPairId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the API key pair. + */ + public DeleteApiKeyPairRequest withApiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteApiKeyPairRequest other = (DeleteApiKeyPairRequest) o; + return + Utils.enhancedDeepEquals(this.apiKeyPairId, other.apiKeyPairId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + apiKeyPairId); + } + + @Override + public String toString() { + return Utils.toString(DeleteApiKeyPairRequest.class, + "apiKeyPairId", apiKeyPairId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String apiKeyPairId; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the API key pair. + */ + public Builder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public DeleteApiKeyPairRequest build() { + + return new DeleteApiKeyPairRequest( + apiKeyPairId); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..c4735e85 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.operations.DeleteApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; + +public class DeleteApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public DeleteApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeleteApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + + private DeleteApiKeyPairRequest buildRequest() { + + DeleteApiKeyPairRequest request = new DeleteApiKeyPairRequest(apiKeyPairId); + + return request; + } + + public DeleteApiKeyPairResponse call() { + + RequestOperation operation + = new DeleteApiKeyPair.Sync(sdkConfiguration, _headers); + DeleteApiKeyPairRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairResponse.java new file mode 100644 index 00000000..4813edf9 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/DeleteApiKeyPairResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeleteApiKeyPairResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeleteApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteApiKeyPairResponse other = (DeleteApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteApiKeyPairResponse build() { + + return new DeleteApiKeyPairResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequest.java new file mode 100644 index 00000000..e8825a77 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequest.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class GetApiKeyPairRequest { + /** + * The ID of the API key pair. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_key_pair_id") + private String apiKeyPairId; + + @JsonCreator + public GetApiKeyPairRequest( + String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + } + + /** + * The ID of the API key pair. + */ + @JsonIgnore + public String apiKeyPairId() { + return apiKeyPairId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the API key pair. + */ + public GetApiKeyPairRequest withApiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetApiKeyPairRequest other = (GetApiKeyPairRequest) o; + return + Utils.enhancedDeepEquals(this.apiKeyPairId, other.apiKeyPairId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + apiKeyPairId); + } + + @Override + public String toString() { + return Utils.toString(GetApiKeyPairRequest.class, + "apiKeyPairId", apiKeyPairId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String apiKeyPairId; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the API key pair. + */ + public Builder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public GetApiKeyPairRequest build() { + + return new GetApiKeyPairRequest( + apiKeyPairId); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..41990b39 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairRequestBuilder.java @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.operations.GetApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.Optional; + +public class GetApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public GetApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public GetApiKeyPairRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetApiKeyPairRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private GetApiKeyPairRequest buildRequest() { + + GetApiKeyPairRequest request = new GetApiKeyPairRequest(apiKeyPairId); + + return request; + } + + public GetApiKeyPairResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new GetApiKeyPair.Sync(sdkConfiguration, options, _headers); + GetApiKeyPairRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairResponse.java new file mode 100644 index 00000000..d17cfaa8 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/GetApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetApiKeyPairResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public GetApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public GetApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public GetApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public GetApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetApiKeyPairResponse other = (GetApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(GetApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public GetApiKeyPairResponse build() { + + return new GetApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountResponse.java index 476c35b7..2d27884f 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/GetMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.Response; import com.gr4vy.sdk.utils.Utils; import java.io.InputStream; @@ -36,22 +36,22 @@ public class GetMerchantAccountResponse implements Response { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public GetMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public GetMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public GetMerchantAccountResponse withRawResponse(HttpResponse rawR /** * Successful Response */ - public GetMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public GetMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public GetMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAc /** * Successful Response */ - public GetMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public GetMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public GetMerchantAccountResponse build() { return new GetMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequest.java new file mode 100644 index 00000000..a5ad3567 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequest.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListApiKeyPairsRequest { + /** + * A pointer to the page of results to return. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=cursor") + private JsonNullable cursor; + + /** + * The maximum number of items that are returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") + private Optional limit; + + @JsonCreator + public ListApiKeyPairsRequest( + JsonNullable cursor, + Optional limit) { + Utils.checkNotNull(cursor, "cursor"); + Utils.checkNotNull(limit, "limit"); + this.cursor = cursor; + this.limit = limit; + } + + public ListApiKeyPairsRequest() { + this(JsonNullable.undefined(), Optional.empty()); + } + + /** + * A pointer to the page of results to return. + */ + @JsonIgnore + public JsonNullable cursor() { + return cursor; + } + + /** + * The maximum number of items that are returned. + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A pointer to the page of results to return. + */ + public ListApiKeyPairsRequest withCursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * A pointer to the page of results to return. + */ + public ListApiKeyPairsRequest withCursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + /** + * The maximum number of items that are returned. + */ + public ListApiKeyPairsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + + /** + * The maximum number of items that are returned. + */ + public ListApiKeyPairsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListApiKeyPairsRequest other = (ListApiKeyPairsRequest) o; + return + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.limit, other.limit); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + cursor, limit); + } + + @Override + public String toString() { + return Utils.toString(ListApiKeyPairsRequest.class, + "cursor", cursor, + "limit", limit); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable cursor = JsonNullable.undefined(); + + private Optional limit; + + private Builder() { + // force use of static builder() method + } + + + /** + * A pointer to the page of results to return. + */ + public Builder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * A pointer to the page of results to return. + */ + public Builder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + /** + * The maximum number of items that are returned. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * The maximum number of items that are returned. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListApiKeyPairsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + return new ListApiKeyPairsRequest( + cursor, limit); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequestBuilder.java new file mode 100644 index 00000000..93653a34 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsRequestBuilder.java @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.utils.Utils.transform; +import static com.gr4vy.sdk.utils.Utils.toStream; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.operations.ListApiKeyPairs; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import com.gr4vy.sdk.utils.pagination.CursorTracker; +import com.gr4vy.sdk.utils.pagination.Paginator; +import java.io.InputStream; +import java.lang.Iterable; +import java.lang.Long; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Iterator; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ListApiKeyPairsRequestBuilder { + + private JsonNullable cursor = JsonNullable.undefined(); + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "20", + new TypeReference>() {}); + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public ListApiKeyPairsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ListApiKeyPairsRequestBuilder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + public ListApiKeyPairsRequestBuilder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + public ListApiKeyPairsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListApiKeyPairsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListApiKeyPairsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ListApiKeyPairsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private ListApiKeyPairsRequest buildRequest() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + ListApiKeyPairsRequest request = new ListApiKeyPairsRequest(cursor, + limit); + + return request; + } + + public ListApiKeyPairsResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new ListApiKeyPairs.Sync(sdkConfiguration, options, _headers); + ListApiKeyPairsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Returns an iterable that performs next page calls till no more pages + * are returned. + * + *

The returned iterable can be used in a for-each loop: + *


+    * for (ListApiKeyPairsResponse page : builder.callAsIterable()) {
+    *     // Process each page
+    * }
+    * 
+ * + * @return An iterable that can be used to iterate through all pages + */ + public Iterable callAsIterable() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new ListApiKeyPairs.Sync(sdkConfiguration, options, _headers); + ListApiKeyPairsRequest request = buildRequest(); + Iterator> iterator = new Paginator<>( + request, + new CursorTracker<>("$.next_cursor", String.class), + (req, pos) -> { + var modifiedReq = pos == null ? req : req.withCursor(pos); + return unchecked(() -> operation.doRequest(modifiedReq)).get(); + }); + + return () -> transform(iterator, operation::handleResponse); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ + public Stream callAsStream() { + return toStream(callAsIterable()); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsResponse.java new file mode 100644 index 00000000..5e6f5896 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListApiKeyPairsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.CollectionAPIKeyPair; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListApiKeyPairsResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional collectionAPIKeyPair; + + @JsonCreator + public ListApiKeyPairsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional collectionAPIKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.collectionAPIKeyPair = collectionAPIKeyPair; + } + + public ListApiKeyPairsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional collectionAPIKeyPair() { + return (Optional) collectionAPIKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ListApiKeyPairsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListApiKeyPairsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListApiKeyPairsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public ListApiKeyPairsResponse withCollectionAPIKeyPair(CollectionAPIKeyPair collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = Optional.ofNullable(collectionAPIKeyPair); + return this; + } + + + /** + * Successful Response + */ + public ListApiKeyPairsResponse withCollectionAPIKeyPair(Optional collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = collectionAPIKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListApiKeyPairsResponse other = (ListApiKeyPairsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.collectionAPIKeyPair, other.collectionAPIKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + collectionAPIKeyPair); + } + + @Override + public String toString() { + return Utils.toString(ListApiKeyPairsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "collectionAPIKeyPair", collectionAPIKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional collectionAPIKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder collectionAPIKeyPair(CollectionAPIKeyPair collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = Optional.ofNullable(collectionAPIKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder collectionAPIKeyPair(Optional collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = collectionAPIKeyPair; + return this; + } + + public ListApiKeyPairsResponse build() { + + return new ListApiKeyPairsResponse( + contentType, statusCode, rawResponse, + collectionAPIKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequest.java new file mode 100644 index 00000000..db773cb7 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.utils.SpeakeasyMetadata; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class UpdateApiKeyPairRequest { + /** + * The ID of the API key pair. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_key_pair_id") + private String apiKeyPairId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private APIKeyPairUpdate apiKeyPairUpdate; + + @JsonCreator + public UpdateApiKeyPairRequest( + String apiKeyPairId, + APIKeyPairUpdate apiKeyPairUpdate) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + Utils.checkNotNull(apiKeyPairUpdate, "apiKeyPairUpdate"); + this.apiKeyPairId = apiKeyPairId; + this.apiKeyPairUpdate = apiKeyPairUpdate; + } + + /** + * The ID of the API key pair. + */ + @JsonIgnore + public String apiKeyPairId() { + return apiKeyPairId; + } + + @JsonIgnore + public APIKeyPairUpdate apiKeyPairUpdate() { + return apiKeyPairUpdate; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The ID of the API key pair. + */ + public UpdateApiKeyPairRequest withApiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public UpdateApiKeyPairRequest withAPIKeyPairUpdate(APIKeyPairUpdate apiKeyPairUpdate) { + Utils.checkNotNull(apiKeyPairUpdate, "apiKeyPairUpdate"); + this.apiKeyPairUpdate = apiKeyPairUpdate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyPairRequest other = (UpdateApiKeyPairRequest) o; + return + Utils.enhancedDeepEquals(this.apiKeyPairId, other.apiKeyPairId) && + Utils.enhancedDeepEquals(this.apiKeyPairUpdate, other.apiKeyPairUpdate); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + apiKeyPairId, apiKeyPairUpdate); + } + + @Override + public String toString() { + return Utils.toString(UpdateApiKeyPairRequest.class, + "apiKeyPairId", apiKeyPairId, + "apiKeyPairUpdate", apiKeyPairUpdate); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String apiKeyPairId; + + private APIKeyPairUpdate apiKeyPairUpdate; + + private Builder() { + // force use of static builder() method + } + + + /** + * The ID of the API key pair. + */ + public Builder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + + public Builder apiKeyPairUpdate(APIKeyPairUpdate apiKeyPairUpdate) { + Utils.checkNotNull(apiKeyPairUpdate, "apiKeyPairUpdate"); + this.apiKeyPairUpdate = apiKeyPairUpdate; + return this; + } + + public UpdateApiKeyPairRequest build() { + + return new UpdateApiKeyPairRequest( + apiKeyPairId, apiKeyPairUpdate); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..c94f101e --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.operations.UpdateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; + +public class UpdateApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private APIKeyPairUpdate apiKeyPairUpdate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public UpdateApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public UpdateApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public UpdateApiKeyPairRequestBuilder apiKeyPairUpdate(APIKeyPairUpdate apiKeyPairUpdate) { + Utils.checkNotNull(apiKeyPairUpdate, "apiKeyPairUpdate"); + this.apiKeyPairUpdate = apiKeyPairUpdate; + return this; + } + + + private UpdateApiKeyPairRequest buildRequest() { + + UpdateApiKeyPairRequest request = new UpdateApiKeyPairRequest(apiKeyPairId, + apiKeyPairUpdate); + + return request; + } + + public UpdateApiKeyPairResponse call() { + + RequestOperation operation + = new UpdateApiKeyPair.Sync(sdkConfiguration, _headers); + UpdateApiKeyPairRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairResponse.java new file mode 100644 index 00000000..c793056d --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/UpdateApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.Response; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdateApiKeyPairResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public UpdateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public UpdateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public UpdateApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public UpdateApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public UpdateApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyPairResponse other = (UpdateApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(UpdateApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public UpdateApiKeyPairResponse build() { + + return new UpdateApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountResponse.java index d82cb46e..a7b26492 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/UpdateMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.Response; import com.gr4vy.sdk.utils.Utils; import java.io.InputStream; @@ -36,22 +36,22 @@ public class UpdateMerchantAccountResponse implements Response { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public UpdateMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public UpdateMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public UpdateMerchantAccountResponse withRawResponse(HttpResponse r /** * Successful Response */ - public UpdateMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public UpdateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public UpdateMerchantAccountResponse withMerchantAccount(MerchantAccount merchan /** * Successful Response */ - public UpdateMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public UpdateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public UpdateMerchantAccountResponse build() { return new UpdateMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..a735d5df --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairRequestBuilder.java @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.operations.CreateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.util.concurrent.CompletableFuture; + +public class CreateApiKeyPairRequestBuilder { + + private APIKeyPairCreate request; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public CreateApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CreateApiKeyPairRequestBuilder request(APIKeyPairCreate request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new CreateApiKeyPair.Async(sdkConfiguration, _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairResponse.java new file mode 100644 index 00000000..eaf282c3 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateApiKeyPairResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public CreateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public CreateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CreateApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public CreateApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public CreateApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateApiKeyPairResponse other = (CreateApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(CreateApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public CreateApiKeyPairResponse build() { + + return new CreateApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateMerchantAccountResponse.java index c94073a5..90f29267 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/CreateMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/CreateMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.AsyncResponse; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Utils; @@ -36,22 +36,22 @@ public class CreateMerchantAccountResponse implements AsyncResponse { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public CreateMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public CreateMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public CreateMerchantAccountResponse withRawResponse(HttpResponse rawRespo /** * Successful Response */ - public CreateMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public CreateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public CreateMerchantAccountResponse withMerchantAccount(MerchantAccount merchan /** * Successful Response */ - public CreateMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public CreateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public CreateMerchantAccountResponse build() { return new CreateMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..d772e570 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairRequestBuilder.java @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairRequest; +import com.gr4vy.sdk.operations.DeleteApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class DeleteApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public DeleteApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeleteApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + + private DeleteApiKeyPairRequest buildRequest() { + + DeleteApiKeyPairRequest request = new DeleteApiKeyPairRequest(apiKeyPairId); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new DeleteApiKeyPair.Async(sdkConfiguration, _headers); + DeleteApiKeyPairRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairResponse.java new file mode 100644 index 00000000..566f61b0 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/DeleteApiKeyPairResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeleteApiKeyPairResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeleteApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteApiKeyPairResponse other = (DeleteApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteApiKeyPairResponse build() { + + return new DeleteApiKeyPairResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..aa1866f9 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairRequestBuilder.java @@ -0,0 +1,70 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.operations.GetApiKeyPairRequest; +import com.gr4vy.sdk.operations.GetApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public GetApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public GetApiKeyPairRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetApiKeyPairRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private GetApiKeyPairRequest buildRequest() { + + GetApiKeyPairRequest request = new GetApiKeyPairRequest(apiKeyPairId); + + return request; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new GetApiKeyPair.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + GetApiKeyPairRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairResponse.java new file mode 100644 index 00000000..06b65598 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/GetApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetApiKeyPairResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public GetApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public GetApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public GetApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public GetApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetApiKeyPairResponse other = (GetApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(GetApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public GetApiKeyPairResponse build() { + + return new GetApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/GetMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/GetMerchantAccountResponse.java index 7e412c26..c2d11f03 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/GetMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/GetMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.AsyncResponse; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Utils; @@ -36,22 +36,22 @@ public class GetMerchantAccountResponse implements AsyncResponse { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public GetMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public GetMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public GetMerchantAccountResponse withRawResponse(HttpResponse rawResponse /** * Successful Response */ - public GetMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public GetMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public GetMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAc /** * Successful Response */ - public GetMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public GetMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public GetMerchantAccountResponse build() { return new GetMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsRequestBuilder.java new file mode 100644 index 00000000..e87742b2 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsRequestBuilder.java @@ -0,0 +1,154 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; +import static com.gr4vy.sdk.utils.reactive.ReactiveUtils.mapAsync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsRequest; +import com.gr4vy.sdk.operations.ListApiKeyPairs; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.LazySingletonValue; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import com.gr4vy.sdk.utils.pagination.AsyncPaginator; +import com.gr4vy.sdk.utils.pagination.CursorTracker; +import java.lang.Long; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Flow; +import org.openapitools.jackson.nullable.JsonNullable; +import org.reactivestreams.FlowAdapters; +import org.reactivestreams.Publisher; + +public class ListApiKeyPairsRequestBuilder { + + private JsonNullable cursor = JsonNullable.undefined(); + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "20", + new TypeReference>() {}); + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public ListApiKeyPairsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ListApiKeyPairsRequestBuilder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + public ListApiKeyPairsRequestBuilder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + public ListApiKeyPairsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListApiKeyPairsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListApiKeyPairsRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public ListApiKeyPairsRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + + private ListApiKeyPairsRequest buildRequest() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + ListApiKeyPairsRequest request = new ListApiKeyPairsRequest(cursor, + limit); + + return request; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new ListApiKeyPairs.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + ListApiKeyPairsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + /** + * Returns a Publisher that performs next page calls till no more pages + * are returned. + * + *

The returned publisher can be used with reactive frameworks: + *


+     * Publisher<ListApiKeyPairsResponse> publisher = builder.callAsPublisher();
+     * publisher.subscribe(new Subscriber<ListApiKeyPairsResponse>() {
+     *     // Handle onNext, onError, onComplete
+     * });
+     * 
+ * + * @return A Publisher that emits pages asynchronously + */ + public Publisher callAsPublisher() { + ListApiKeyPairsRequest request = this.buildRequest(); + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new ListApiKeyPairs.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + Flow.Publisher> asyncPaginator = new AsyncPaginator<>( + request, + new CursorTracker<>("$.next_cursor", String.class), + (req, pos) -> { + var modifiedReq = pos == null ? req : req.withCursor(pos); + return operation.doRequest(modifiedReq); + }); + + Flow.Publisher flowPublisher = mapAsync(asyncPaginator, operation::handleResponse); + + // Convert Flow.Publisher to Reactive Streams Publisher at the last stage + return FlowAdapters.toPublisher(flowPublisher); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsResponse.java new file mode 100644 index 00000000..a1bc2cf3 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListApiKeyPairsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.CollectionAPIKeyPair; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListApiKeyPairsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional collectionAPIKeyPair; + + @JsonCreator + public ListApiKeyPairsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional collectionAPIKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.collectionAPIKeyPair = collectionAPIKeyPair; + } + + public ListApiKeyPairsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional collectionAPIKeyPair() { + return (Optional) collectionAPIKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ListApiKeyPairsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListApiKeyPairsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListApiKeyPairsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public ListApiKeyPairsResponse withCollectionAPIKeyPair(CollectionAPIKeyPair collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = Optional.ofNullable(collectionAPIKeyPair); + return this; + } + + + /** + * Successful Response + */ + public ListApiKeyPairsResponse withCollectionAPIKeyPair(Optional collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = collectionAPIKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListApiKeyPairsResponse other = (ListApiKeyPairsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.collectionAPIKeyPair, other.collectionAPIKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + collectionAPIKeyPair); + } + + @Override + public String toString() { + return Utils.toString(ListApiKeyPairsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "collectionAPIKeyPair", collectionAPIKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional collectionAPIKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder collectionAPIKeyPair(CollectionAPIKeyPair collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = Optional.ofNullable(collectionAPIKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder collectionAPIKeyPair(Optional collectionAPIKeyPair) { + Utils.checkNotNull(collectionAPIKeyPair, "collectionAPIKeyPair"); + this.collectionAPIKeyPair = collectionAPIKeyPair; + return this; + } + + public ListApiKeyPairsResponse build() { + + return new ListApiKeyPairsResponse( + contentType, statusCode, rawResponse, + collectionAPIKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairRequestBuilder.java new file mode 100644 index 00000000..0a5f22ea --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairRequestBuilder.java @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.models.components.APIKeyPairUpdate; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairRequest; +import com.gr4vy.sdk.operations.UpdateApiKeyPair; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class UpdateApiKeyPairRequestBuilder { + + private String apiKeyPairId; + private APIKeyPairUpdate apiKeyPairUpdate; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public UpdateApiKeyPairRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public UpdateApiKeyPairRequestBuilder apiKeyPairId(String apiKeyPairId) { + Utils.checkNotNull(apiKeyPairId, "apiKeyPairId"); + this.apiKeyPairId = apiKeyPairId; + return this; + } + + public UpdateApiKeyPairRequestBuilder apiKeyPairUpdate(APIKeyPairUpdate apiKeyPairUpdate) { + Utils.checkNotNull(apiKeyPairUpdate, "apiKeyPairUpdate"); + this.apiKeyPairUpdate = apiKeyPairUpdate; + return this; + } + + + private UpdateApiKeyPairRequest buildRequest() { + + UpdateApiKeyPairRequest request = new UpdateApiKeyPairRequest(apiKeyPairId, + apiKeyPairUpdate); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new UpdateApiKeyPair.Async(sdkConfiguration, _headers); + UpdateApiKeyPairRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairResponse.java new file mode 100644 index 00000000..38db2444 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateApiKeyPairResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.utils.AsyncResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdateApiKeyPairResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful Response + */ + private Optional apiKeyPair; + + @JsonCreator + public UpdateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional apiKeyPair) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.apiKeyPair = apiKeyPair; + } + + public UpdateApiKeyPairResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful Response + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional apiKeyPair() { + return (Optional) apiKeyPair; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public UpdateApiKeyPairResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateApiKeyPairResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateApiKeyPairResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful Response + */ + public UpdateApiKeyPairResponse withAPIKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + + /** + * Successful Response + */ + public UpdateApiKeyPairResponse withAPIKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyPairResponse other = (UpdateApiKeyPairResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.apiKeyPair, other.apiKeyPair); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + @Override + public String toString() { + return Utils.toString(UpdateApiKeyPairResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "apiKeyPair", apiKeyPair); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional apiKeyPair = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful Response + */ + public Builder apiKeyPair(APIKeyPair apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = Optional.ofNullable(apiKeyPair); + return this; + } + + /** + * Successful Response + */ + public Builder apiKeyPair(Optional apiKeyPair) { + Utils.checkNotNull(apiKeyPair, "apiKeyPair"); + this.apiKeyPair = apiKeyPair; + return this; + } + + public UpdateApiKeyPairResponse build() { + + return new UpdateApiKeyPairResponse( + contentType, statusCode, rawResponse, + apiKeyPair); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateMerchantAccountResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateMerchantAccountResponse.java index c1ea21c1..fc5461fc 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateMerchantAccountResponse.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/UpdateMerchantAccountResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.utils.AsyncResponse; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Utils; @@ -36,22 +36,22 @@ public class UpdateMerchantAccountResponse implements AsyncResponse { /** * Successful Response */ - private Optional merchantAccount; + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount; @JsonCreator public UpdateMerchantAccountResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional merchantAccount) { + Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(merchantAccount, "merchantAccount"); + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; - this.merchantAccount = merchantAccount; + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; } public UpdateMerchantAccountResponse( @@ -91,8 +91,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional merchantAccount() { - return (Optional) merchantAccount; + public Optional apiRoutersMerchantAccountsSchemasMerchantAccount() { + return (Optional) apiRoutersMerchantAccountsSchemasMerchantAccount; } public static Builder builder() { @@ -130,9 +130,9 @@ public UpdateMerchantAccountResponse withRawResponse(HttpResponse rawRespo /** * Successful Response */ - public UpdateMerchantAccountResponse withMerchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public UpdateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } @@ -140,9 +140,9 @@ public UpdateMerchantAccountResponse withMerchantAccount(MerchantAccount merchan /** * Successful Response */ - public UpdateMerchantAccountResponse withMerchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public UpdateMerchantAccountResponse withApiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -159,14 +159,14 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.contentType, other.contentType) && Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && - Utils.enhancedDeepEquals(this.merchantAccount, other.merchantAccount); + Utils.enhancedDeepEquals(this.apiRoutersMerchantAccountsSchemasMerchantAccount, other.apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } @Override @@ -175,7 +175,7 @@ public String toString() { "contentType", contentType, "statusCode", statusCode, "rawResponse", rawResponse, - "merchantAccount", merchantAccount); + "apiRoutersMerchantAccountsSchemasMerchantAccount", apiRoutersMerchantAccountsSchemasMerchantAccount); } @SuppressWarnings("UnusedReturnValue") @@ -187,7 +187,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional merchantAccount = Optional.empty(); + private Optional apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.empty(); private Builder() { // force use of static builder() method @@ -227,18 +227,18 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * Successful Response */ - public Builder merchantAccount(MerchantAccount merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = Optional.ofNullable(merchantAccount); + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(ApiRoutersMerchantAccountsSchemasMerchantAccount apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = Optional.ofNullable(apiRoutersMerchantAccountsSchemasMerchantAccount); return this; } /** * Successful Response */ - public Builder merchantAccount(Optional merchantAccount) { - Utils.checkNotNull(merchantAccount, "merchantAccount"); - this.merchantAccount = merchantAccount; + public Builder apiRoutersMerchantAccountsSchemasMerchantAccount(Optional apiRoutersMerchantAccountsSchemasMerchantAccount) { + Utils.checkNotNull(apiRoutersMerchantAccountsSchemasMerchantAccount, "apiRoutersMerchantAccountsSchemasMerchantAccount"); + this.apiRoutersMerchantAccountsSchemasMerchantAccount = apiRoutersMerchantAccountsSchemasMerchantAccount; return this; } @@ -246,7 +246,7 @@ public UpdateMerchantAccountResponse build() { return new UpdateMerchantAccountResponse( contentType, statusCode, rawResponse, - merchantAccount); + apiRoutersMerchantAccountsSchemasMerchantAccount); } } diff --git a/src/main/java/com/gr4vy/sdk/operations/CreateApiKeyPair.java b/src/main/java/com/gr4vy/sdk/operations/CreateApiKeyPair.java new file mode 100644 index 00000000..0cad7536 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/CreateApiKeyPair.java @@ -0,0 +1,452 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.models.components.APIKeyPairCreate; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.CreateApiKeyPairResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.SerializedBody; +import com.gr4vy.sdk.utils.Utils.JsonShape; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.IllegalArgumentException; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class CreateApiKeyPair { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "create_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/api-key-pairs"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "", + "json", + false); + if (serializedRequestBody == null) { + throw new IllegalArgumentException("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(APIKeyPairCreate request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(APIKeyPairCreate request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public CreateApiKeyPairResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateApiKeyPairResponse.Builder resBuilder = + CreateApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withAPIKeyPair(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(APIKeyPairCreate request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(APIKeyPairCreate request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.CreateApiKeyPairResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.CreateApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.CreateApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withAPIKeyPair); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/CreateMerchantAccount.java b/src/main/java/com/gr4vy/sdk/operations/CreateMerchantAccount.java index 6426d3eb..18a3894e 100644 --- a/src/main/java/com/gr4vy/sdk/operations/CreateMerchantAccount.java +++ b/src/main/java/com/gr4vy/sdk/operations/CreateMerchantAccount.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.gr4vy.sdk.SDKConfiguration; import com.gr4vy.sdk.SecuritySource; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.models.components.MerchantAccountCreate; import com.gr4vy.sdk.models.errors.APIException; import com.gr4vy.sdk.models.errors.Error400; @@ -182,7 +182,7 @@ public CreateMerchantAccountResponse handleResponse(HttpResponse re if (Utils.statusCodeMatches(response.statusCode(), "201")) { if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); + return res.withApiRoutersMerchantAccountsSchemasMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); } else { throw APIException.from("Unexpected content-type received: " + contentType, response); } @@ -336,8 +336,8 @@ public CompletableFuture() {}) - .thenApply(res::withMerchantAccount); + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withApiRoutersMerchantAccountsSchemasMerchantAccount); } else { return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); } diff --git a/src/main/java/com/gr4vy/sdk/operations/DeleteApiKeyPair.java b/src/main/java/com/gr4vy/sdk/operations/DeleteApiKeyPair.java new file mode 100644 index 00000000..d7c9109c --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/DeleteApiKeyPair.java @@ -0,0 +1,428 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.DeleteApiKeyPairResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class DeleteApiKeyPair { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "delete_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/api-key-pairs/{api_key_pair_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(DeleteApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteApiKeyPairRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(DeleteApiKeyPairRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public DeleteApiKeyPairResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteApiKeyPairResponse.Builder resBuilder = + DeleteApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(DeleteApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteApiKeyPairRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(DeleteApiKeyPairRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.DeleteApiKeyPairResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.DeleteApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.DeleteApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return CompletableFuture.completedFuture(res); + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/GetApiKeyPair.java b/src/main/java/com/gr4vy/sdk/operations/GetApiKeyPair.java new file mode 100644 index 00000000..df5a826e --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/GetApiKeyPair.java @@ -0,0 +1,487 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.GetApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.GetApiKeyPairResponse; +import com.gr4vy.sdk.utils.AsyncRetries; +import com.gr4vy.sdk.utils.BackoffStrategy; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.NonRetryableException; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.Retries; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + + +public class GetApiKeyPair { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final List retryStatusCodes; + final RetryConfig retryConfig; + final HTTPClient client; + final Headers _headers; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("5XX"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(200, TimeUnit.MILLISECONDS) + .maxInterval(200, TimeUnit.MILLISECONDS) + .baseFactor((double) (1)) + .maxElapsedTime(1000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/api-key-pairs/{api_key_pair_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + super( + sdkConfiguration, options, + _headers); + } + + private HttpRequest onBuildRequest(GetApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetApiKeyPairRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetApiKeyPairRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + return onError(httpRes, null); + } + return httpRes; + } catch (Exception e) { + return onError(null, e); + } + }) + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .build(); + return unchecked(() -> onSuccess(retries.run())).get(); + } + + + @Override + public GetApiKeyPairResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetApiKeyPairResponse.Builder resBuilder = + GetApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withAPIKeyPair(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + private final ScheduledExecutorService retryScheduler; + + public Async( + SDKConfiguration sdkConfiguration, Optional options, + ScheduledExecutorService retryScheduler, Headers _headers) { + super( + sdkConfiguration, options, + _headers); + this.retryScheduler = retryScheduler; + } + + private CompletableFuture onBuildRequest(GetApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetApiKeyPairRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetApiKeyPairRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity())) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.GetApiKeyPairResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.GetApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.GetApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withAPIKeyPair); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/GetMerchantAccount.java b/src/main/java/com/gr4vy/sdk/operations/GetMerchantAccount.java index 20630452..78c7a7de 100644 --- a/src/main/java/com/gr4vy/sdk/operations/GetMerchantAccount.java +++ b/src/main/java/com/gr4vy/sdk/operations/GetMerchantAccount.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.gr4vy.sdk.SDKConfiguration; import com.gr4vy.sdk.SecuritySource; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.models.errors.APIException; import com.gr4vy.sdk.models.errors.Error400; import com.gr4vy.sdk.models.errors.Error401; @@ -206,7 +206,7 @@ public GetMerchantAccountResponse handleResponse(HttpResponse respo if (Utils.statusCodeMatches(response.statusCode(), "200")) { if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); + return res.withApiRoutersMerchantAccountsSchemasMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); } else { throw APIException.from("Unexpected content-type received: " + contentType, response); } @@ -371,8 +371,8 @@ public CompletableFuture() {}) - .thenApply(res::withMerchantAccount); + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withApiRoutersMerchantAccountsSchemasMerchantAccount); } else { return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); } diff --git a/src/main/java/com/gr4vy/sdk/operations/ListApiKeyPairs.java b/src/main/java/com/gr4vy/sdk/operations/ListApiKeyPairs.java new file mode 100644 index 00000000..b53f53d6 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/ListApiKeyPairs.java @@ -0,0 +1,490 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.CollectionAPIKeyPair; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsRequest; +import com.gr4vy.sdk.models.operations.ListApiKeyPairsResponse; +import com.gr4vy.sdk.utils.AsyncRetries; +import com.gr4vy.sdk.utils.BackoffStrategy; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.NonRetryableException; +import com.gr4vy.sdk.utils.Options; +import com.gr4vy.sdk.utils.Retries; +import com.gr4vy.sdk.utils.RetryConfig; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + + +public class ListApiKeyPairs { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final List retryStatusCodes; + final RetryConfig retryConfig; + final HTTPClient client; + final Headers _headers; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("5XX"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(200, TimeUnit.MILLISECONDS) + .maxInterval(200, TimeUnit.MILLISECONDS) + .baseFactor((double) (1)) + .maxElapsedTime(1000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_api_key_pairs", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_api_key_pairs", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "list_api_key_pairs", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/api-key-pairs"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + super( + sdkConfiguration, options, + _headers); + } + + private HttpRequest onBuildRequest(ListApiKeyPairsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ListApiKeyPairsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(ListApiKeyPairsRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + return onError(httpRes, null); + } + return httpRes; + } catch (Exception e) { + return onError(null, e); + } + }) + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .build(); + return unchecked(() -> onSuccess(retries.run())).get(); + } + + + @Override + public ListApiKeyPairsResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListApiKeyPairsResponse.Builder resBuilder = + ListApiKeyPairsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListApiKeyPairsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withCollectionAPIKeyPair(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + private final ScheduledExecutorService retryScheduler; + + public Async( + SDKConfiguration sdkConfiguration, Optional options, + ScheduledExecutorService retryScheduler, Headers _headers) { + super( + sdkConfiguration, options, + _headers); + this.retryScheduler = retryScheduler; + } + + private CompletableFuture onBuildRequest(ListApiKeyPairsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ListApiKeyPairsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(ListApiKeyPairsRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity())) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.ListApiKeyPairsResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.ListApiKeyPairsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.ListApiKeyPairsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withCollectionAPIKeyPair); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/UpdateApiKeyPair.java b/src/main/java/com/gr4vy/sdk/operations/UpdateApiKeyPair.java new file mode 100644 index 00000000..75708167 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/operations/UpdateApiKeyPair.java @@ -0,0 +1,454 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.operations; + +import static com.gr4vy.sdk.operations.Operations.RequestOperation; +import static com.gr4vy.sdk.utils.Exceptions.unchecked; +import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.SDKConfiguration; +import com.gr4vy.sdk.SecuritySource; +import com.gr4vy.sdk.models.components.APIKeyPair; +import com.gr4vy.sdk.models.errors.APIException; +import com.gr4vy.sdk.models.errors.Error400; +import com.gr4vy.sdk.models.errors.Error401; +import com.gr4vy.sdk.models.errors.Error403; +import com.gr4vy.sdk.models.errors.Error404; +import com.gr4vy.sdk.models.errors.Error405; +import com.gr4vy.sdk.models.errors.Error409; +import com.gr4vy.sdk.models.errors.Error425; +import com.gr4vy.sdk.models.errors.Error429; +import com.gr4vy.sdk.models.errors.Error500; +import com.gr4vy.sdk.models.errors.Error502; +import com.gr4vy.sdk.models.errors.Error504; +import com.gr4vy.sdk.models.errors.HTTPValidationError; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairRequest; +import com.gr4vy.sdk.models.operations.UpdateApiKeyPairResponse; +import com.gr4vy.sdk.utils.Blob; +import com.gr4vy.sdk.utils.HTTPClient; +import com.gr4vy.sdk.utils.HTTPRequest; +import com.gr4vy.sdk.utils.Headers; +import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl; +import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl; +import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl; +import com.gr4vy.sdk.utils.SerializedBody; +import com.gr4vy.sdk.utils.Utils.JsonShape; +import com.gr4vy.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.IllegalArgumentException; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class UpdateApiKeyPair { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "update_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "update_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "update_api_key_pair", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/api-key-pairs/{api_key_pair_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "PUT"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "apiKeyPairUpdate", + "json", + false); + if (serializedRequestBody == null) { + throw new IllegalArgumentException("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(UpdateApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdateApiKeyPairRequest.class, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(UpdateApiKeyPairRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public UpdateApiKeyPairResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdateApiKeyPairResponse.Builder resBuilder = + UpdateApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdateApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withAPIKeyPair(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error400.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error401.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error403.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error404.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error405.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error409.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw HTTPValidationError.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error425.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error429.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error500.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error502.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw Error504.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(UpdateApiKeyPairRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdateApiKeyPairRequest.class, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(UpdateApiKeyPairRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.gr4vy.sdk.models.operations.async.UpdateApiKeyPairResponse.Builder resBuilder = + com.gr4vy.sdk.models.operations.async.UpdateApiKeyPairResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.gr4vy.sdk.models.operations.async.UpdateApiKeyPairResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withAPIKeyPair); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error400.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error401.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error403.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error404.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "405")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error405.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "409")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error409.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return HTTPValidationError.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "425")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error425.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "429")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error429.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error500.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "502")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error502.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "504")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Error504.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/gr4vy/sdk/operations/UpdateMerchantAccount.java b/src/main/java/com/gr4vy/sdk/operations/UpdateMerchantAccount.java index addc038f..b4237b11 100644 --- a/src/main/java/com/gr4vy/sdk/operations/UpdateMerchantAccount.java +++ b/src/main/java/com/gr4vy/sdk/operations/UpdateMerchantAccount.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.gr4vy.sdk.SDKConfiguration; import com.gr4vy.sdk.SecuritySource; -import com.gr4vy.sdk.models.components.MerchantAccount; +import com.gr4vy.sdk.models.components.ApiRoutersMerchantAccountsSchemasMerchantAccount; import com.gr4vy.sdk.models.errors.APIException; import com.gr4vy.sdk.models.errors.Error400; import com.gr4vy.sdk.models.errors.Error401; @@ -184,7 +184,7 @@ public UpdateMerchantAccountResponse handleResponse(HttpResponse re if (Utils.statusCodeMatches(response.statusCode(), "200")) { if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); + return res.withApiRoutersMerchantAccountsSchemasMerchantAccount(Utils.unmarshal(response, new TypeReference() {})); } else { throw APIException.from("Unexpected content-type received: " + contentType, response); } @@ -338,8 +338,8 @@ public CompletableFuture() {}) - .thenApply(res::withMerchantAccount); + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withApiRoutersMerchantAccountsSchemasMerchantAccount); } else { return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); }